org_text.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @file org_text.h
  3. * @brief Defines a text 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_TEXT_H
  21. #define ORG_TEXT_H
  22. #include "doc_elt.h"
  23. #include "doc_stream.h"
  24. #include "doc_ref.h"
  25. struct org_text;
  26. typedef struct org_text org_text;
  27. /* Constructor, destructor */
  28. org_text *org_text_create_empty (doc_elt_ops *ops);
  29. void org_text_free (org_text * self);
  30. void org_text_initversion (org_text *text, doc_src src);
  31. bool org_text_containsversion (org_text *text, doc_src src);
  32. /* doc_elt_ops implementation */
  33. typedef struct doc_elt_ops doc_elt_ops;
  34. extern doc_elt_ops org_text_ops;
  35. void org_text_set_text (org_text *text, char *string, size_t length, doc_src src);
  36. char *org_text_get_text (org_text *text, doc_src src);
  37. size_t org_text_get_length (org_text *text, doc_src src);
  38. #endif