org_document.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * @file org_document.h
  3. * @brief Defines the root document element
  4. */
  5. /*
  6. * This program is free software: you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation, either vers* ion 3 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see
  18. * <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef ORG_DOCUMENT_H
  21. #define ORG_DOCUMENT_H
  22. #include "doc_stream.h"
  23. #include "doc_ref.h"
  24. /* type forward declaration */
  25. struct org_document;
  26. typedef struct org_document org_document;
  27. typedef struct org_heading org_heading;
  28. typedef struct org_text org_text;
  29. typedef struct print_ctxt print_ctxt;
  30. /* shov the ops */
  31. typedef struct doc_elt_ops doc_elt_ops;
  32. extern doc_elt_ops org_document_ops;
  33. /* Constructor, Destructor */
  34. org_document *org_document_create_empty (doc_elt_ops *org_doc_ops);
  35. void org_document_free (org_document *self);
  36. /* Adding sub elements */
  37. void org_document_add_text_last (org_document *document, doc_src src, org_text *text);
  38. void org_document_add_heading_last (org_document *document, doc_src src, org_heading *text);
  39. void org_document_print (org_document *doc, print_ctxt *ctxt, doc_stream *out);
  40. void org_document_merge (org_document *anc, org_document *desc, merge_ctxt *ctxt);
  41. /* will call thes function on its children after it searches for
  42. itself */
  43. bool
  44. org_document_check_for_loop (org_document *this);
  45. #endif /* ORG_DOCUMENT_H */