Back to index

lightning-sunbird  0.9+nobinonly
icalparameter_cxx.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++ -*- */
00002 
00011 #ifndef ICALPARAMETER_CXX_H
00012 #include "icalparameter_cxx.h"
00013 #endif
00014 
00015 #ifndef ICALVALUE_CXX_H
00016 #include "icalvalue_cxx.h"
00017 #endif
00018 
00019 typedef       char* string; // Will use the string library from STL
00020 
00021 ICalParameter::ICalParameter() throw(icalerrorenum) : imp(icalparameter_new(ICAL_ANY_PARAMETER)){
00022 }
00023 
00024 ICalParameter::ICalParameter(const ICalParameter& v) throw(icalerrorenum) {
00025        imp = icalparameter_new_clone(v.imp);
00026        if (!imp) throw icalerrno;
00027 }
00028 
00029 ICalParameter& ICalParameter::operator=(const ICalParameter& v)  throw(icalerrorenum) {
00030        if (this == &v) return *this;
00031 
00032        if (imp != NULL)
00033        {
00034               icalparameter_free(imp);
00035               imp = icalparameter_new_clone(v.imp);
00036               if (!imp) throw icalerrno;
00037        }
00038     
00039        return *this;
00040 }
00041 
00042 ICalParameter::~ICalParameter(){
00043        if (imp != NULL) icalparameter_free(imp);
00044 }
00045 
00046 ICalParameter::ICalParameter(icalparameter* v) throw(icalerrorenum) : imp(v){
00047 }
00048 
00050 ICalParameter::ICalParameter(string str) throw(icalerrorenum) { 
00051        imp = icalparameter_new_from_string(str);
00052        if (!imp) throw icalerrno;
00053 }
00054 
00056 ICalParameter::ICalParameter(icalparameter_kind kind, string  str) throw(icalerrorenum) { 
00057        imp = icalparameter_new_from_value_string(kind, str);
00058        if (!imp) throw icalerrno;
00059 }
00060 
00061 ICalParameter::ICalParameter(icalparameter_kind kind) throw(icalerrorenum) {
00062        imp = icalparameter_new(kind);
00063        if (!imp) throw icalerrno;
00064 }
00065 
00066 string ICalParameter::as_ical_string() throw(icalerrorenum) {
00067   char *str = icalparameter_as_ical_string(imp);
00068 
00069   if (!str) throw icalerrno;
00070 
00071   return str;
00072 }
00073 
00074 bool ICalParameter::is_valid(){
00075        if (imp == NULL) return false;
00076        return (icalparameter_isa_parameter((void*)imp) ? true : false);
00077 }
00078 icalparameter_kind ICalParameter::isa(){
00079        return icalparameter_isa(imp);
00080 }
00081 int ICalParameter::isa_parameter(void* param){
00082        return icalparameter_isa_parameter(param);
00083 }
00084 
00085 /* Acess the name of an X parameer */
00086 void ICalParameter::set_xname(ICalParameter &param, string  v){
00087        icalparameter_set_xname(param, v);
00088 }
00089 string ICalParameter::get_xname(ICalParameter &param){
00090        return (string)icalparameter_get_xname(param);
00091 }
00092 void ICalParameter::set_xvalue (ICalParameter &param, string  v){
00093        icalparameter_set_xvalue(param, v);
00094 }
00095 string ICalParameter::get_xvalue(ICalParameter &param){
00096        return (string)icalparameter_get_xvalue(param);
00097 }
00098 
00099 /* Convert enumerations */
00100 string ICalParameter::kind_to_string(icalparameter_kind kind){
00101        return (string)icalparameter_kind_to_string(kind);
00102 }
00103 icalparameter_kind ICalParameter::string_to_kind(string  str){
00104        return icalparameter_string_to_kind(str);
00105 }
00106 
00107 /* DELEGATED-FROM */
00108 string ICalParameter::get_delegatedfrom(){
00109        return (string)icalparameter_get_delegatedfrom(imp);
00110 }
00111 void ICalParameter::set_delegatedfrom(string  v){
00112        icalparameter_set_delegatedfrom(imp, v);
00113 }
00114 
00115 /* RELATED */
00116 icalparameter_related ICalParameter::get_related(){
00117        return icalparameter_get_related(imp);
00118 }
00119 void ICalParameter::set_related(icalparameter_related v){
00120        icalparameter_set_related(imp, v);
00121 }
00122 
00123 /* SENT-BY */
00124 string ICalParameter::get_sentby(){
00125        return (string)icalparameter_get_sentby(imp);
00126 }
00127 void ICalParameter::set_sentby(string  v){
00128        icalparameter_set_sentby(imp, v);
00129 }
00130 
00131 /* LANGUAGE */
00132 string ICalParameter::get_language(){
00133        return (string)icalparameter_get_language(imp);
00134 }
00135 void ICalParameter::set_language(string  v){
00136        icalparameter_set_language(imp, v);
00137 }
00138 
00139 /* RELTYPE */
00140 icalparameter_reltype ICalParameter::get_reltype(){
00141        return icalparameter_get_reltype(imp);
00142 }
00143 void ICalParameter::set_reltype(icalparameter_reltype v){
00144        icalparameter_set_reltype(imp, v);
00145 }
00146 
00147 /* ENCODING */
00148 icalparameter_encoding ICalParameter::get_encoding(){
00149        return icalparameter_get_encoding(imp);
00150 }
00151 void ICalParameter::set_encoding(icalparameter_encoding v){
00152        icalparameter_set_encoding(imp, v);
00153 }
00154 
00155 /* ALTREP */
00156 string ICalParameter::get_altrep(){
00157        return (string)icalparameter_get_language(imp);
00158 }
00159 void ICalParameter::set_altrep(string  v){
00160        icalparameter_set_altrep(imp, v);
00161 }
00162 
00163 /* FMTTYPE */
00164 string ICalParameter::get_fmttype(){
00165        return (string)icalparameter_get_fmttype(imp);
00166 }
00167 void ICalParameter::set_fmttype(string  v){
00168        icalparameter_set_fmttype(imp, v);
00169 }
00170 
00171 /* FBTYPE */
00172 icalparameter_fbtype ICalParameter::get_fbtype(){
00173        return icalparameter_get_fbtype(imp);
00174 }
00175 void ICalParameter::set_fbtype(icalparameter_fbtype v){
00176        icalparameter_set_fbtype(imp, v);
00177 }
00178 
00179 /* RSVP */
00180 icalparameter_rsvp ICalParameter::get_rsvp(){
00181        return icalparameter_get_rsvp(imp);
00182 }
00183 void ICalParameter::set_rsvp(icalparameter_rsvp v){
00184        icalparameter_set_rsvp(imp, v);
00185 }
00186 
00187 /* RANGE */
00188 icalparameter_range ICalParameter::get_range(){
00189        return icalparameter_get_range(imp);
00190 }
00191 void ICalParameter::set_range(icalparameter_range v){
00192        icalparameter_set_range(imp, v);
00193 }
00194 
00195 /* DELEGATED-TO */
00196 string ICalParameter::get_delegatedto(){
00197        return (string)icalparameter_get_delegatedto(imp);
00198 }
00199 void ICalParameter::set_delegatedto(string  v){
00200        icalparameter_set_delegatedto(imp, v);
00201 }
00202 
00203 /* CN */
00204 string ICalParameter::get_cn(){
00205        return (string)icalparameter_get_cn(imp);
00206 }
00207 void ICalParameter::set_cn(string  v){
00208        icalparameter_set_cn(imp, v);
00209 }
00210 
00211 /* ROLE */
00212 icalparameter_role ICalParameter::get_role(){
00213        return icalparameter_get_role(imp);
00214 }
00215 void ICalParameter::set_role(icalparameter_role v){
00216        icalparameter_set_role(imp, v);
00217 }
00218 
00219 /* X-LIC-COMPARETYPE */
00220 icalparameter_xliccomparetype ICalParameter::get_xliccomparetype(){
00221        return icalparameter_get_xliccomparetype(imp);
00222 }
00223 void ICalParameter::set_xliccomparetype(icalparameter_xliccomparetype v){
00224        icalparameter_set_xliccomparetype(imp, v);
00225 }
00226 
00227 /* PARTSTAT */
00228 icalparameter_partstat ICalParameter::get_partstat(){
00229        return icalparameter_get_partstat(imp);
00230 }
00231 void ICalParameter::set_partstat(icalparameter_partstat v){
00232        icalparameter_set_partstat(imp, v);
00233 }
00234 
00235 /* X-LIC-ERRORTYPE */
00236 icalparameter_xlicerrortype ICalParameter::get_xlicerrortype(){
00237        return icalparameter_get_xlicerrortype(imp);
00238 }
00239 void ICalParameter::set_xlicerrortype(icalparameter_xlicerrortype v){
00240        icalparameter_set_xlicerrortype(imp, v);
00241 }
00242 
00243 /* MEMBER */
00244 string ICalParameter::get_member(){
00245        return (string)icalparameter_get_member(imp);
00246 }
00247 void ICalParameter::set_member(string  v){
00248        icalparameter_set_member(imp, v);
00249 }
00250 
00251 /* X */
00252 string ICalParameter::get_x(){
00253        return (string)icalparameter_get_x(imp);
00254 }
00255 void ICalParameter::set_x(string  v){
00256        icalparameter_set_x(imp, v);
00257 }
00258 
00259 /* CUTYPE */
00260 icalparameter_cutype ICalParameter::get_cutype(){
00261        return icalparameter_get_cutype(imp);
00262 }
00263 void ICalParameter::set_cutype(icalparameter_cutype v){
00264        icalparameter_set_cutype(imp, v);
00265 }
00266 
00267 /* TZID */
00268 string ICalParameter::get_tzid(){
00269        return (string)icalparameter_get_tzid(imp);
00270 }
00271 void ICalParameter::set_tzid(string  v){
00272        icalparameter_set_tzid(imp, v);
00273 }
00274 
00275 /* VALUE */
00276 icalparameter_value ICalParameter::get_value(){
00277        return icalparameter_get_value(imp);
00278 }
00279 void ICalParameter::set_value(icalparameter_value v){
00280        icalparameter_set_value(imp, v);
00281 }
00282 
00283 /* DIR */
00284 string ICalParameter::get_dir(){
00285        return (string)icalparameter_get_dir(imp);
00286 }
00287 void ICalParameter::set_dir(string  v){
00288        icalparameter_set_dir(imp, v);
00289 }