Back to index

lightning-sunbird  0.9+nobinonly
icalvalue_cxx.h
Go to the documentation of this file.
00001 /* -*- Mode: C -*- */
00002 /*======================================================================
00003  FILE: icalvalue_cxx.h
00004  CREATOR: fnguyen 12/13/01
00005  (C) COPYRIGHT 2001, Critical Path
00006 ======================================================================*/
00007 
00008 #ifndef CP_ICALVALUE_H
00009 #define CP_ICALVALUE_H
00010 
00011 extern "C" {
00012 #include "ical.h"
00013 };
00014                           
00015 #include "icptrholder.h"
00016                           
00017 typedef       char* string; // Will use the string library from STL
00018 
00019 class ICalValue {
00020 public:
00021        ICalValue()                                  throw(icalerrorenum);
00022        ICalValue(const ICalValue&)                  throw(icalerrorenum);
00023        ICalValue& operator=(const ICalValue&)       throw(icalerrorenum);
00024        ~ICalValue();
00025 
00026        ICalValue(icalvalue*)                        throw(icalerrorenum);
00027        ICalValue(icalvalue_kind kind)               throw(icalerrorenum);
00028        ICalValue(icalvalue_kind kind, string  str)  throw(icalerrorenum);
00029 
00030        operator icalvalue* () { return imp; }
00031 
00032        void detach() {
00033            imp = NULL;
00034        }
00035 
00036 public:
00037        string as_ical_string();
00038        bool is_valid();
00039        icalvalue_kind isa();
00040        int isa_value(void*);
00041 
00042        /* Special, non autogenerated value accessors */
00043        void set_recur(struct icalrecurrencetype v);
00044        struct icalrecurrencetype get_recur();
00045 
00046        void set_trigger(struct icaltriggertype v);
00047        struct icaltriggertype get_trigger();
00048 
00049        void set_datetimeperiod(struct icaldatetimeperiodtype v);
00050        struct icaldatetimeperiodtype get_datetimeperiod();
00051 
00052 public:
00053        static icalparameter_xliccomparetype compare(ICalValue& a, ICalValue& b);
00054 
00055        /* Convert enumerations */
00056        static icalvalue_kind string_to_kind(string  str);
00057        string kind_to_string(icalvalue_kind kind);
00058 
00059 public:
00060        /* BOOLEAN */ 
00061        int get_boolean(); 
00062        void set_boolean(int v);
00063 
00064        /* UTC-OFFSET */ 
00065        int get_utcoffset(); 
00066        void set_utcoffset(int v);
00067 
00068        /* METHOD */ 
00069        enum icalproperty_method get_method(); 
00070        void set_method(enum icalproperty_method v);
00071 
00072        /* CAL-ADDRESS */ 
00073        string get_caladdress(); 
00074        void set_caladdress(string  v);
00075 
00076        /* PERIOD */ 
00077        struct icalperiodtype get_period(); 
00078        void set_period(struct icalperiodtype v);
00079 
00080        /* STATUS */ 
00081        enum icalproperty_status get_status(); 
00082        void set_status(enum icalproperty_status v);
00083 
00084        /* BINARY */ 
00085        string get_binary(); 
00086        void set_binary(string  v);
00087 
00088        /* TEXT */ 
00089        string get_text(); 
00090        void set_text(string  v);
00091 
00092        /* DURATION */ 
00093        struct icaldurationtype get_duration(); 
00094        void set_duration(struct icaldurationtype v);
00095 
00096        /* INTEGER */ 
00097        int get_integer(); 
00098        void set_integer(int v);
00099 
00100        /* URI */ 
00101        string get_uri(); 
00102        void set_uri(string  v);
00103 
00104        /* ATTACH */ 
00105        icalattach *get_attach(); 
00106        void set_attach(icalattach *v);
00107 
00108        /* CLASS */ 
00109        enum icalproperty_class get_class(); 
00110        void set_class(enum icalproperty_class v);
00111 
00112        /* FLOAT */ 
00113        float get_float(); 
00114        void set_float(float v);
00115 
00116        /* QUERY */ 
00117        string get_query(); 
00118        void set_query(string  v);
00119 
00120        /* STRING */ 
00121        string get_string(); 
00122        void set_string(string  v);
00123 
00124        /* TRANSP */ 
00125        enum icalproperty_transp get_transp(); 
00126        void set_transp(enum icalproperty_transp v);
00127 
00128        /* DATE-TIME */ 
00129        struct icaltimetype get_datetime(); 
00130        void set_datetime(struct icaltimetype v);
00131 
00132        /* GEO */ 
00133        struct icalgeotype get_geo(); 
00134        void set_geo(struct icalgeotype v);
00135 
00136        /* DATE */ 
00137        struct icaltimetype get_date(); 
00138        void set_date(struct icaltimetype v);
00139 
00140        /* ACTION */ 
00141        enum icalproperty_action get_action(); 
00142        void set_action(enum icalproperty_action v);
00143 
00144 private:
00145        icalvalue* imp;
00146 };
00147 
00148 
00149 typedef ICPointerHolder<ICalValue> ICalValueTmpPtr;    /* see icptrholder.h for comments */
00150 
00151 #endif /*ICALVALUE_H*/