Libical API Documentation 3.0
Loading...
Searching...
No Matches
vcomponent_cxx.h
Go to the documentation of this file.
1
20#ifndef ICAL_VCOMPONENT_CXX_H
21#define ICAL_VCOMPONENT_CXX_H
22
23#include "libical_ical_export.h"
24#include "icptrholder_cxx.h"
25
26extern "C"
27{
28#include "icalerror.h"
29#include "icalcomponent.h"
30}
31
32#include <string>
33
34namespace LibICal
35{
36
37class ICalProperty;
38
47class LIBICAL_ICAL_EXPORT VComponent
48{
49public:
50 VComponent();
51 VComponent(const VComponent &);
52 VComponent &operator=(const VComponent &);
53 virtual ~VComponent();
54
55 explicit VComponent(icalcomponent *v);
56 explicit VComponent(const std::string &str);
57 explicit VComponent(const icalcomponent_kind &kind);
58
59 operator icalcomponent *()
60 {
61 return imp;
62 }
63
64 void new_from_string(const std::string &str);
65
66 // detach imp to this object. use with caution. it would cause
67 // memory leak if you are not careful.
68 void detach();
69
70public:
71 std::string as_ical_string();
72 bool is_valid();
73 icalcomponent_kind isa();
74 int isa_component(void *component);
75
77 void add_property(ICalProperty *property);
78 void remove_property(ICalProperty *property);
79 int count_properties(const icalproperty_kind &kind);
80
81 // Iterate through the properties
82 ICalProperty *get_current_property();
83 ICalProperty *get_first_property(const icalproperty_kind &kind);
84 ICalProperty *get_next_property(const icalproperty_kind &kind);
85
86 // Working with components
87
94
95 void add_component(VComponent *child);
96 void remove_component(VComponent *child);
97 int count_components(const icalcomponent_kind &kind);
98
109 VComponent *get_first_component(const icalcomponent_kind &kind);
110 VComponent *get_next_component(const icalcomponent_kind &kind);
111
113 icalcompiter begin_component(const icalcomponent_kind &kind);
114 icalcompiter end_component(const icalcomponent_kind &kind);
115 VComponent *next(icalcompiter *i);
116 VComponent *prev(icalcompiter *i);
117 VComponent *current(icalcompiter *i);
118
121
124
127
129 static icalcomponent_kind string_to_kind(const std::string &str);
130 static std::string kind_to_string(const icalcomponent_kind &kind);
131
132public:
133 struct icaltimetype get_dtstart() const;
134 void set_dtstart(const struct icaltimetype &v);
135
147 struct icaltimetype get_dtend() const;
148 void set_dtend(const struct icaltimetype &v);
149
150 struct icaltimetype get_due() const;
151 void set_due(const struct icaltimetype &v);
152
153 struct icaldurationtype get_duration() const;
154 void set_duration(const struct icaldurationtype &v);
155
156 icalproperty_method get_method() const;
157 void set_method(const icalproperty_method &method);
158
159 struct icaltimetype get_dtstamp() const;
160 void set_dtstamp(const struct icaltimetype &v);
161
162 std::string get_summary() const;
163 void set_summary(const std::string &v);
164
165 std::string get_location() const;
166 void set_location(const std::string &v);
167
168 std::string get_description() const;
169 void set_description(const std::string &v);
170
171 std::string get_comment() const;
172 void set_comment(const std::string &v);
173
174 std::string get_uid() const;
175 void set_uid(const std::string &v);
176
177 std::string get_relcalid() const;
178 void set_relcalid(const std::string &v);
179
180 struct icaltimetype get_recurrenceid() const;
181 void set_recurrenceid(const struct icaltimetype &v);
182
183 int get_sequence() const;
184 void set_sequence(const int &v);
185
186 int get_status() const;
187 void set_status(const enum icalproperty_status &v);
188
189public:
195
200 virtual struct icaltime_span get_span();
201
202 int recurrence_is_excluded(struct icaltimetype *dtstart, struct icaltimetype *recurtime);
203
204public:
205 /* helper functions for adding/removing/updating property and sub-components */
206
208
209 bool remove(VComponent &, bool ignoreValue);
210 bool update(VComponent &, bool removeMissing);
211 bool add(VComponent &);
212
213private:
214 /* Internal operations. They are private, and you should not be using them. */
215 VComponent *get_parent();
216 void set_parent(VComponent *parent);
217
218 char *quote_ical_string(char *str);
219
220private:
221 icalcomponent *imp;
222};
223
224class LIBICAL_ICAL_EXPORT VCalendar: public VComponent
225{
226public:
227 VCalendar();
228 VCalendar(const VCalendar &);
229 VCalendar &operator=(const VCalendar &);
230 ~VCalendar();
231
232 explicit VCalendar(icalcomponent *v);
233 explicit VCalendar(const std::string &str);
234};
235
236class LIBICAL_ICAL_EXPORT VEvent: public VComponent
237{
238public:
239 VEvent();
240 VEvent(const VEvent &);
241 VEvent &operator=(const VEvent &);
242 ~VEvent();
243
244 explicit VEvent(icalcomponent *v);
245 explicit VEvent(const std::string &str);
246};
247
248class LIBICAL_ICAL_EXPORT VToDo: public VComponent
249{
250public:
251 VToDo();
252 VToDo(const VToDo &);
253 VToDo &operator=(const VToDo &);
254 ~VToDo();
255
256 explicit VToDo(icalcomponent *v);
257 explicit VToDo(const std::string &str);
258};
259
260class LIBICAL_ICAL_EXPORT VAgenda: public VComponent
261{
262public:
263 VAgenda();
264 VAgenda(const VAgenda &);
265 VAgenda &operator=(const VAgenda &);
266 ~VAgenda();
267
268 explicit VAgenda(icalcomponent *v);
269 explicit VAgenda(const std::string &str);
270};
271
272class LIBICAL_ICAL_EXPORT VQuery: public VComponent
273{
274public:
275 VQuery();
276 VQuery(const VQuery &);
277 VQuery &operator=(const VQuery &);
278 ~VQuery();
279
280 explicit VQuery(icalcomponent *v);
281 explicit VQuery(const std::string &str);
282};
283
284class LIBICAL_ICAL_EXPORT VJournal: public VComponent
285{
286public:
287 VJournal();
288 VJournal(const VJournal &);
289 VJournal &operator=(const VJournal &);
290 ~VJournal();
291
292 explicit VJournal(icalcomponent *v);
293 explicit VJournal(const std::string &str);
294};
295
296class LIBICAL_ICAL_EXPORT VAlarm: public VComponent
297{
298public:
299 VAlarm();
300 VAlarm(const VAlarm &);
301 VAlarm &operator=(const VAlarm &);
302 ~VAlarm();
303
304 explicit VAlarm(icalcomponent *v);
305 explicit VAlarm(const std::string &str);
306
312 icalrequeststatus getTriggerTime(VComponent &c, struct icaltriggertype *tr);
313};
314
315class LIBICAL_ICAL_EXPORT VFreeBusy: public VComponent
316{
317public:
318 VFreeBusy();
319 VFreeBusy(const VFreeBusy &);
320 VFreeBusy &operator=(const VFreeBusy &);
321 ~VFreeBusy();
322
323 explicit VFreeBusy(icalcomponent *v);
324 explicit VFreeBusy(const std::string &str);
325};
326
327class LIBICAL_ICAL_EXPORT VTimezone: public VComponent
328{
329public:
330 VTimezone();
331 VTimezone(const VTimezone &);
332 VTimezone &operator=(const VTimezone &);
333 ~VTimezone();
334
335 explicit VTimezone(icalcomponent *v);
336 explicit VTimezone(const std::string &str);
337};
338
339class LIBICAL_ICAL_EXPORT XStandard: public VComponent
340{
341public:
342 XStandard();
343 XStandard(const XStandard &);
344 XStandard &operator=(const XStandard &);
345 ~XStandard();
346
347 explicit XStandard(icalcomponent *v);
348 explicit XStandard(const std::string &str);
349};
350
351class LIBICAL_ICAL_EXPORT XDaylight: public VComponent
352{
353public:
354 XDaylight();
355 XDaylight(const XDaylight &);
356 XDaylight &operator=(const XDaylight &);
357 ~XDaylight();
358
359 explicit XDaylight(icalcomponent *v);
360 explicit XDaylight(const std::string &str);
361};
362
363} // namespace LibICal;
364
365typedef ICPointerHolder < LibICal::VComponent > VComponentTmpPtr;
366
367#endif /* ICAL_VCOMPONENT_H */
Definition icptrholder_cxx.h:48
Definition icalproperty_cxx.h:41
Definition vcomponent_cxx.h:261
Definition vcomponent_cxx.h:297
icalrequeststatus getTriggerTime(VComponent &c, struct icaltriggertype *tr)
Definition vcomponent_cxx.h:225
A class wrapping the libical icalcomponent functions.
Definition vcomponent_cxx.h:48
void convert_errors()
Convert some X-LIC-ERROR properties into RETURN-STATUS properties.
VComponent * get_current_component()
Iterate through components.
VComponent * get_inner()
int count_errors()
Working with embedded error properties.
static icalcomponent_kind string_to_kind(const std::string &str)
Kind conversion routines.
void add_property(ICalProperty *property)
Working with properties.
void strip_errors()
Remove all X-LIC-ERROR properties.
bool remove(VComponent &, bool ignoreValue)
Note: the VComponent kind have to be the same.
icalcompiter begin_component(const icalcomponent_kind &kind)
Using external iterators.
VComponent * get_first_real_component()
Definition vcomponent_cxx.h:237
Definition vcomponent_cxx.h:316
Definition vcomponent_cxx.h:285
Definition vcomponent_cxx.h:273
Definition vcomponent_cxx.h:328
Definition vcomponent_cxx.h:249
Definition vcomponent_cxx.h:352
Definition vcomponent_cxx.h:340
Error handling for libical.
C++ template classes for managing C++ pointers returned by VComponent::get_..._component,...
Definition icalcomponent.h:36
Definition icalcomponent.c:36
A struct representing a duration.
Definition icalduration.h:37
Definition icaltime.h:96
Definition icaltime.h:105
Definition icaltypes.h:40