Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
icalproperty_cxx.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2001, Critical Path
3 * SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
4 */
5
11
12#ifndef ICALPROPERTY_CXX_H
13#define ICALPROPERTY_CXX_H
14
15#include "libical_ical_export.h"
16#include "icptrholder_cxx.hpp"
17
18extern "C" {
19#include "icalproperty.h"
20}
21
22#include <string>
23
24namespace LibICal
25{
26
27class ICalParameter;
28class ICalValue;
29
30class LIBICAL_ICAL_EXPORT ICalProperty
31{
32public:
33 ICalProperty();
34 ICalProperty(const ICalProperty &);
35 ICalProperty &operator=(const ICalProperty &);
36 ~ICalProperty();
37
38 explicit ICalProperty(icalproperty *v);
39 explicit ICalProperty(const std::string &str);
40 explicit ICalProperty(icalproperty_kind kind);
41
42 operator icalproperty *()
43 {
44 return imp;
45 }
46 int operator==(ICalProperty &rhs);
47
48 void detach();
49
50 std::string as_ical_string();
51 icalproperty_kind isa();
52 bool isa_property(void *property);
53
54 void add_parameter(ICalParameter &parameter);
55 void set_parameter(ICalParameter &parameter);
56 void set_parameter_from_string(const std::string &name, const std::string &val);
57 std::string get_parameter_as_string(const std::string &name);
58 void remove_parameter_by_kind(const icalparameter_kind &kind);
59 int count_parameters();
60
62 ICalParameter *get_first_parameter(const icalparameter_kind &kind);
63 ICalParameter *get_next_parameter(const icalparameter_kind &kind);
64
66 void set_value(const ICalValue &val);
67 void set_value_from_string(const std::string &val, const std::string &kind);
68
69 ICalValue *get_value();
70 std::string get_value_as_string();
71
78 std::string get_name() const;
79
80 /* Deal with X properties */
81 static void set_x_name(ICalProperty &prop, const std::string &name);
82 static std::string get_x_name(ICalProperty &prop);
83
84 static icalvalue_kind value_to_value_kind(const icalparameter_value &val);
85
86 /* Convert kinds to string and get default value type */
87 static icalvalue_kind kind_to_value_kind(const icalproperty_kind &kind);
88 static icalproperty_kind value_kind_to_kind(const icalvalue_kind &kind);
89 static std::string kind_to_string(const icalproperty_kind &kind);
90 static icalproperty_kind string_to_kind(const std::string &str);
91
92 static icalproperty_method string_to_method(const std::string &str);
93 static std::string method_to_string(const icalproperty_method &method);
94
95 static std::string enum_to_string(const int &e);
96 static int kind_and_string_to_enum(const icalproperty_kind &kind, const std::string &str);
97
98 static std::string status_to_string(const icalproperty_status &status);
99 static icalproperty_status string_to_status(const std::string &str);
100
101 static bool enum_belongs_to_property(const icalproperty_kind &kind, const int &e);
102
103 /* ACTION */
104 void set_action(const enum icalproperty_action &val);
105 enum icalproperty_action get_action();
106
107 /* ATTACH */
108 void set_attach(icalattach *val);
109 icalattach *get_attach() const;
110
111 /* ATTENDEE */
112 void set_attendee(const std::string &val);
113 std::string get_attendee() const;
114
115 /* CALSCALE */
116 void set_calscale(const std::string &val);
117 std::string get_calscale() const;
118
119 /* CATEGORIES */
120 void set_categories(const std::string &val);
121 std::string get_categories() const;
122
123 /* CLASS */
124 void set_class(const enum icalproperty_class &val);
125 enum icalproperty_class get_class() const;
126
127 /* COMMENT */
128 void set_comment(const std::string &val);
129 std::string get_comment() const;
130
131 /* COMPLETED */
132 void set_completed(const struct icaltimetype &val);
133 struct icaltimetype get_completed() const;
134
135 /* CONTACT */
136 void set_contact(const std::string &val);
137 std::string get_contact() const;
138
139 /* CREATED */
140 void set_created(const struct icaltimetype &val);
141 struct icaltimetype get_created() const;
142
143 /* DESCRIPTION */
144 void set_description(const std::string &val);
145 std::string get_description() const;
146
147 /* DTEND */
148 void set_dtend(const struct icaltimetype &val);
149 struct icaltimetype get_dtend() const;
150
151 /* DTSTAMP */
152 void set_dtstamp(const struct icaltimetype &val);
153 struct icaltimetype get_dtstamp() const;
154
155 /* DTSTART */
156 void set_dtstart(const struct icaltimetype &val);
157 struct icaltimetype get_dtstart() const;
158
159 /* DUE */
160 void set_due(const struct icaltimetype &val);
161 struct icaltimetype get_due() const;
162
163 /* DURATION */
164 void set_duration(const struct icaldurationtype &val);
165 struct icaldurationtype get_duration() const;
166
167 /* EXDATE */
168 void set_exdate(const struct icaltimetype &val);
169 struct icaltimetype get_exdate() const;
170
171 /* EXPAND */
172 void set_expand(const int &val);
173 int get_expand() const;
174
175 /* EXRULE */
176 void set_exrule(struct icalrecurrencetype *val);
177 struct icalrecurrencetype *get_exrule() const;
178
179 /* FREEBUSY */
180 void set_freebusy(const struct icalperiodtype &val);
181 struct icalperiodtype get_freebusy() const;
182
183 /* GEO */
184 void set_geo(const struct icalgeotype &val);
185 struct icalgeotype get_geo() const;
186
187 /* GRANT */
188 void set_grant(const std::string &val);
189 std::string get_grant() const;
190
191 /* LAST-MODIFIED */
192 void set_lastmodified(const struct icaltimetype &val);
193 struct icaltimetype get_lastmodified() const;
194
195 /* LOCATION */
196 void set_location(const std::string &val);
197 std::string get_location() const;
198
199 /* MAXRESULTS */
200 void set_maxresults(const int &val);
201 int get_maxresults() const;
202
203 /* MAXRESULTSSIZE */
204 void set_maxresultsize(const int &val);
205 int get_maxresultsize() const;
206
207 /* METHOD */
208 void set_method(const enum icalproperty_method &val);
209 enum icalproperty_method get_method() const;
210
211 /* OWNER */
212 void set_owner(const std::string &val);
213 std::string get_owner() const;
214
215 /* ORGANIZER */
216 void set_organizer(const std::string &val);
217 std::string get_organizer() const;
218
219 /* PERCENT-COMPLETE */
220 void set_percentcomplete(const int &val);
221 int get_percentcomplete() const;
222
223 /* PRIORITY */
224 void set_priority(const int &val);
225 int get_priority() const;
226
227 /* PRODID */
228 void set_prodid(const std::string &val);
229 std::string get_prodid() const;
230
231 /* QUERY */
232 void set_query(const std::string &val);
233 std::string get_query() const;
234
235 /* QUERYNAME */
236 void set_queryname(const std::string &val);
237 std::string get_queryname() const;
238
239 /* RDATE */
240 void set_rdate(const struct icaldatetimeperiodtype &val);
241 struct icaldatetimeperiodtype get_rdate() const;
242
243 /* RECURRENCE-ID */
244 void set_recurrenceid(const struct icaltimetype &val);
245 struct icaltimetype get_recurrenceid() const;
246
247 /* RELATED-TO */
248 void set_relatedto(const std::string &val);
249 std::string get_relatedto() const;
250
251 /* RELCALID */
252 void set_relcalid(const std::string &val);
253 std::string get_relcalid() const;
254
255 /* REPEAT */
256 void set_repeat(const int &val);
257 int get_repeat() const;
258
259 /* REQUEST-STATUS */
260 void set_requeststatus(const std::string &val);
261 std::string get_requeststatus() const;
262
263 /* RESOURCES */
264 void set_resources(const std::string &val);
265 std::string get_resources() const;
266
267 /* RRULE */
268 void set_rrule(struct icalrecurrencetype *val);
269 struct icalrecurrencetype *get_rrule() const;
270
271 /* SCOPE */
272 void set_scope(const std::string &val);
273 std::string get_scope() const;
274
275 /* SEQUENCE */
276 void set_sequence(const int &val);
277 int get_sequence() const;
278
279 /* STATUS */
280 void set_status(const enum icalproperty_status &val);
281 enum icalproperty_status get_status() const;
282
283 /* SUMMARY */
284 void set_summary(const std::string &val);
285 std::string get_summary() const;
286
287 /* TARGET */
288 void set_target(const std::string &val);
289 std::string get_target() const;
290
291 /* TRANSP */
292 void set_transp(const enum icalproperty_transp &val);
293 enum icalproperty_transp get_transp() const;
294
295 /* TRIGGER */
296 void set_trigger(const struct icaltriggertype &val);
297 struct icaltriggertype get_trigger() const;
298
299 /* TZID */
300 void set_tzid(const std::string &val);
301 std::string get_tzid() const;
302
303 /* TZNAME */
304 void set_tzname(const std::string &val);
305 std::string get_tzname() const;
306
307 /* TZOFFSETFROM */
308 void set_tzoffsetfrom(const int &val);
309 int get_tzoffsetfrom() const;
310
311 /* TZOFFSETTO */
312 void set_tzoffsetto(const int &val);
313 int get_tzoffsetto() const;
314
315 /* TZURL */
316 void set_tzurl(const std::string &val);
317 std::string get_tzurl() const;
318
319 /* UID */
320 void set_uid(const std::string &val);
321 std::string get_uid() const;
322
323 /* URL */
324 void set_url(const std::string &val);
325 std::string get_url() const;
326
327 /* VERSION */
328 void set_version(const std::string &val);
329 std::string get_version() const;
330
331 /* X */
332 void set_x(const std::string &val);
333 std::string get_x() const;
334
335 /* X-LIC-CLUSTERCOUNT */
336 void set_xlicclustercount(const std::string &val);
337 std::string get_xlicclustercount() const;
338
339 /* X-LIC-ERROR */
340 void set_xlicerror(const std::string &val);
341 std::string get_xlicerror() const;
342
343 /* X-LIC-MIMECHARSET */
344 void set_xlicmimecharset(const std::string &val);
345 std::string get_xlicmimecharset() const;
346
347 /* X-LIC-MIMECID */
348 void set_xlicmimecid(const std::string &val);
349 std::string get_xlicmimecid() const;
350
351 /* X-LIC-MIMECONTENTTYPE */
352 void set_xlicmimecontenttype(const std::string &val);
353 std::string get_xlicmimecontenttype() const;
354
355 /* X-LIC-MIMEENCODING */
356 void set_xlicmimeencoding(const std::string &val);
357 std::string get_xlicmimeencoding() const;
358
359 /* X-LIC-MIMEFILENAME */
360 void set_xlicmimefilename(const std::string &val);
361 std::string get_xlicmimefilename() const;
362
363 /* X-LIC-MIMEOPTINFO */
364 void set_xlicmimeoptinfo(const std::string &val);
365 std::string get_xlicmimeoptinfo() const;
366
367private:
368 icalproperty *imp;
370};
371
372} // namespace LibICal
373
374typedef ICPointerHolder<LibICal::ICalProperty> ICalPropertyTmpPtr;
375
376#endif /* ICalProperty_H */
ICalParameter * get_first_parameter(const icalparameter_kind &kind)
std::string get_name() const
void set_value(const ICalValue &val)
struct icalattach_impl icalattach
An iCal attach object representing a link to a document object.
Definition icalattach.h:36
Defines the data structure representing iCalendar properties.
C++ template classes for managing C++ pointers returned by VComponent::get_..._component,...