Back to index

lightning-sunbird  0.9+nobinonly
icalproperty_cxx.h
Go to the documentation of this file.
00001 /* -*- Mode: C++ -*- */
00002 
00011 #ifndef ICALPROPERTY_CXX_H
00012 #define ICALPROPERTY_CXX_H
00013 
00014 #include "ical.h"
00015 #include "icptrholder.h"
00016 
00017 typedef       char* string; // Will use the string library from STL
00018 
00019 class ICalParameter;
00020 class ICalValue;
00021 
00022 class ICalProperty {
00023 public:
00024        ICalProperty();
00025        ICalProperty(const ICalProperty&) throw(icalerrorenum);
00026        ICalProperty& operator=(const ICalProperty&) throw(icalerrorenum);
00027        ~ICalProperty();
00028 
00029        ICalProperty(icalproperty* v);
00030        ICalProperty(string str);
00031        ICalProperty(icalproperty_kind kind);
00032        ICalProperty(icalproperty_kind kind, string str);
00033 
00034        operator icalproperty*() {return imp;}
00035         int operator==(ICalProperty& rhs);
00036 
00037        void detach() {
00038            imp = NULL;
00039        }
00040 
00041 public:
00042        string as_ical_string();
00043        icalproperty_kind isa();
00044        int isa_property(void* property);
00045 
00046        void add_parameter(ICalParameter& parameter);
00047        void set_parameter(ICalParameter& parameter);
00048        void set_parameter_from_string(string name, string val);
00049        string get_parameter_as_string(string name);
00050        void remove_parameter(icalparameter_kind kind);
00051        int count_parameters();
00052 
00054        ICalParameter* get_first_parameter(icalparameter_kind kind);
00055        ICalParameter* get_next_parameter(icalparameter_kind kind);
00056 
00058        void set_value(const ICalValue& val);
00059        void set_value_from_string(string val, string kind);
00060 
00061        ICalValue* get_value();
00062        string get_value_as_string();
00063 
00068        string get_name();
00069 
00070 public:
00071        /* Deal with X properties */
00072        static void set_x_name(ICalProperty &prop, string name);
00073        static string get_x_name(ICalProperty &prop);
00074 
00075        static icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value val);
00076 
00077        /* Convert kinds to string and get default value type */
00078        static icalvalue_kind kind_to_value_kind(icalproperty_kind kind);
00079        static icalproperty_kind value_kind_to_kind(icalvalue_kind kind);
00080        static string kind_to_string(icalproperty_kind kind);
00081        static icalproperty_kind string_to_kind(string str);
00082 
00083        static icalproperty_method string_to_method(string str);
00084        static string method_to_string(icalproperty_method method);
00085 
00086        static string enum_to_string(int e);
00087        static int string_to_enum(string str);
00088 
00089        static string status_to_string(icalproperty_status);
00090        static icalproperty_status string_to_status(string str);
00091 
00092        static int enum_belongs_to_property(icalproperty_kind kind, int e);
00093 
00094 public:
00095        /* ACTION */
00096        void set_action(enum icalproperty_action v);
00097        enum icalproperty_action get_action();
00098 
00099        /* ATTACH */
00100        void set_attach(icalattach *v);
00101        icalattach *get_attach();
00102 
00103        /* ATTENDEE */
00104        void set_attendee(string val);
00105        string get_attendee();
00106 
00107        /* CALSCALE */
00108        void set_calscale(string val);
00109        string get_calscale();
00110 
00111        /* CATEGORIES */
00112        void set_categories(string val);
00113        string get_categories();
00114 
00115        /* CLASS */
00116        void set_class(enum icalproperty_class val);
00117        enum icalproperty_class get_class();
00118 
00119        /* COMMENT */
00120        void set_comment(string val);
00121        string get_comment();
00122 
00123        /* COMPLETED */
00124        void set_completed(struct icaltimetype val);
00125        struct icaltimetype get_completed();
00126 
00127        /* CONTACT */
00128        void set_contact(string val);
00129        string get_contact();
00130 
00131        /* CREATED */
00132        void set_created(struct icaltimetype val);
00133        struct icaltimetype get_created();
00134 
00135        /* DESCRIPTION */
00136        void set_description(string val);
00137        string get_description();
00138 
00139        /* DTEND */
00140        void set_dtend(struct icaltimetype val);
00141        struct icaltimetype get_dtend();
00142 
00143        /* DTSTAMP */
00144        void set_dtstamp(struct icaltimetype val);
00145        struct icaltimetype get_dtstamp();
00146 
00147        /* DTSTART */
00148        void set_dtstart(struct icaltimetype val);
00149        struct icaltimetype get_dtstart();
00150 
00151        /* DUE */
00152        void set_due(struct icaltimetype val);
00153        struct icaltimetype get_due();
00154 
00155        /* DURATION */
00156        void set_duration(struct icaldurationtype val);
00157        struct icaldurationtype get_duration();
00158 
00159        /* EXDATE */
00160        void set_exdate(struct icaltimetype val);
00161        struct icaltimetype get_exdate();
00162 
00163        /* EXPAND */
00164        void set_expand(int val);
00165        int get_expand();
00166 
00167        /* EXRULE */
00168        void set_exrule(struct icalrecurrencetype val);
00169        struct icalrecurrencetype get_exrule();
00170 
00171        /* FREEBUSY */
00172        void set_freebusy(struct icalperiodtype val);
00173        struct icalperiodtype get_freebusy();
00174 
00175        /* GEO */
00176        void set_geo(struct icalgeotype val);
00177        struct icalgeotype get_geo();
00178 
00179        /* GRANT */
00180        void set_grant(string val);
00181        string get_grant();
00182 
00183        /* LAST-MODIFIED */
00184        void set_lastmodified(struct icaltimetype val);
00185        struct icaltimetype get_lastmodified();
00186 
00187        /* LOCATION */
00188        void set_location(string val);
00189        string get_location();
00190 
00191        /* MAXRESULTS */
00192        void set_maxresults(int val);
00193        int get_maxresults();
00194 
00195        /* MAXRESULTSSIZE */
00196        void set_maxresultsize(int val);
00197        int get_maxresultsize();
00198 
00199        /* METHOD */
00200        void set_method(enum icalproperty_method val);
00201        enum icalproperty_method get_method();
00202 
00203        /* OWNER */
00204        void set_owner(string val);
00205        string get_owner();
00206 
00207        /* ORGANIZER */
00208        void set_organizer(string val);
00209        string get_organizer();
00210 
00211        /* PERCENT-COMPLETE */
00212        void set_percentcomplete(int val);
00213        int get_percentcomplete();
00214 
00215        /* PRIORITY */
00216        void set_priority(int val);
00217        int get_priority();
00218 
00219        /* PRODID */
00220        void set_prodid(string val);
00221        string get_prodid();
00222 
00223        /* QUERY */
00224        void set_query(string val);
00225        string get_query();
00226 
00227        /* QUERYNAME */
00228        void set_queryname(string val);
00229        string get_queryname();
00230 
00231        /* RDATE */
00232        void set_rdate(struct icaldatetimeperiodtype val);
00233        struct icaldatetimeperiodtype get_rdate();
00234 
00235        /* RECURRENCE-ID */
00236        void set_recurrenceid(struct icaltimetype val);
00237        struct icaltimetype get_recurrenceid();
00238 
00239        /* RELATED-TO */
00240        void set_relatedto(string val);
00241        string get_relatedto();
00242 
00243         /* RELCALID */
00244         void set_relcalid(string val);
00245         string get_relcalid();
00246 
00247        /* REPEAT */
00248        void set_repeat(int val);
00249        int get_repeat();
00250 
00251        /* REQUEST-STATUS */
00252        void set_requeststatus(string val);
00253        string get_requeststatus();
00254 
00255        /* RESOURCES */
00256        void set_resources(string val);
00257        string get_resources();
00258 
00259        /* RRULE */
00260        void set_rrule(struct icalrecurrencetype val);
00261        struct icalrecurrencetype get_rrule();
00262 
00263        /* SCOPE */
00264        void set_scope(string val);
00265        string get_scope();
00266 
00267        /* SEQUENCE */
00268        void set_sequence(int val);
00269        int get_sequence();
00270 
00271        /* STATUS */
00272        void set_status(enum icalproperty_status val);
00273        enum icalproperty_status get_status();
00274 
00275        /* SUMMARY */
00276        void set_summary(string val);
00277        string get_summary();
00278 
00279        /* TARGET */
00280        void set_target(string val);
00281        string get_target();
00282 
00283        /* TRANSP */
00284        void set_transp(enum icalproperty_transp val);
00285        enum icalproperty_transp get_transp();
00286 
00287        /* TRIGGER */
00288        void set_trigger(struct icaltriggertype val);
00289        struct icaltriggertype get_trigger();
00290 
00291        /* TZID */
00292        void set_tzid(string val);
00293        string get_tzid();
00294 
00295        /* TZNAME */
00296        void set_tzname(string val);
00297        string get_tzname();
00298 
00299        /* TZOFFSETFROM */
00300        void set_tzoffsetfrom(int val);
00301        int get_tzoffsetfrom();
00302 
00303        /* TZOFFSETTO */
00304        void set_tzoffsetto(int val);
00305        int get_tzoffsetto();
00306 
00307        /* TZURL */
00308        void set_tzurl(string val);
00309        string get_tzurl();
00310 
00311        /* UID */
00312        void set_uid(string val);
00313        string get_uid();
00314 
00315        /* URL */
00316        void set_url(string val);
00317        string get_url();
00318 
00319        /* VERSION */
00320        void set_version(string val);
00321        string get_version();
00322 
00323        /* X */
00324        void set_x(string val);
00325        string get_x();
00326 
00327        /* X-LIC-CLUSTERCOUNT */
00328        void set_xlicclustercount(string val);
00329        string get_xlicclustercount();
00330 
00331        /* X-LIC-ERROR */
00332        void set_xlicerror(string val);
00333        string get_xlicerror();
00334 
00335        /* X-LIC-MIMECHARSET */
00336        void set_xlicmimecharset(string val);
00337        string get_xlicmimecharset();
00338 
00339        /* X-LIC-MIMECID */
00340        void set_xlicmimecid(string val);
00341        string get_xlicmimecid();
00342 
00343        /* X-LIC-MIMECONTENTTYPE */
00344        void set_xlicmimecontenttype(string val);
00345        string get_xlicmimecontenttype();
00346 
00347        /* X-LIC-MIMEENCODING */
00348        void set_xlicmimeencoding(string val);
00349        string get_xlicmimeencoding();
00350 
00351        /* X-LIC-MIMEFILENAME */
00352        void set_xlicmimefilename(string val);
00353        string get_xlicmimefilename();
00354 
00355        /* X-LIC-MIMEOPTINFO */
00356        void set_xlicmimeoptinfo(string val);
00357        string get_xlicmimeoptinfo();
00358 
00359 private:
00360   icalproperty* imp; 
00361 };
00362 
00363 typedef ICPointerHolder<ICalProperty> ICalPropertyTmpPtr;   /* see icptrholder.h for comments */
00364 
00365 #endif /* ICalProperty_H */