Node
Object Hierarchy:
Description:
public abstract class Node : Object, Serializable
Content:
Properties:
- public ArrayList<Node> children { get; set; }
- public FormatType kind { get; set; }
Block/format kind (PARAGRAPH, HEADING_1..6, TEXT, ITALIC, etc.).
Default NONE for Document, List, ListItem.
- public virtual FormatType node_type { get; set; }
For JSON polymorphic deserialization of children (Document→DOCUMENT,
Block→BLOCK, List→LIST, ListItem→LIST_ITEM, Format→FORMAT).
- public Node? parent { get; set; }
Set when added to a container; null for root. Exclude from JSON to
avoid cycles.
- public int uid { get; set; }
Unique id within the document; assigned when the node is created. Used
for traversal and position lookup.
Creation methods:
Methods:
- public void adopt (Node child)
Call when adding a child: child.parent = this (omit for Format if
desired).
- protected virtual Node? deserialize_child (Node elem)
Polymorphic child deserialization: dispatch by node_type. We write
this JSON; one key, fixed format.
- public override bool deserialize_property (string property_name, out Value value, ParamSpec pspec, Node property_node)
- public Document? document ()
Root document; null if this node is not in a document tree.
- public Node? next ()
Next sibling in parent's children list; null if last or no parent.
- public override Node serialize_property (string property_name, Value value, ParamSpec pspec)
- public virtual string text_content ()
Flattened text of this node (e.g. for ListItem: first paragraph/inline
subtree as single line).
- public virtual string to_markdown ()
Convert this node (and children) back to markdown text. Override in
subclasses.
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface Json.Serializable
- default_deserialize_property
- default_serialize_property
- deserialize_property
- find_property
- get_property
- list_properties
- serialize_property
- set_property