Browse Source

Implement new isrelated and print strategies.

- Add tag merging for org_heading
- Use priorities and todo states$
Andrew Young 8 years ago
parent
commit
6982e506c3
2 changed files with 1143 additions and 311 deletions
  1. 1096 306
      src/org_heading.c
  2. 47 5
      src/org_heading.h

File diff suppressed because it is too large
+ 1096 - 306
src/org_heading.c


+ 47 - 5
src/org_heading.h

@@ -19,21 +19,63 @@ typedef struct org_heading org_heading;
 typedef struct doc_elt_ops doc_elt_ops;
 extern doc_elt_ops org_heading_ops;
 
+
 /* Constructor, Destructor */
+/**
+ * @brief Construct an empty org heading element.
+ */
 org_heading *org_heading_create_empty (doc_elt_ops *elt_ops);
+
+/**
+ * @brief Free an org heading.
+ */
 void org_heading_free (org_heading *self);
 
 /* Getters and Setters */
 int org_heading_get_level (org_heading *self, doc_src src);
 void org_heading_set_level (org_heading *self, int level, doc_src src);
 
-char * org_heading_get_text (org_heading *self, doc_src src);
-void org_heading_set_text (org_heading *self, char *string, int length, doc_src src);
+doc_ref* org_heading_get_doc_ref (org_heading *heading);
+void org_heading_set_doc_ref (org_heading *heading, doc_ref *ref);
+
+/**
+ * @brief Set the entire text of a heading.
+ *
+ * This function expects a single line storing an entire heading,
+ * including leading stars and any trailing line breaks.  The line
+ * will be parsed, and any internal variables will be set. The string
+ * is not null terminated.
+ */
+void org_heading_set_entire_text (org_heading *self, char *string, int length,
+				  doc_src src, parse_ctxt *ctxt);
 
-void org_heading_add_property_empty (char *string, doc_src src);
+/**
+ * @brief Set the key of a heading.
+ * This key will be used to identify the heading globally.
+ * Set the key to an empty key to disable global matching.
+ * The key can be accessed through doc_elt_get_key.
+ */
+void org_heading_set_key (org_heading *self, char*key, size_t length);
 
 /* Adding sub elements */
-void org_heading_add_subtext_last (org_heading *heading, doc_src src, org_text *text);
-void org_heading_add_subheading_last (org_heading *heading, doc_src src, org_heading *text);
+/**
+ * @brief Add a doc_elt as the last item in the list of text
+ * subelements.
+ */
+void org_heading_add_subtext_last (org_heading *heading, doc_src src, 
+				   doc_elt *elt);
+
+/**
+ * @brief Add a doc_elt as the last item in the list of heading
+ * subelements.
+ */
+void org_heading_add_subheading_last (org_heading *heading, doc_src src,
+				      doc_elt *elt);
+
+bool org_heading_check_for_target (org_heading *this, org_heading* target);
+
+/* will call thes function on its children after it searches for
+   itself */
+bool org_heading_check_for_loop (org_heading *this);
 
 #endif