Libical API Documentation 4.0 STABLE VERSION [Visit the v3.0 documentation]
Loading...
Searching...
No Matches
vcomponent_cxx.cpp
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#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include "vcomponent_cxx.hpp"
17#include "icalparameter_cxx.hpp"
18#include "icalproperty_cxx.hpp"
19#include "icalvalue_cxx.hpp"
20using namespace LibICal;
21
22extern "C" {
23#include "icalerror_p.h"
24#include "icalmemory.h"
25}
26
27#include <cstdlib>
28#include <string>
29
34
36 : imp(icalcomponent_clone(v.imp))
37{
38 if (imp == NULL) {
39 throw icalerrno;
40 }
41}
42
44{
45 if (this == &v) {
46 return *this;
47 }
48
50 imp = NULL;
51
52 imp = icalcomponent_clone(v.imp);
53 if (imp == NULL) {
54 throw icalerrno;
55 }
56
57 return *this;
58}
59
61{
62 imp = NULL;
63}
64
69
70VComponent::VComponent(icalcomponent *v)
71 : imp(v)
72{
73}
74
75/* char* returned is in the ring buffer. caller doesn't have to free it */
76
86VComponent::VComponent(const std::string &str)
88{
89 if (imp == NULL) {
90 if (!icalerrno) {
92 }
93 throw icalerrno;
94 }
95}
96
99{
100 if (imp == NULL) {
101 throw icalerrno;
102 }
103}
104
106{
107 const char *str = icalcomponent_as_ical_string(imp);
108
109 if (str == NULL) {
110 throw icalerrno;
111 }
112
113 return (str);
114}
115
117{
118 if (imp == NULL) {
119 return false;
120 }
121 return icalcomponent_is_valid(imp);
122}
123
128
129/* cppcheck-suppress functionStatic */
130bool VComponent::isa_component(const void *component) //NOLINT(readability-convert-member-functions-to-static)
131{
132 return icalcomponent_isa_component(component);
133}
134
135void VComponent::new_from_string(const std::string &str)
136{
138 imp = icalcomponent_new_from_string(str.c_str());
139}
140
141/* Working with properties */
143{
144 icalcomponent_add_property(imp, *property);
145}
146
148{
149 icalcomponent_remove_property(imp, *property);
150 icalproperty_free(*property);
151 property->detach(); // set imp to null, it's free already.
152}
153
158
159/* Iterate through the properties */
161{
162 icalproperty *t = icalcomponent_get_current_property(imp);
163 return ((t != NULL) ? new ICalProperty(t) : NULL);
164}
165
167{
168 icalproperty *t = icalcomponent_get_first_property(imp, kind);
169 return ((t != NULL) ? new ICalProperty(t) : NULL);
170}
171
173{
174 icalproperty *t = icalcomponent_get_next_property(imp, kind);
175 return ((t != NULL) ? new ICalProperty(t) : NULL);
176}
177
178/* Working with components */
179/* Returns the first VEVENT, VTODO or VJOURNAL sub-component if it is one of those types */
184
186{
187 icalcomponent_add_component(imp, *child);
188}
189
194
199
200/* Iteration Routines. There are two forms of iterators, internal and
201 external. The internal ones came first, and are almost completely
202 sufficient, but they fail badly when you want to construct a loop that
203 removes components from the container.
204*/
205
206/* Iterate through components */
208{
209 icalcomponent *t = icalcomponent_get_current_component(imp);
210 return ((t != NULL) ? new VComponent(t) : NULL);
211}
212
214{
215 VComponent *result = NULL; // NOLINT(misc-const-correctness)
216 icalcomponent *t = icalcomponent_get_first_component(imp, kind);
217 if (t != NULL) {
218 switch (kind) {
220 result = new VAlarm(t);
221 break;
223 result = new VCalendar(t);
224 break;
226 result = new VEvent(t);
227 break;
229 result = new VQuery(t);
230 break;
232 result = new VToDo(t);
233 break;
235 result = new VAgenda(t);
236 break;
237 default:
238 result = new VComponent(t);
239 }
240 }
241
242 return (result);
243}
244
246{
247 VComponent *result = NULL; // NOLINT(misc-const-correctness)
248 icalcomponent *t = icalcomponent_get_next_component(imp, kind);
249 if (t != NULL) {
250 switch (kind) {
252 result = new VAlarm(t);
253 break;
255 result = new VCalendar(t);
256 break;
258 result = new VEvent(t);
259 break;
261 result = new VQuery(t);
262 break;
264 result = new VToDo(t);
265 break;
267 result = new VAgenda(t);
268 break;
269 default:
270 result = new VComponent(t);
271 }
272 }
273
274 return (result);
275}
276
277/* Using external iterators */
282
287
289{
290 return reinterpret_cast<VComponent *>(icalcompiter_next(i));
291}
292
294{
295 return reinterpret_cast<VComponent *>(icalcompiter_prior(i));
296}
297
299{
300 return reinterpret_cast<VComponent *>(icalcompiter_deref(i));
301}
302
303/* Working with embedded error properties */
308
309/* Remove all X-LIC-ERROR properties*/
314
315/* Convert some X-LIC-ERROR properties into RETURN-STATUS properties*/
320
321/* Kind conversion routines */
323{
324 return icalcomponent_string_to_kind(str.c_str());
325}
326
328{
329 return static_cast<std::string>(icalcomponent_kind_to_string(kind));
330}
331
333{
334 return icalcomponent_get_dtstart(imp);
335}
336
338{
340}
341
342/* For the icalcomponent routines only, dtend and duration are tied
343 together. If you call the set routine for one and the other exists,
344 the routine will calculate the change to the other. That is, if
345 there is a DTEND and you call set_duration, the routine will modify
346 DTEND to be the sum of DTSTART and the duration. If you call a get
347 routine for one and the other exists, the routine will calculate
348 the return value. If you call a set routine and neither exists, the
349 routine will create the apcompriate comperty.
350*/
351
353{
354 return icalcomponent_get_dtend(imp);
355}
356
358{
360}
361
363{
364 return icalcomponent_get_due(imp);
365}
366
368{
369 icalcomponent_set_due(imp, v);
370}
371
373{
374 return icalcomponent_get_duration(imp);
375}
376
378{
380}
381
386
388{
389 icalcomponent_set_method(imp, method);
390}
391
393{
394 return icalcomponent_get_dtstamp(imp);
395}
396
398{
400}
401
402std::string VComponent::get_summary() const
403{
404 return static_cast<std::string>(icalcomponent_get_summary(imp));
405}
406
407void VComponent::set_summary(const std::string &v)
408{
409 icalcomponent_set_summary(imp, v.c_str());
410}
411
412std::string VComponent::get_location() const
413{
414 return static_cast<std::string>(icalcomponent_get_location(imp));
415}
416
417void VComponent::set_location(const std::string &v)
418{
419 icalcomponent_set_location(imp, v.c_str());
420}
421
423{
424 return static_cast<std::string>(icalcomponent_get_description(imp));
425}
426
427void VComponent::set_description(const std::string &v)
428{
429 icalcomponent_set_description(imp, v.c_str());
430}
431
432std::string VComponent::get_comment() const
433{
434 return static_cast<std::string>(icalcomponent_get_comment(imp));
435}
436
437void VComponent::set_comment(const std::string &v)
438{
439 icalcomponent_set_comment(imp, v.c_str());
440}
441
442std::string VComponent::get_uid() const
443{
444 return static_cast<std::string>(icalcomponent_get_uid(imp));
445}
446
447void VComponent::set_uid(const std::string &v)
448{
449 icalcomponent_set_uid(imp, v.c_str());
450}
451
452std::string VComponent::get_relcalid() const
453{
454 return static_cast<std::string>(icalcomponent_get_relcalid(imp));
455}
456
457void VComponent::set_relcalid(const std::string &v)
458{
459 icalcomponent_set_relcalid(imp, v.c_str());
460}
461
466
471
473{
474 return icalcomponent_get_sequence(imp);
475}
476
477void VComponent::set_sequence(const int &v)
478{
480}
481
483{
484 return icalcomponent_get_status(imp);
485}
486
488{
490}
491
492/* For VCOMPONENT: Return a reference to the first VEVENT, VTODO, or VJOURNAL */
497
498/* For VEVENT, VTODO, VJOURNAL and VTIMEZONE: report the start and end
499 times of an event in UTC */
500struct icaltime_span VComponent::get_span()
501{
502 return icalcomponent_get_span(imp);
503}
504
506 struct icaltimetype *recurtime)
507{
508 return icalproperty_recurrence_is_excluded(imp, dtstart, recurtime);
509}
510
511/* ignoreValue means remove properties even if the data doesn't match */
512bool VComponent::remove(VComponent &fromVC, bool ignoreValue)
513{
514 /* the two components must be the same kind */
515 if (this->isa() != fromVC.isa()) {
516 return false;
517 }
518
519 /* properties first */
520 ICalPropertyTmpPtr propToBeRemoved;
521 for (propToBeRemoved = fromVC.get_first_property(ICAL_ANY_PROPERTY);
522 propToBeRemoved != NULL;
523 propToBeRemoved = fromVC.get_next_property(ICAL_ANY_PROPERTY)) {
524 /* loop through properties from this component */
525 ICalPropertyTmpPtr next_prop;
527 for (p = this->get_first_property(propToBeRemoved->isa()); p != NULL; p = next_prop) {
528 next_prop = this->get_next_property(propToBeRemoved->isa());
529 if (ignoreValue) {
530 this->remove_property(p);
531 } else {
532 if (p == propToBeRemoved) {
533 this->remove_property(p);
534 break;
535 }
536 }
537 }
538 }
539
540 /* components next - should remove by UID */
541 VComponentTmpPtr comp;
542 for (comp = fromVC.get_first_component(ICAL_ANY_COMPONENT); comp != NULL;
543 comp = fromVC.get_next_component(ICAL_ANY_COMPONENT)) {
544 const std::string fromCompUid = comp->get_uid();
546 for (c = this->get_first_component(comp->isa()); c != NULL;
547 c = this->get_next_component(comp->isa())) {
548 if (strcmp(fromCompUid.c_str(), c->get_uid().c_str()) == 0) {
549 // recursively go down the components
550 c->remove(*comp, ignoreValue);
551 // if all properties are removed and there is no sub-components, then
552 // remove this component
553 if ((c->count_properties(ICAL_ANY_PROPERTY) == 0) &&
555 this->remove_component(c);
556 }
557 break;
558 }
559 }
560 }
561
562 return true;
563}
564
565/* removeMissing == true: remove properties that are missing from fromC */
566/* todo: only change the first occurrence of the property */
567/* todo: removeMissing is not implemented */
568bool VComponent::update(VComponent &fromC, bool removeMissing)
569{
570 /* make sure they are the same kind */
571 if (this->isa() != fromC.isa()) {
572 return false;
573 }
574
575 /* property first */
577 for (prop = fromC.get_first_property(ICAL_ANY_PROPERTY); prop != NULL;
578 prop = fromC.get_next_property(ICAL_ANY_PROPERTY)) {
579 ICalPropertyTmpPtr thisProp;
580 thisProp = this->get_first_property(prop->isa());
581 if (thisProp == NULL) {
582 thisProp = new ICalProperty(prop->isa());
583 this->add_property(thisProp);
584 }
585 const ICalValue *tempValue = prop->get_value();
586 const ICalValue *value = new ICalValue(*tempValue); // clone the value
587 thisProp->set_value(*value);
588 delete tempValue;
589 delete value;
590 }
591
592 /* recursively updating sub-components */
593 VComponentTmpPtr comp;
594 for (comp = fromC.get_first_component(ICAL_ANY_COMPONENT); comp != NULL;
596 VComponentTmpPtr thisComp;
597 thisComp = this->get_first_component(comp->isa());
598 if (thisComp == NULL) {
599 thisComp = new VComponent(comp->isa());
600 this->add_component(thisComp);
601 }
602 const bool err = thisComp->update(*comp, removeMissing);
603 if (!err) {
604 return false;
605 }
606 }
607 return true;
608}
609
610/* add components and property. recursively goes down child components */
612{
613 /* make sure the kind are the same */
614 if (this->isa() != fromC.isa()) {
615 return false;
616 }
617
618 /* properties first */
620 for (prop = fromC.get_first_property(ICAL_ANY_PROPERTY); prop != NULL;
621 prop = fromC.get_next_property(ICAL_ANY_PROPERTY)) {
622 /* clone another property */
623 ICalProperty *p = new ICalProperty(*prop);
624 add_property(p);
625 delete p;
626 }
627
628 /* sub-components next */
629 VComponentTmpPtr comp;
630 for (comp = fromC.get_first_component(ICAL_ANY_COMPONENT); comp != NULL;
632 VComponent *c = new VComponent(comp->isa());
633 add_component(c);
634 delete c;
635 }
636
637 return true;
638}
639
644
646 : VComponent(v)
647{
648}
649
651{
652 if (this == &v) {
653 return *this;
654 }
656
657 return *this;
658}
659
663
664VCalendar::VCalendar(icalcomponent *v)
665 : VComponent(v)
666{
667}
668
669VCalendar::VCalendar(const std::string &str)
670 : VComponent(str)
671{
672}
673
674/* VEvent */
675
680
682 : VComponent(v)
683{
684}
685
687{
688 if (this == &v) {
689 return *this;
690 }
692
693 return *this;
694}
695
697{
698}
699
700VEvent::VEvent(icalcomponent *v)
701 : VComponent(v)
702{
703}
704
705VEvent::VEvent(const std::string &str)
706 : VComponent(str)
707{
708}
709
710/* VTodo */
711
716
718 : VComponent(v)
719{
720}
721
723{
724 if (this == &v) {
725 return *this;
726 }
728
729 return *this;
730}
731
733{
734}
735
736VToDo::VToDo(icalcomponent *v)
737 : VComponent(v)
738{
739}
740
741VToDo::VToDo(const std::string &str)
742 : VComponent(str)
743{
744}
745
746/* VAgenda */
747
752
754 : VComponent(v)
755{
756}
757
759{
760 if (this == &v) {
761 return *this;
762 }
764
765 return *this;
766}
767
771
772VAgenda::VAgenda(icalcomponent *v)
773 : VComponent(v)
774{
775}
776
777VAgenda::VAgenda(const std::string &str)
778 : VComponent(str)
779{
780}
781
782/* VQuery */
783
788
790 : VComponent(v)
791{
792}
793
795{
796 if (this == &v) {
797 return *this;
798 }
800
801 return *this;
802}
803
805{
806}
807
808VQuery::VQuery(icalcomponent *v)
809 : VComponent(v)
810{
811}
812
813VQuery::VQuery(const std::string &str)
814 : VComponent(str)
815{
816}
817
818/* VJournal */
819
824
826 : VComponent(v)
827{
828}
829
831{
832 if (this == &v) {
833 return *this;
834 }
836
837 return *this;
838}
839
843
844VJournal::VJournal(icalcomponent *v)
845 : VComponent(v)
846{
847}
848
849VJournal::VJournal(const std::string &str)
850 : VComponent(str)
851{
852}
853
854/* VAlarm */
855
860
862 : VComponent(v)
863{
864}
865
867{
868 if (this == &v) {
869 return *this;
870 }
872
873 return *this;
874}
875
877{
878}
879
880VAlarm::VAlarm(icalcomponent *v)
881 : VComponent(v)
882{
883}
884
885VAlarm::VAlarm(const std::string &str)
886 : VComponent(str)
887{
888}
889
891{
893
894 // all VALARMs must have a TRIGGER
895 if (trigger_prop == NULL) {
897 }
898
899 *tr = trigger_prop->get_trigger();
900
901 if (icaltime_is_null_time(tr->time)) {
902 struct icaltimetype tt = icaltime_null_time();
903
904 // relative time trigger
905
906 // TRIGGER;RELATED=END:P5M 5 minutes after END
907 // TRIGGER;RELATED=START:-P15M 15 minutes before START
908 // get RELATED parameter
909
910 ICalParameter *related_param = trigger_prop->get_first_parameter(ICAL_RELATED_PARAMETER);
911
912 if ((related_param != NULL) && related_param->is_valid()) {
913 // get RELATED parameter value
914 const icalparameter_related related = related_param->get_related();
915
916 if (related != 0) {
917 switch (related) {
918 case ICAL_RELATED_END:
919 if (c.isa() == ICAL_VEVENT_COMPONENT) {
920 tt = c.get_dtend();
921
922 // If a recurrenceid exists, use that to calculate the
923 // dtend from the dtstart.
924 const struct icaltimetype recur_time = c.get_recurrenceid();
925 if (!icaltime_is_null_time(recur_time)) {
926 const struct icaldurationtype dur = icalduration_from_times(c.get_dtstart(), tt);
927 tt = icalduration_extend(recur_time, dur);
928 }
929 } else if (c.isa() == ICAL_VTODO_COMPONENT) {
930 tt = c.get_due();
931 const struct icaltimetype recur_time = c.get_recurrenceid();
932 if (!icaltime_is_null_time(recur_time)) {
933 tt = recur_time;
934 }
935 }
936 // the c.get_dtend()/c.get_due() uses DTSTART+DURATION when neither the DTEND nor DUE is present
937 break;
939 case ICAL_RELATED_X:
941 default:
942 tt = c.get_dtstart();
943 const struct icaltimetype recur_time = c.get_recurrenceid();
944 if (!icaltime_is_null_time(recur_time)) {
945 tt = recur_time;
946 }
947 break;
948 }
949 }
950 } else { // no RELATED explicitly specified, the default is
951 // relative to the start of an event or to-do, rfc2445
952 // if no RELATED, we are forced to use dtstart for VEVENT,
953 // due for VTODO to calculate trigger time.
954 // If a recur time exists, use that. Recur time trumps dtstart or due.
955 const struct icaltimetype recur_time = c.get_recurrenceid();
956 if (!icaltime_is_null_time(recur_time)) {
957 tt = recur_time;
958 } else if (c.isa() == ICAL_VEVENT_COMPONENT) {
959 tt = c.get_dtstart();
960 } else if (c.isa() == ICAL_VTODO_COMPONENT) {
961 tt = c.get_due();
962 }
963 }
964
965 delete related_param;
966
967 // malformed? encapsulating VEVENT or VTODO MUST have DTSTART/DTEND
968 if (icaltime_is_null_time(tt)) {
970 }
971
972 // now offset using tr.duration
973 tr->time = icalduration_extend(tt, tr->duration);
974 }
975 // else absolute time trigger
976
978}
979
980/* VFreeBusy */
981
986
988 : VComponent(v)
989{
990}
991
993{
994 if (this == &v) {
995 return *this;
996 }
998
999 return *this;
1000}
1001
1005
1006VFreeBusy::VFreeBusy(icalcomponent *v)
1007 : VComponent(v)
1008{
1009}
1010
1011VFreeBusy::VFreeBusy(const std::string &str)
1012 : VComponent(str)
1013{
1014}
1015
1016/* VTimezone */
1017
1022
1024 : VComponent(v)
1025{
1026}
1027
1029{
1030 if (this == &v) {
1031 return *this;
1032 }
1034
1035 return *this;
1036}
1037
1041
1042VTimezone::VTimezone(icalcomponent *v)
1043 : VComponent(v)
1044{
1045}
1046
1047VTimezone::VTimezone(const std::string &str)
1048 : VComponent(str)
1049{
1050}
1051
1052/* XStandard */
1053
1058
1060 : VComponent(v)
1061{
1062}
1063
1065{
1066 if (this == &v) {
1067 return *this;
1068 }
1070
1071 return *this;
1072}
1073
1077
1078XStandard::XStandard(icalcomponent *v)
1079 : VComponent(v)
1080{
1081}
1082
1083XStandard::XStandard(const std::string &str)
1084 : VComponent(str)
1085{
1086}
1087
1088/* XDaylight */
1089
1094
1096 : VComponent(v)
1097{
1098}
1099
1101{
1102 if (this == &v) {
1103 return *this;
1104 }
1106
1107 return *this;
1108}
1109
1113
1114XDaylight::XDaylight(icalcomponent *v)
1115 : VComponent(v)
1116{
1117}
1118
1119XDaylight::XDaylight(const std::string &str)
1120 : VComponent(str)
1121{
1122}
icalparameter_related get_related() const
struct icaltriggertype get_trigger() const
ICalParameter * get_first_parameter(const icalparameter_kind &kind)
icalproperty_kind isa()
void set_value(const ICalValue &val)
VAgenda & operator=(const VAgenda &)
icalrequeststatus getTriggerTime(VComponent &c, struct icaltriggertype *tr)
VAlarm & operator=(const VAlarm &)
VCalendar & operator=(const VCalendar &)
void set_comment(const std::string &v)
void strip_errors()
Remove all X-LIC-ERROR properties.
void remove_component(VComponent *child)
void set_recurrenceid(const struct icaltimetype &v)
void new_from_string(const std::string &str)
struct icaltimetype get_dtstamp() const
struct icaltimetype get_due() const
void set_dtstamp(const struct icaltimetype &v)
void add_component(VComponent *child)
VComponent * get_first_component(const icalcomponent_kind &kind)
ICalProperty * get_current_property()
static VComponent * next(icalcompiter *i)
icalcompiter end_component(const icalcomponent_kind &kind)
void set_dtstart(const struct icaltimetype &v)
virtual struct icaltime_span get_span()
bool isa_component(const void *component)
static icalcomponent_kind string_to_kind(const std::string &str)
Kind conversion routines.
int count_properties(const icalproperty_kind &kind)
struct icaltimetype get_dtend() const
int count_errors()
Working with embedded error properties.
std::string get_description() const
void set_due(const struct icaltimetype &v)
void set_method(const icalproperty_method &method)
ICalProperty * get_next_property(const icalproperty_kind &kind)
VComponent * get_current_component()
Iterate through components.
static VComponent * prev(icalcompiter *i)
bool recurrence_is_excluded(struct icaltimetype *dtstart, struct icaltimetype *recurtime)
void set_status(const enum icalproperty_status &v)
icalproperty_method get_method() const
void set_relcalid(const std::string &v)
void add_property(ICalProperty *property)
Working with properties.
std::string as_ical_string()
icalcomponent_kind isa()
ICalProperty * get_first_property(const icalproperty_kind &kind)
struct icaltimetype get_recurrenceid() const
void set_description(const std::string &v)
VComponent * get_first_real_component()
struct icaldurationtype get_duration() const
VComponent & operator=(const VComponent &)
void set_location(const std::string &v)
void set_uid(const std::string &v)
icalcompiter begin_component(const icalcomponent_kind &kind)
Using external iterators.
struct icaltimetype get_dtstart() const
void set_dtend(const struct icaltimetype &v)
void set_sequence(const int &v)
bool add(VComponent &)
VComponent * get_inner()
std::string get_uid() const
void set_duration(const struct icaldurationtype &v)
bool update(VComponent &, bool removeMissing)
static std::string kind_to_string(const icalcomponent_kind &kind)
std::string get_comment() const
bool remove(VComponent &, bool ignoreValue)
Note: the VComponent kind have to be the same.
void remove_property(ICalProperty *property)
void set_summary(const std::string &v)
void convert_errors()
Convert some X-LIC-ERROR properties into RETURN-STATUS properties.
std::string get_summary() const
std::string get_relcalid() const
int count_components(const icalcomponent_kind &kind)
std::string get_location() const
static VComponent * current(icalcompiter *i)
VComponent * get_next_component(const icalcomponent_kind &kind)
VEvent & operator=(const VEvent &)
VFreeBusy & operator=(const VFreeBusy &)
VJournal & operator=(const VJournal &)
VQuery & operator=(const VQuery &)
VTimezone & operator=(const VTimezone &)
VToDo & operator=(const VToDo &)
XDaylight & operator=(const XDaylight &)
XStandard & operator=(const XStandard &)
void icalcomponent_convert_errors(icalcomponent *component)
icalcomponent * icalcomponent_new_xstandard(void)
void icalcomponent_set_relcalid(icalcomponent *comp, const char *v)
bool icalcomponent_is_valid(const icalcomponent *component)
icalcomponent * icalcomponent_new_vagenda(void)
void icalcomponent_set_uid(icalcomponent *comp, const char *v)
icalcomponent_kind icalcomponent_string_to_kind(const char *string)
struct icaltimetype icalcomponent_get_dtend(icalcomponent *comp)
struct icaltimetype icalcomponent_get_dtstart(icalcomponent *comp)
icalproperty * icalcomponent_get_first_property(icalcomponent *c, icalproperty_kind kind)
int icalcomponent_count_properties(icalcomponent *component, icalproperty_kind kind)
icalproperty_method icalcomponent_get_method(icalcomponent *comp)
void icalcomponent_set_recurrenceid(icalcomponent *comp, struct icaltimetype v)
struct icaltimetype icalcomponent_get_recurrenceid(icalcomponent *comp)
icalcomponent * icalcompiter_next(icalcompiter *i)
void icalcomponent_set_location(icalcomponent *comp, const char *v)
const char * icalcomponent_get_description(icalcomponent *comp)
icalcomponent * icalcomponent_get_next_component(icalcomponent *c, icalcomponent_kind kind)
icalcomponent * icalcomponent_get_first_component(icalcomponent *c, icalcomponent_kind kind)
void icalcomponent_set_dtstart(icalcomponent *comp, struct icaltimetype v)
void icalcomponent_set_dtstamp(icalcomponent *comp, struct icaltimetype v)
void icalcomponent_strip_errors(icalcomponent *component)
icalcomponent * icalcomponent_new_vcalendar(void)
icalcomponent * icalcomponent_get_current_component(icalcomponent *component)
void icalcomponent_remove_property(icalcomponent *component, icalproperty *property)
char * icalcomponent_as_ical_string(const icalcomponent *component)
const char * icalcomponent_kind_to_string(icalcomponent_kind kind)
enum icalproperty_status icalcomponent_get_status(icalcomponent *comp)
icalcomponent * icalcomponent_new_vjournal(void)
void icalcomponent_remove_component(icalcomponent *parent, icalcomponent *child)
icalcomponent * icalcomponent_new_vfreebusy(void)
icalcomponent * icalcompiter_deref(icalcompiter *i)
void icalcomponent_set_method(icalcomponent *comp, icalproperty_method method)
icalcomponent * icalcomponent_new(icalcomponent_kind kind)
void icalcomponent_set_summary(icalcomponent *comp, const char *v)
void icalcomponent_set_sequence(icalcomponent *comp, int v)
icalcomponent * icalcomponent_get_inner(icalcomponent *comp)
const char * icalcomponent_get_comment(icalcomponent *comp)
const char * icalcomponent_get_summary(icalcomponent *comp)
icaltime_span icalcomponent_get_span(icalcomponent *comp)
const char * icalcomponent_get_relcalid(icalcomponent *comp)
icalcomponent * icalcomponent_get_first_real_component(const icalcomponent *c)
icalcomponent * icalcomponent_new_vtimezone(void)
struct icaltimetype icalcomponent_get_due(icalcomponent *comp)
bool icalproperty_recurrence_is_excluded(icalcomponent *comp, struct icaltimetype *dtstart, struct icaltimetype *recurtime)
Decides if a recurrence is acceptable.
int icalcomponent_count_errors(icalcomponent *component)
struct icaldurationtype icalcomponent_get_duration(icalcomponent *comp)
icalcomponent * icalcomponent_clone(const icalcomponent *old)
icalproperty * icalcomponent_get_current_property(icalcomponent *component)
void icalcomponent_set_dtend(icalcomponent *comp, struct icaltimetype v)
const char * icalcomponent_get_uid(icalcomponent *comp)
int icalcomponent_get_sequence(icalcomponent *comp)
icalcompiter icalcomponent_end_component(icalcomponent *component, icalcomponent_kind kind)
icalcomponent * icalcomponent_new_xdaylight(void)
icalcomponent * icalcomponent_new_valarm(void)
void icalcomponent_add_property(icalcomponent *component, icalproperty *property)
void icalcomponent_set_duration(icalcomponent *comp, struct icaldurationtype v)
icalcompiter icalcomponent_begin_component(icalcomponent *component, icalcomponent_kind kind)
icalcomponent_kind icalcomponent_isa(const icalcomponent *component)
icalcomponent * icalcompiter_prior(icalcompiter *i)
icalcomponent * icalcomponent_new_vtodo(void)
void icalcomponent_set_status(icalcomponent *comp, enum icalproperty_status v)
const char * icalcomponent_get_location(icalcomponent *comp)
void icalcomponent_free(icalcomponent *c)
icalcomponent * icalcomponent_new_vevent(void)
void icalcomponent_set_due(icalcomponent *comp, struct icaltimetype v)
void icalcomponent_add_component(icalcomponent *parent, icalcomponent *child)
icalproperty * icalcomponent_get_next_property(icalcomponent *c, icalproperty_kind kind)
void icalcomponent_set_description(icalcomponent *comp, const char *v)
icalcomponent * icalcomponent_new_from_string(const char *str)
int icalcomponent_count_components(icalcomponent *component, icalcomponent_kind kind)
void icalcomponent_set_comment(icalcomponent *comp, const char *v)
icalcomponent * icalcomponent_new_vquery(void)
bool icalcomponent_isa_component(const void *component)
struct icaltimetype icalcomponent_get_dtstamp(icalcomponent *comp)
@ ICAL_RELATED_PARAMETER
icalparameter_related
@ ICAL_RELATED_NONE
@ ICAL_RELATED_END
@ ICAL_RELATED_X
@ ICAL_RELATED_START
icalproperty_kind
@ ICAL_ANY_PROPERTY
@ ICAL_TRIGGER_PROPERTY
icalproperty_status
icalproperty_method
struct icaldurationtype icalduration_from_times(struct icaltimetype t1, struct icaltimetype t2)
Creates a duration from two icaltimetype endpoints.
struct icaltimetype icalduration_extend(struct icaltimetype t, struct icaldurationtype d)
Extends a time duration.
enum icalrequeststatus kind
Definition icalenums.c:26
const char * str
Definition icalenums.c:29
icalcomponent_kind
Definition icalenums.h:29
@ ICAL_VTODO_COMPONENT
Definition icalenums.h:35
@ ICAL_VEVENT_COMPONENT
Definition icalenums.h:34
@ ICAL_VCALENDAR_COMPONENT
Definition icalenums.h:37
@ ICAL_VAGENDA_COMPONENT
Definition icalenums.h:38
@ ICAL_ANY_COMPONENT
Definition icalenums.h:31
@ ICAL_VQUERY_COMPONENT
Definition icalenums.h:50
@ ICAL_VALARM_COMPONENT
Definition icalenums.h:40
icalrequeststatus
Definition icalenums.h:79
@ ICAL_3_1_INVPROPVAL_STATUS
Definition icalenums.h:94
@ ICAL_2_0_SUCCESS_STATUS
Definition icalenums.h:81
@ ICAL_BADARG_ERROR
Definition icalerror.h:47
#define icalerrno
Access the current icalerrno value.
Definition icalerror.h:133
Common memory management routines.
Definition of C++ Wrapper for icalparameter.c.
void icalproperty_free(icalproperty *p)
Definition of C++ Wrapper for icalproperty.c.
ICPointerHolder< LibICal::ICalProperty > ICalPropertyTmpPtr
bool icaltime_is_null_time(const struct icaltimetype t)
Definition icaltime.c:635
struct icaltimetype icaltime_null_time(void)
Definition icaltime.c:584
Definition of C++ Wrapper for icalvalue.c.
struct icaldurationtype duration
Definition icaltypes.h:51
struct icaltimetype time
Definition icaltypes.h:50
C++ classes for the icalcomponent wrapper (VToDo VEvent, etc..).
ICPointerHolder< LibICal::VComponent > VComponentTmpPtr