2 /*======================================================================
4 CREATOR: fnguyen 12/13/01
5 (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:
10 The LGPL as published by the Free Software Foundation, version
11 2.1, available at: http://www.fsf.org/copyleft/lesser.html
15 The Mozilla Public License Version 1.0. You may obtain a copy of
16 the License at http://www.mozilla.org/MPL/
17 ======================================================================*/
19 #ifndef CP_ICALVALUE_H
20 #define CP_ICALVALUE_H
26 #include "icptrholder.h"
28 typedef char* string; // Will use the string library from STL
32 ICalValue() throw(icalerrorenum);
33 ICalValue(const ICalValue&) throw(icalerrorenum);
34 ICalValue& operator=(const ICalValue&) throw(icalerrorenum);
37 ICalValue(icalvalue*) throw(icalerrorenum);
38 ICalValue(icalvalue_kind kind) throw(icalerrorenum);
39 ICalValue(icalvalue_kind kind, string str) throw(icalerrorenum);
41 operator icalvalue* () { return imp; }
48 string as_ical_string();
53 /* Special, non autogenerated value accessors */
54 void set_recur(struct icalrecurrencetype v);
55 struct icalrecurrencetype get_recur();
57 void set_trigger(struct icaltriggertype v);
58 struct icaltriggertype get_trigger();
60 void set_datetimeperiod(struct icaldatetimeperiodtype v);
61 struct icaldatetimeperiodtype get_datetimeperiod();
64 static icalparameter_xliccomparetype compare(ICalValue& a, ICalValue& b);
66 /* Convert enumerations */
67 static icalvalue_kind string_to_kind(string str);
68 string kind_to_string(icalvalue_kind kind);
73 void set_boolean(int v);
77 void set_utcoffset(int v);
80 enum icalproperty_method get_method();
81 void set_method(enum icalproperty_method v);
84 string get_caladdress();
85 void set_caladdress(string v);
88 struct icalperiodtype get_period();
89 void set_period(struct icalperiodtype v);
92 enum icalproperty_status get_status();
93 void set_status(enum icalproperty_status v);
97 void set_binary(string v);
101 void set_text(string v);
104 struct icaldurationtype get_duration();
105 void set_duration(struct icaldurationtype v);
109 void set_integer(int v);
113 void set_uri(string v);
116 icalattach *get_attach();
117 void set_attach(icalattach *v);
120 enum icalproperty_class get_class();
121 void set_class(enum icalproperty_class v);
125 void set_float(float v);
129 void set_query(string v);
133 void set_string(string v);
136 enum icalproperty_transp get_transp();
137 void set_transp(enum icalproperty_transp v);
140 struct icaltimetype get_datetime();
141 void set_datetime(struct icaltimetype v);
144 struct icalgeotype get_geo();
145 void set_geo(struct icalgeotype v);
148 struct icaltimetype get_date();
149 void set_date(struct icaltimetype v);
152 enum icalproperty_action get_action();
153 void set_action(enum icalproperty_action v);
160 typedef ICPointerHolder<ICalValue> ICalValueTmpPtr; /* see icptrholder.h for comments */
162 #endif /*ICALVALUE_H*/