Libical API Documentation 4.0
Loading...
Searching...
No Matches
vcomponent_cxx.h
Go to the documentation of this file.
1
11
12#ifndef ICAL_VCOMPONENT_CXX_H
13#define ICAL_VCOMPONENT_CXX_H
14
15#include "libical_ical_export.h"
16#include "icptrholder_cxx.h"
17
18extern "C" {
19#include "icalerror.h"
20#include "icalcomponent.h"
21}
22
23#include <string>
24
25namespace LibICal
26{
27
28class ICalProperty;
29
37
38class LIBICAL_ICAL_EXPORT VComponent
39{
40public:
41 VComponent();
42 VComponent(const VComponent &);
43 VComponent &operator=(const VComponent &);
44 virtual ~VComponent();
45
46 explicit VComponent(icalcomponent *v);
47 explicit VComponent(const std::string &str);
48 explicit VComponent(const icalcomponent_kind &kind);
49
50 operator icalcomponent *()
51 {
52 return imp;
53 }
54
55 void new_from_string(const std::string &str);
56
57 // detach imp to this object. use with caution. it would cause
58 // memory leak if you are not careful.
59 void detach();
60
61public:
62 std::string as_ical_string();
63 bool is_valid();
64 icalcomponent_kind isa();
65 int isa_component(void *component);
66
68 void add_property(ICalProperty *property);
69 void remove_property(ICalProperty *property);
70 int count_properties(const icalproperty_kind &kind);
71
72 // Iterate through the properties
73 ICalProperty *get_current_property();
74 ICalProperty *get_first_property(const icalproperty_kind &kind);
75 ICalProperty *get_next_property(const icalproperty_kind &kind);
76
77 // Working with components
78
83
84 VComponent *get_inner();
85
86 void add_component(VComponent *child);
87 void remove_component(VComponent *child);
88 int count_components(const icalcomponent_kind &kind);
89
97
99 VComponent *get_current_component();
100 VComponent *get_first_component(const icalcomponent_kind &kind);
101 VComponent *get_next_component(const icalcomponent_kind &kind);
102
104 icalcompiter begin_component(const icalcomponent_kind &kind);
105 icalcompiter end_component(const icalcomponent_kind &kind);
106 VComponent *next(icalcompiter *i);
107 VComponent *prev(icalcompiter *i);
108 VComponent *current(icalcompiter *i);
109
112
115
118
120 static icalcomponent_kind string_to_kind(const std::string &str);
121 static std::string kind_to_string(const icalcomponent_kind &kind);
122
123public:
124 struct icaltimetype get_dtstart() const;
125 void set_dtstart(const struct icaltimetype &v);
126
137
138 struct icaltimetype get_dtend() const;
139 void set_dtend(const struct icaltimetype &v);
140
141 struct icaltimetype get_due() const;
142 void set_due(const struct icaltimetype &v);
143
144 struct icaldurationtype get_duration() const;
145 void set_duration(const struct icaldurationtype &v);
146
147 icalproperty_method get_method() const;
148 void set_method(const icalproperty_method &method);
149
150 struct icaltimetype get_dtstamp() const;
151 void set_dtstamp(const struct icaltimetype &v);
152
153 std::string get_summary() const;
154 void set_summary(const std::string &v);
155
156 std::string get_location() const;
157 void set_location(const std::string &v);
158
159 std::string get_description() const;
160 void set_description(const std::string &v);
161
162 std::string get_comment() const;
163 void set_comment(const std::string &v);
164
165 std::string get_uid() const;
166 void set_uid(const std::string &v);
167
168 std::string get_relcalid() const;
169 void set_relcalid(const std::string &v);
170
171 struct icaltimetype get_recurrenceid() const;
172 void set_recurrenceid(const struct icaltimetype &v);
173
174 int get_sequence() const;
175 void set_sequence(const int &v);
176
177 int get_status() const;
178 void set_status(const enum icalproperty_status &v);
179
180public:
186
191 virtual struct icaltime_span get_span();
192
193 int recurrence_is_excluded(struct icaltimetype *dtstart, struct icaltimetype *recurtime);
194
195public:
196 /* helper functions for adding/removing/updating property and sub-components */
197
199
200 bool remove(VComponent &, bool ignoreValue);
201 bool update(VComponent &, bool removeMissing);
202 bool add(VComponent &);
203
204private:
205 /* Internal operations. They are private, and you should not be using them. */
206 VComponent *get_parent();
207 void set_parent(VComponent *parent);
208
209 char *quote_ical_string(char *str);
210
211private:
212 icalcomponent *imp;
213};
214
215class LIBICAL_ICAL_EXPORT VCalendar : public VComponent
216{
217public:
218 VCalendar();
219 VCalendar(const VCalendar &);
220 VCalendar &operator=(const VCalendar &);
221 ~VCalendar();
222
223 explicit VCalendar(icalcomponent *v);
224 explicit VCalendar(const std::string &str);
225};
226
227class LIBICAL_ICAL_EXPORT VEvent : public VComponent
228{
229public:
230 VEvent();
231 VEvent(const VEvent &);
232 VEvent &operator=(const VEvent &);
233 ~VEvent();
234
235 explicit VEvent(icalcomponent *v);
236 explicit VEvent(const std::string &str);
237};
238
239class LIBICAL_ICAL_EXPORT VToDo : public VComponent
240{
241public:
242 VToDo();
243 VToDo(const VToDo &);
244 VToDo &operator=(const VToDo &);
245 ~VToDo();
246
247 explicit VToDo(icalcomponent *v);
248 explicit VToDo(const std::string &str);
249};
250
251class LIBICAL_ICAL_EXPORT VAgenda : public VComponent
252{
253public:
254 VAgenda();
255 VAgenda(const VAgenda &);
256 VAgenda &operator=(const VAgenda &);
257 ~VAgenda();
258
259 explicit VAgenda(icalcomponent *v);
260 explicit VAgenda(const std::string &str);
261};
262
263class LIBICAL_ICAL_EXPORT VQuery : public VComponent
264{
265public:
266 VQuery();
267 VQuery(const VQuery &);
268 VQuery &operator=(const VQuery &);
269 ~VQuery();
270
271 explicit VQuery(icalcomponent *v);
272 explicit VQuery(const std::string &str);
273};
274
275class LIBICAL_ICAL_EXPORT VJournal : public VComponent
276{
277public:
278 VJournal();
279 VJournal(const VJournal &);
280 VJournal &operator=(const VJournal &);
281 ~VJournal();
282
283 explicit VJournal(icalcomponent *v);
284 explicit VJournal(const std::string &str);
285};
286
287class LIBICAL_ICAL_EXPORT VAlarm : public VComponent
288{
289public:
290 VAlarm();
291 VAlarm(const VAlarm &);
292 VAlarm &operator=(const VAlarm &);
293 ~VAlarm();
294
295 explicit VAlarm(icalcomponent *v);
296 explicit VAlarm(const std::string &str);
297
303 icalrequeststatus getTriggerTime(VComponent &c, struct icaltriggertype *tr);
304};
305
306class LIBICAL_ICAL_EXPORT VFreeBusy : public VComponent
307{
308public:
309 VFreeBusy();
310 VFreeBusy(const VFreeBusy &);
311 VFreeBusy &operator=(const VFreeBusy &);
312 ~VFreeBusy();
313
314 explicit VFreeBusy(icalcomponent *v);
315 explicit VFreeBusy(const std::string &str);
316};
317
318class LIBICAL_ICAL_EXPORT VTimezone : public VComponent
319{
320public:
321 VTimezone();
322 VTimezone(const VTimezone &);
323 VTimezone &operator=(const VTimezone &);
324 ~VTimezone();
325
326 explicit VTimezone(icalcomponent *v);
327 explicit VTimezone(const std::string &str);
328};
329
330class LIBICAL_ICAL_EXPORT XStandard : public VComponent
331{
332public:
333 XStandard();
334 XStandard(const XStandard &);
335 XStandard &operator=(const XStandard &);
336 ~XStandard();
337
338 explicit XStandard(icalcomponent *v);
339 explicit XStandard(const std::string &str);
340};
341
342class LIBICAL_ICAL_EXPORT XDaylight : public VComponent
343{
344public:
345 XDaylight();
346 XDaylight(const XDaylight &);
347 XDaylight &operator=(const XDaylight &);
348 ~XDaylight();
349
350 explicit XDaylight(icalcomponent *v);
351 explicit XDaylight(const std::string &str);
352};
353
354} // namespace LibICal;
355
356typedef ICPointerHolder<LibICal::VComponent> VComponentTmpPtr;
357
358#endif /* ICAL_VCOMPONENT_H */
Definition icptrholder_cxx.h:41
Definition icalproperty_cxx.h:32
icalrequeststatus getTriggerTime(VComponent &c, struct icaltriggertype *tr)
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.
virtual struct icaltime_span get_span()
void add_property(ICalProperty *property)
Working with properties.
void strip_errors()
Remove all X-LIC-ERROR properties.
struct icaltimetype get_dtend() const
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()
Error handling for libical.
C++ template classes for managing C++ pointers returned by VComponent::get_..._component,...
Definition icalcomponent.h:28
A struct representing a duration.
Definition icalduration.h:29
Definition icaltime.h:89
Definition icaltime.h:98
Definition icaltypes.h:32