icalparameter_cxx.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /**
  2. * @file icalparameter_cxx.h
  3. * @author fnguyen (12/10/01)
  4. * @brief Definition of C++ Wrapper for icalparameter.c
  5. *
  6. * (C) COPYRIGHT 2001, Critical Path
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of either:
  9. The LGPL as published by the Free Software Foundation, version
  10. 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
  11. Or:
  12. The Mozilla Public License Version 1.0. You may obtain a copy of
  13. the License at http://www.mozilla.org/MPL/
  14. */
  15. #ifndef ICALPARAMETER_CXX_H
  16. #define ICALPARAMETER_CXX_H
  17. #include "libical_ical_export.h"
  18. #include "icptrholder_cxx.h"
  19. extern "C"
  20. {
  21. #include "icalerror.h"
  22. #include "icalparameter.h"
  23. };
  24. #include <string>
  25. namespace LibICal
  26. {
  27. class LIBICAL_ICAL_EXPORT ICalParameter
  28. {
  29. public:
  30. ICalParameter() throw(icalerrorenum);
  31. ICalParameter(const ICalParameter &) throw(icalerrorenum);
  32. ICalParameter & operator=(const ICalParameter &) throw(icalerrorenum);
  33. ~ICalParameter();
  34. explicit ICalParameter(icalparameter *v) throw(icalerrorenum);
  35. // Create from string of form "PARAMNAME=VALUE"
  36. explicit ICalParameter(const std::string & str) throw(icalerrorenum);
  37. // Create from just the value, the part after the "="
  38. explicit ICalParameter(const icalparameter_kind & kind) throw(icalerrorenum);
  39. ICalParameter(const icalparameter_kind & kind,
  40. const std::string & str) throw(icalerrorenum);
  41. operator icalparameter *()
  42. {
  43. return imp;
  44. }
  45. void detach();
  46. public:
  47. std::string as_ical_string() throw(icalerrorenum);
  48. bool is_valid();
  49. icalparameter_kind isa();
  50. int isa_parameter(void *param);
  51. public:
  52. /* Access the name of an X parameter */
  53. static void set_xname(ICalParameter & param, const std::string & v);
  54. static std::string get_xname(ICalParameter & param);
  55. static void set_xvalue(ICalParameter & param, const std::string & v);
  56. static std::string get_xvalue(ICalParameter & param);
  57. /* Convert enumerations */
  58. static std::string kind_to_string(const icalparameter_kind & kind);
  59. static icalparameter_kind string_to_kind(const std::string & str);
  60. public:
  61. /* DELEGATED-FROM */
  62. std::string get_delegatedfrom() const;
  63. void set_delegatedfrom(const std::string & v);
  64. /* RELATED */
  65. icalparameter_related get_related() const;
  66. void set_related(const icalparameter_related & v);
  67. /* SENT-BY */
  68. std::string get_sentby() const;
  69. void set_sentby(const std::string & v);
  70. /* LANGUAGE */
  71. std::string get_language() const;
  72. void set_language(const std::string & v);
  73. /* RELTYPE */
  74. icalparameter_reltype get_reltype() const;
  75. void set_reltype(const icalparameter_reltype & v);
  76. /* ENCODING */
  77. icalparameter_encoding get_encoding() const;
  78. void set_encoding(const icalparameter_encoding & v);
  79. /* ALTREP */
  80. std::string get_altrep() const;
  81. void set_altrep(const std::string & v);
  82. /* FMTTYPE */
  83. std::string get_fmttype() const;
  84. void set_fmttype(const std::string & v);
  85. /* FBTYPE */
  86. icalparameter_fbtype get_fbtype() const;
  87. void set_fbtype(const icalparameter_fbtype & v);
  88. /* RSVP */
  89. icalparameter_rsvp get_rsvp() const;
  90. void set_rsvp(const icalparameter_rsvp & v);
  91. /* RANGE */
  92. icalparameter_range get_range() const;
  93. void set_range(const icalparameter_range & v);
  94. /* DELEGATED-TO */
  95. std::string get_delegatedto() const;
  96. void set_delegatedto(const std::string & v);
  97. /* CN */
  98. std::string get_cn() const;
  99. void set_cn(const std::string & v);
  100. /* ROLE */
  101. icalparameter_role get_role() const;
  102. void set_role(const icalparameter_role & v);
  103. /* X-LIC-COMPARETYPE */
  104. icalparameter_xliccomparetype get_xliccomparetype() const;
  105. void set_xliccomparetype(const icalparameter_xliccomparetype & v);
  106. /* PARTSTAT */
  107. icalparameter_partstat get_partstat() const;
  108. void set_partstat(const icalparameter_partstat & v);
  109. /* X-LIC-ERRORTYPE */
  110. icalparameter_xlicerrortype get_xlicerrortype() const;
  111. void set_xlicerrortype(const icalparameter_xlicerrortype & v);
  112. /* MEMBER */
  113. std::string get_member() const;
  114. void set_member(const std::string & v);
  115. /* X */
  116. std::string get_x() const;
  117. void set_x(const std::string & v);
  118. /* CUTYPE */
  119. icalparameter_cutype get_cutype() const;
  120. void set_cutype(const icalparameter_cutype & v);
  121. /* TZID */
  122. std::string get_tzid() const;
  123. void set_tzid(const std::string & v);
  124. /* VALUE */
  125. icalparameter_value get_value() const;
  126. void set_value(const icalparameter_value & v);
  127. /* DIR */
  128. std::string get_dir() const;
  129. void set_dir(const std::string & v);
  130. private:
  131. icalparameter *imp;
  132. };
  133. } // namespace LibICal
  134. #endif