1 /* -*- Mode: C++ -*- */
4 * @file icalproperty_cxx.h
5 * @author fnguyen (12/10/01)
6 * @brief Definition of C++ Wrapper for icalproperty.c
8 * (C) COPYRIGHT 2001, Critical Path
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of either:
13 The LGPL as published by the Free Software Foundation, version
14 2.1, available at: http://www.fsf.org/copyleft/lesser.html
18 The Mozilla Public License Version 1.0. You may obtain a copy of
19 the License at http://www.mozilla.org/MPL/
22 #ifndef ICALPROPERTY_CXX_H
23 #define ICALPROPERTY_CXX_H
26 #include "icptrholder.h"
28 typedef char* string; // Will use the string library from STL
36 ICalProperty(const ICalProperty&) throw(icalerrorenum);
37 ICalProperty& operator=(const ICalProperty&) throw(icalerrorenum);
40 ICalProperty(icalproperty* v);
41 ICalProperty(string str);
42 ICalProperty(icalproperty_kind kind);
43 ICalProperty(icalproperty_kind kind, string str);
45 operator icalproperty*() {return imp;}
46 int operator==(ICalProperty& rhs);
53 string as_ical_string();
54 icalproperty_kind isa();
55 int isa_property(void* property);
57 void add_parameter(ICalParameter& parameter);
58 void set_parameter(ICalParameter& parameter);
59 void set_parameter_from_string(string name, string val);
60 string get_parameter_as_string(string name);
61 void remove_parameter(icalparameter_kind kind);
62 int count_parameters();
64 /** Iterate through the parameters */
65 ICalParameter* get_first_parameter(icalparameter_kind kind);
66 ICalParameter* get_next_parameter(icalparameter_kind kind);
68 /** Access the value of the property */
69 void set_value(const ICalValue& val);
70 void set_value_from_string(string val, string kind);
72 ICalValue* get_value();
73 string get_value_as_string();
75 /** Return the name of the property -- the type name converted
76 * to a string, or the value of get_x_name if the type is X
82 /* Deal with X properties */
83 static void set_x_name(ICalProperty &prop, string name);
84 static string get_x_name(ICalProperty &prop);
86 static icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value val);
88 /* Convert kinds to string and get default value type */
89 static icalvalue_kind kind_to_value_kind(icalproperty_kind kind);
90 static icalproperty_kind value_kind_to_kind(icalvalue_kind kind);
91 static string kind_to_string(icalproperty_kind kind);
92 static icalproperty_kind string_to_kind(string str);
94 static icalproperty_method string_to_method(string str);
95 static string method_to_string(icalproperty_method method);
97 static string enum_to_string(int e);
98 static int string_to_enum(string str);
100 static string status_to_string(icalproperty_status);
101 static icalproperty_status string_to_status(string str);
103 static int enum_belongs_to_property(icalproperty_kind kind, int e);
107 void set_action(enum icalproperty_action v);
108 enum icalproperty_action get_action();
111 void set_attach(icalattach *v);
112 icalattach *get_attach();
115 void set_attendee(string val);
116 string get_attendee();
119 void set_calscale(string val);
120 string get_calscale();
123 void set_categories(string val);
124 string get_categories();
127 void set_class(enum icalproperty_class val);
128 enum icalproperty_class get_class();
131 void set_comment(string val);
132 string get_comment();
135 void set_completed(struct icaltimetype val);
136 struct icaltimetype get_completed();
139 void set_contact(string val);
140 string get_contact();
143 void set_created(struct icaltimetype val);
144 struct icaltimetype get_created();
147 void set_description(string val);
148 string get_description();
151 void set_dtend(struct icaltimetype val);
152 struct icaltimetype get_dtend();
155 void set_dtstamp(struct icaltimetype val);
156 struct icaltimetype get_dtstamp();
159 void set_dtstart(struct icaltimetype val);
160 struct icaltimetype get_dtstart();
163 void set_due(struct icaltimetype val);
164 struct icaltimetype get_due();
167 void set_duration(struct icaldurationtype val);
168 struct icaldurationtype get_duration();
171 void set_exdate(struct icaltimetype val);
172 struct icaltimetype get_exdate();
175 void set_expand(int val);
179 void set_exrule(struct icalrecurrencetype val);
180 struct icalrecurrencetype get_exrule();
183 void set_freebusy(struct icalperiodtype val);
184 struct icalperiodtype get_freebusy();
187 void set_geo(struct icalgeotype val);
188 struct icalgeotype get_geo();
191 void set_grant(string val);
195 void set_lastmodified(struct icaltimetype val);
196 struct icaltimetype get_lastmodified();
199 void set_location(string val);
200 string get_location();
203 void set_maxresults(int val);
204 int get_maxresults();
207 void set_maxresultsize(int val);
208 int get_maxresultsize();
211 void set_method(enum icalproperty_method val);
212 enum icalproperty_method get_method();
215 void set_owner(string val);
219 void set_organizer(string val);
220 string get_organizer();
222 /* PERCENT-COMPLETE */
223 void set_percentcomplete(int val);
224 int get_percentcomplete();
227 void set_priority(int val);
231 void set_prodid(string val);
235 void set_query(string val);
239 void set_queryname(string val);
240 string get_queryname();
243 void set_rdate(struct icaldatetimeperiodtype val);
244 struct icaldatetimeperiodtype get_rdate();
247 void set_recurrenceid(struct icaltimetype val);
248 struct icaltimetype get_recurrenceid();
251 void set_relatedto(string val);
252 string get_relatedto();
255 void set_relcalid(string val);
256 string get_relcalid();
259 void set_repeat(int val);
263 void set_requeststatus(string val);
264 string get_requeststatus();
267 void set_resources(string val);
268 string get_resources();
271 void set_rrule(struct icalrecurrencetype val);
272 struct icalrecurrencetype get_rrule();
275 void set_scope(string val);
279 void set_sequence(int val);
283 void set_status(enum icalproperty_status val);
284 enum icalproperty_status get_status();
287 void set_summary(string val);
288 string get_summary();
291 void set_target(string val);
295 void set_transp(enum icalproperty_transp val);
296 enum icalproperty_transp get_transp();
299 void set_trigger(struct icaltriggertype val);
300 struct icaltriggertype get_trigger();
303 void set_tzid(string val);
307 void set_tzname(string val);
311 void set_tzoffsetfrom(int val);
312 int get_tzoffsetfrom();
315 void set_tzoffsetto(int val);
316 int get_tzoffsetto();
319 void set_tzurl(string val);
323 void set_uid(string val);
327 void set_url(string val);
331 void set_version(string val);
332 string get_version();
335 void set_x(string val);
338 /* X-LIC-CLUSTERCOUNT */
339 void set_xlicclustercount(string val);
340 string get_xlicclustercount();
343 void set_xlicerror(string val);
344 string get_xlicerror();
346 /* X-LIC-MIMECHARSET */
347 void set_xlicmimecharset(string val);
348 string get_xlicmimecharset();
351 void set_xlicmimecid(string val);
352 string get_xlicmimecid();
354 /* X-LIC-MIMECONTENTTYPE */
355 void set_xlicmimecontenttype(string val);
356 string get_xlicmimecontenttype();
358 /* X-LIC-MIMEENCODING */
359 void set_xlicmimeencoding(string val);
360 string get_xlicmimeencoding();
362 /* X-LIC-MIMEFILENAME */
363 void set_xlicmimefilename(string val);
364 string get_xlicmimefilename();
366 /* X-LIC-MIMEOPTINFO */
367 void set_xlicmimeoptinfo(string val);
368 string get_xlicmimeoptinfo();
371 icalproperty* imp; /**< The actual C based icalproperty */
374 typedef ICPointerHolder<ICalProperty> ICalPropertyTmpPtr; /* see icptrholder.h for comments */
376 #endif /* ICalProperty_H */