icalvalue_cxx.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*======================================================================
  2. FILE: icalvalue_cxx.h
  3. CREATOR: fnguyen 12/13/01
  4. (C) COPYRIGHT 2001, Critical Path
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of either:
  7. The LGPL as published by the Free Software Foundation, version
  8. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  9. Or:
  10. The Mozilla Public License Version 1.0. You may obtain a copy of
  11. the License at http://www.mozilla.org/MPL/
  12. ======================================================================*/
  13. #ifndef ICALVALUE_CXX_H
  14. #define ICALVALUE_CXX_H
  15. #include "libical_ical_export.h"
  16. #include "icptrholder_cxx.h"
  17. extern "C"
  18. {
  19. #include "icalerror.h"
  20. #include "icalvalue.h"
  21. };
  22. #include <string>
  23. namespace LibICal
  24. {
  25. class LIBICAL_ICAL_EXPORT ICalValue
  26. {
  27. public:
  28. ICalValue() throw(icalerrorenum);
  29. ICalValue(const ICalValue &) throw(icalerrorenum);
  30. ICalValue & operator=(const ICalValue &) throw(icalerrorenum);
  31. ~ICalValue();
  32. explicit ICalValue(icalvalue *) throw(icalerrorenum);
  33. explicit ICalValue(const icalvalue_kind & kind) throw(icalerrorenum);
  34. ICalValue(const icalvalue_kind & kind, const std::string & str) throw(icalerrorenum);
  35. operator icalvalue *()
  36. {
  37. return imp;
  38. }
  39. void detach();
  40. public:
  41. std::string as_ical_string();
  42. bool is_valid();
  43. icalvalue_kind isa();
  44. int isa_value(void *);
  45. /* Special, non autogenerated value accessors */
  46. void set_recur(const struct icalrecurrencetype &v);
  47. struct icalrecurrencetype get_recur();
  48. void set_trigger(const struct icaltriggertype &v);
  49. struct icaltriggertype get_trigger();
  50. void set_datetimeperiod(const struct icaldatetimeperiodtype &v);
  51. struct icaldatetimeperiodtype get_datetimeperiod();
  52. public:
  53. static icalparameter_xliccomparetype compare(ICalValue & a, ICalValue & b);
  54. /* Convert enumerations */
  55. static icalvalue_kind string_to_kind(const std::string & str);
  56. std::string kind_to_string(const icalvalue_kind & kind);
  57. public:
  58. /* BOOLEAN */
  59. int get_boolean() const;
  60. void set_boolean(const int &v);
  61. /* UTC-OFFSET */
  62. int get_utcoffset() const;
  63. void set_utcoffset(const int &v);
  64. /* METHOD */
  65. enum icalproperty_method get_method() const;
  66. void set_method(const enum icalproperty_method &v);
  67. /* CAL-ADDRESS */
  68. std::string get_caladdress() const;
  69. void set_caladdress(const std::string & v);
  70. /* PERIOD */
  71. struct icalperiodtype get_period() const;
  72. void set_period(const struct icalperiodtype &v);
  73. /* STATUS */
  74. enum icalproperty_status get_status() const;
  75. void set_status(const enum icalproperty_status &v);
  76. /* BINARY */
  77. std::string get_binary() const;
  78. void set_binary(const std::string & v);
  79. /* TEXT */
  80. std::string get_text() const;
  81. void set_text(const std::string & v);
  82. /* DURATION */
  83. struct icaldurationtype get_duration() const;
  84. void set_duration(const struct icaldurationtype &v);
  85. /* INTEGER */
  86. int get_integer() const;
  87. void set_integer(const int &v);
  88. /* URI */
  89. std::string get_uri() const;
  90. void set_uri(const std::string & v);
  91. /* ATTACH */
  92. icalattach *get_attach();
  93. void set_attach(icalattach *v);
  94. /* CLASS */
  95. enum icalproperty_class get_class() const;
  96. void set_class(const enum icalproperty_class &v);
  97. /* FLOAT */
  98. float get_float() const;
  99. void set_float(const float &v);
  100. /* QUERY */
  101. std::string get_query() const;
  102. void set_query(const std::string & v);
  103. /* STRING */
  104. std::string get_string() const;
  105. void set_string(const std::string & v);
  106. /* TRANSP */
  107. enum icalproperty_transp get_transp() const;
  108. void set_transp(const enum icalproperty_transp &v);
  109. /* DATE-TIME */
  110. struct icaltimetype get_datetime() const;
  111. void set_datetime(const struct icaltimetype &v);
  112. /* GEO */
  113. struct icalgeotype get_geo() const;
  114. void set_geo(const struct icalgeotype &v);
  115. /* DATE */
  116. struct icaltimetype get_date() const;
  117. void set_date(const struct icaltimetype &v);
  118. /* ACTION */
  119. enum icalproperty_action get_action() const;
  120. void set_action(const enum icalproperty_action &v);
  121. private:
  122. icalvalue *imp;
  123. };
  124. } // namespace LibICal
  125. typedef ICPointerHolder < LibICal::ICalValue > ICalValueTmpPtr;
  126. #endif