Libical API Documentation  2.99
icalcomponent.h
1 /*======================================================================
2  FILE: icalcomponent.h
3  CREATOR: eric 20 March 1999
4 
5  (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
6  http://www.softwarestudio.org
7 
8  This library is free software; you can redistribute it and/or modify
9  it under the terms of either:
10 
11  The LGPL as published by the Free Software Foundation, version
12  2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
13 
14  Or:
15 
16  The Mozilla Public License Version 2.0. You may obtain a copy of
17  the License at http://www.mozilla.org/MPL/
18 ======================================================================*/
19 
20 #ifndef ICALCOMPONENT_H
21 #define ICALCOMPONENT_H
22 
23 #include "libical_ical_export.h"
24 #include "icalenums.h" /* defines icalcomponent_kind */
25 #include "icalproperty.h"
26 #include "pvl.h"
27 
28 typedef struct icalcomponent_impl icalcomponent;
29 
30 /* This is exposed so that callers will not have to allocate and
31  deallocate iterators. Pretend that you can't see it. */
32 typedef struct icalcompiter
33 {
34  icalcomponent_kind kind;
35  pvl_elem iter;
36 
37 } icalcompiter;
38 
39 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new(icalcomponent_kind kind);
40 
41 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_clone(icalcomponent *component);
42 
43 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_from_string(const char *str);
44 
45 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_vanew(icalcomponent_kind kind, ...);
46 
47 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_x(const char *x_name);
48 
49 LIBICAL_ICAL_EXPORT void icalcomponent_free(icalcomponent *component);
50 
51 LIBICAL_ICAL_EXPORT char *icalcomponent_as_ical_string(icalcomponent *component);
52 
53 LIBICAL_ICAL_EXPORT char *icalcomponent_as_ical_string_r(icalcomponent *component);
54 
55 LIBICAL_ICAL_EXPORT int icalcomponent_is_valid(icalcomponent *component);
56 
57 LIBICAL_ICAL_EXPORT icalcomponent_kind icalcomponent_isa(const icalcomponent *component);
58 
59 LIBICAL_ICAL_EXPORT int icalcomponent_isa_component(void *component);
60 
61 /*
62  * Working with properties
63  */
64 
65 LIBICAL_ICAL_EXPORT void icalcomponent_add_property(icalcomponent *component,
66  icalproperty *property);
67 
68 LIBICAL_ICAL_EXPORT void icalcomponent_remove_property(icalcomponent *component,
69  icalproperty *property);
70 
71 LIBICAL_ICAL_EXPORT int icalcomponent_count_properties(icalcomponent *component,
72  icalproperty_kind kind);
73 
74 LIBICAL_ICAL_EXPORT void icalproperty_set_parent(icalproperty *property,
75  icalcomponent *component);
76 
77 LIBICAL_ICAL_EXPORT icalcomponent *icalproperty_get_parent(const icalproperty *property);
78 
79 /* Iterate through the properties */
80 LIBICAL_ICAL_EXPORT icalproperty *icalcomponent_get_current_property(icalcomponent *component);
81 
82 LIBICAL_ICAL_EXPORT icalproperty *icalcomponent_get_first_property(icalcomponent *component,
83  icalproperty_kind kind);
84 LIBICAL_ICAL_EXPORT icalproperty *icalcomponent_get_next_property(icalcomponent *component,
85  icalproperty_kind kind);
86 
87 /*
88  * Working with components
89  */
90 
91 /* Return the first VEVENT, VTODO or VJOURNAL sub-component of cop, or
92  comp if it is one of those types */
93 
94 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_inner(icalcomponent *comp);
95 
96 LIBICAL_ICAL_EXPORT void icalcomponent_add_component(icalcomponent *parent, icalcomponent *child);
97 
98 LIBICAL_ICAL_EXPORT void icalcomponent_remove_component(icalcomponent *parent,
99  icalcomponent *child);
100 
101 LIBICAL_ICAL_EXPORT int icalcomponent_count_components(icalcomponent *component,
102  icalcomponent_kind kind);
103 
108 LIBICAL_ICAL_EXPORT void icalcomponent_merge_component(icalcomponent *comp,
109  icalcomponent *comp_to_merge);
110 
111 /* Iteration Routines. There are two forms of iterators, internal and
112 external. The internal ones came first, and are almost completely
113 sufficient, but they fail badly when you want to construct a loop that
114 removes components from the container.*/
115 
116 /* Iterate through components */
117 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_current_component(icalcomponent *component);
118 
119 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_first_component(icalcomponent *component,
120  icalcomponent_kind kind);
121 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_next_component(icalcomponent *component,
122  icalcomponent_kind kind);
123 
124 /* Using external iterators */
125 LIBICAL_ICAL_EXPORT icalcompiter icalcomponent_begin_component(icalcomponent *component,
126  icalcomponent_kind kind);
127 
128 LIBICAL_ICAL_EXPORT icalcompiter icalcomponent_end_component(icalcomponent *component,
129  icalcomponent_kind kind);
130 
131 LIBICAL_ICAL_EXPORT icalcomponent *icalcompiter_next(icalcompiter * i);
132 
133 LIBICAL_ICAL_EXPORT icalcomponent *icalcompiter_prior(icalcompiter * i);
134 
135 LIBICAL_ICAL_EXPORT icalcomponent *icalcompiter_deref(icalcompiter * i);
136 
137 /* Working with embedded error properties */
138 
139 /* Check the component against itip rules and insert error properties*/
140 /* Working with embedded error properties */
141 LIBICAL_ICAL_EXPORT int icalcomponent_check_restrictions(icalcomponent *comp);
142 
144 LIBICAL_ICAL_EXPORT int icalcomponent_count_errors(icalcomponent *component);
145 
147 LIBICAL_ICAL_EXPORT void icalcomponent_strip_errors(icalcomponent *component);
148 
150 LIBICAL_ICAL_EXPORT void icalcomponent_convert_errors(icalcomponent *component);
151 
152 /* Internal operations. They are private, and you should not be using them. */
153 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_parent(icalcomponent *component);
154 
155 LIBICAL_ICAL_EXPORT void icalcomponent_set_parent(icalcomponent *component,
156  icalcomponent *parent);
157 
158 /* Kind conversion routines */
159 
160 LIBICAL_ICAL_EXPORT int icalcomponent_kind_is_valid(const icalcomponent_kind kind);
161 
162 LIBICAL_ICAL_EXPORT icalcomponent_kind icalcomponent_string_to_kind(const char *string);
163 
164 LIBICAL_ICAL_EXPORT const char *icalcomponent_kind_to_string(icalcomponent_kind kind);
165 
166 /************* Derived class methods. ****************************
167 
168 If the code was in an OO language, the remaining routines would be
169 members of classes derived from icalcomponent. Don't call them on the
170 wrong component subtypes. */
171 
174 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_first_real_component(icalcomponent *c);
175 
178 LIBICAL_ICAL_EXPORT struct icaltime_span icalcomponent_get_span(icalcomponent *comp);
179 
180 /******************** Convenience routines **********************/
181 
182 LIBICAL_ICAL_EXPORT void icalcomponent_set_dtstart(icalcomponent *comp, struct icaltimetype v);
183 LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtstart(icalcomponent *comp);
184 
185 /* For the icalcomponent routines only, dtend and duration are tied
186  together. If you call the set routine for one and the other exists,
187  the routine will calculate the change to the other. That is, if
188  there is a DTEND and you call set_duration, the routine will modify
189  DTEND to be the sum of DTSTART and the duration. If you call a get
190  routine for one and the other exists, the routine will calculate
191  the return value. If you call a set routine and neither exists, the
192  routine will create the apcompriate comperty */
193 
194 LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtend(icalcomponent *comp);
195 
196 LIBICAL_ICAL_EXPORT void icalcomponent_set_dtend(icalcomponent *comp, struct icaltimetype v);
197 
198 LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_due(icalcomponent *comp);
199 
200 LIBICAL_ICAL_EXPORT void icalcomponent_set_due(icalcomponent *comp, struct icaltimetype v);
201 
202 LIBICAL_ICAL_EXPORT void icalcomponent_set_duration(icalcomponent *comp,
203  struct icaldurationtype v);
204 
205 LIBICAL_ICAL_EXPORT struct icaldurationtype icalcomponent_get_duration(icalcomponent *comp);
206 
207 LIBICAL_ICAL_EXPORT void icalcomponent_set_method(icalcomponent *comp, icalproperty_method method);
208 
209 LIBICAL_ICAL_EXPORT icalproperty_method icalcomponent_get_method(icalcomponent *comp);
210 
211 LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtstamp(icalcomponent *comp);
212 
213 LIBICAL_ICAL_EXPORT void icalcomponent_set_dtstamp(icalcomponent *comp, struct icaltimetype v);
214 
215 LIBICAL_ICAL_EXPORT void icalcomponent_set_summary(icalcomponent *comp, const char *v);
216 
217 LIBICAL_ICAL_EXPORT const char *icalcomponent_get_summary(icalcomponent *comp);
218 
219 LIBICAL_ICAL_EXPORT void icalcomponent_set_comment(icalcomponent *comp, const char *v);
220 
221 LIBICAL_ICAL_EXPORT const char *icalcomponent_get_comment(icalcomponent *comp);
222 
223 LIBICAL_ICAL_EXPORT void icalcomponent_set_uid(icalcomponent *comp, const char *v);
224 
225 LIBICAL_ICAL_EXPORT const char *icalcomponent_get_uid(icalcomponent *comp);
226 
227 LIBICAL_ICAL_EXPORT void icalcomponent_set_relcalid(icalcomponent *comp, const char *v);
228 
229 LIBICAL_ICAL_EXPORT const char *icalcomponent_get_relcalid(icalcomponent *comp);
230 
231 LIBICAL_ICAL_EXPORT void icalcomponent_set_recurrenceid(icalcomponent *comp,
232  struct icaltimetype v);
233 
234 LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_recurrenceid(icalcomponent *comp);
235 
236 LIBICAL_ICAL_EXPORT void icalcomponent_set_description(icalcomponent *comp, const char *v);
237 
238 LIBICAL_ICAL_EXPORT const char *icalcomponent_get_description(icalcomponent *comp);
239 
240 LIBICAL_ICAL_EXPORT void icalcomponent_set_location(icalcomponent *comp, const char *v);
241 
242 LIBICAL_ICAL_EXPORT const char *icalcomponent_get_location(icalcomponent *comp);
243 
244 LIBICAL_ICAL_EXPORT void icalcomponent_set_sequence(icalcomponent *comp, int v);
245 
246 LIBICAL_ICAL_EXPORT int icalcomponent_get_sequence(icalcomponent *comp);
247 
248 LIBICAL_ICAL_EXPORT void icalcomponent_set_status(icalcomponent *comp, enum icalproperty_status v);
249 
250 LIBICAL_ICAL_EXPORT enum icalproperty_status icalcomponent_get_status(icalcomponent *comp);
251 
254 LIBICAL_ICAL_EXPORT void icalcomponent_foreach_tzid(icalcomponent *comp,
255  void (*callback) (icalparameter *param,
256  void *data),
257  void *callback_data);
258 
261 LIBICAL_ICAL_EXPORT icaltimezone *icalcomponent_get_timezone(icalcomponent *comp,
262  const char *tzid);
263 
264 LIBICAL_ICAL_EXPORT int icalproperty_recurrence_is_excluded(icalcomponent *comp,
265  struct icaltimetype *dtstart,
266  struct icaltimetype *recurtime);
267 
268 LIBICAL_ICAL_EXPORT void icalcomponent_foreach_recurrence(icalcomponent *comp,
269  struct icaltimetype start,
270  struct icaltimetype end,
271  void (*callback) (icalcomponent *comp,
272  struct icaltime_span *
273  span, void *data),
274  void *callback_data);
275 
276 /*************** Type Specific routines ***************/
277 
278 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vcalendar(void);
279 
280 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vevent(void);
281 
282 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vtodo(void);
283 
284 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vjournal(void);
285 
286 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_valarm(void);
287 
288 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vfreebusy(void);
289 
290 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vtimezone(void);
291 
292 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_xstandard(void);
293 
294 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_xdaylight(void);
295 
296 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vagenda(void);
297 
298 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vquery(void);
299 
300 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vavailability(void);
301 
302 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_xavailable(void);
303 
304 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vpoll(void);
305 
306 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vvoter(void);
307 
308 LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_xvote(void);
309 
310 #endif /* !ICALCOMPONENT_H */
Definition: icaltime.h:96
A struct representing a duration.
Definition: icalduration.h:37
Definition: icalcomponent.c:33
Definition: icalcomponent.h:32
Definition: pvl.h:34
Definition: icaltime.h:105
Definition: icaltimezoneimpl.h:23