bump to 1.0.0 and clean up spec file
[platform/upstream/libical.git] / src / libical / icalvalue_cxx.h
1 /* -*- Mode: C -*- */
2 /*======================================================================
3  FILE: icalvalue_cxx.h
4  CREATOR: fnguyen 12/13/01
5  (C) COPYRIGHT 2001, Critical Path
6
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of either: 
9
10     The LGPL as published by the Free Software Foundation, version
11     2.1, available at: http://www.fsf.org/copyleft/lesser.html
12
13   Or:
14
15     The Mozilla Public License Version 1.0. You may obtain a copy of
16     the License at http://www.mozilla.org/MPL/
17 ======================================================================*/
18
19 #ifndef CP_ICALVALUE_H
20 #define CP_ICALVALUE_H
21
22 extern "C" {
23 #include "ical.h"
24 };
25                           
26 #include "icptrholder.h"
27                           
28 typedef char* string; // Will use the string library from STL
29
30 class ICalValue {
31 public:
32         ICalValue()                                  throw(icalerrorenum);
33         ICalValue(const ICalValue&)                  throw(icalerrorenum);
34         ICalValue& operator=(const ICalValue&)       throw(icalerrorenum);
35         ~ICalValue();
36
37         ICalValue(icalvalue*)                        throw(icalerrorenum);
38         ICalValue(icalvalue_kind kind)               throw(icalerrorenum);
39         ICalValue(icalvalue_kind kind, string  str)  throw(icalerrorenum);
40
41         operator icalvalue* () { return imp; }
42
43         void detach() {
44             imp = NULL;
45         }
46
47 public:
48         string as_ical_string();
49         bool is_valid();
50         icalvalue_kind isa();
51         int isa_value(void*);
52
53         /* Special, non autogenerated value accessors */
54         void set_recur(struct icalrecurrencetype v);
55         struct icalrecurrencetype get_recur();
56
57         void set_trigger(struct icaltriggertype v);
58         struct icaltriggertype get_trigger();
59
60         void set_datetimeperiod(struct icaldatetimeperiodtype v);
61         struct icaldatetimeperiodtype get_datetimeperiod();
62
63 public:
64         static icalparameter_xliccomparetype compare(ICalValue& a, ICalValue& b);
65
66         /* Convert enumerations */
67         static icalvalue_kind string_to_kind(string  str);
68         string kind_to_string(icalvalue_kind kind);
69
70 public:
71         /* BOOLEAN */ 
72         int get_boolean(); 
73         void set_boolean(int v);
74
75         /* UTC-OFFSET */ 
76         int get_utcoffset(); 
77         void set_utcoffset(int v);
78
79         /* METHOD */ 
80         enum icalproperty_method get_method(); 
81         void set_method(enum icalproperty_method v);
82
83         /* CAL-ADDRESS */ 
84         string get_caladdress(); 
85         void set_caladdress(string  v);
86
87         /* PERIOD */ 
88         struct icalperiodtype get_period(); 
89         void set_period(struct icalperiodtype v);
90
91         /* STATUS */ 
92         enum icalproperty_status get_status(); 
93         void set_status(enum icalproperty_status v);
94
95         /* BINARY */ 
96         string get_binary(); 
97         void set_binary(string  v);
98
99         /* TEXT */ 
100         string get_text(); 
101         void set_text(string  v);
102
103         /* DURATION */ 
104         struct icaldurationtype get_duration(); 
105         void set_duration(struct icaldurationtype v);
106
107         /* INTEGER */ 
108         int get_integer(); 
109         void set_integer(int v);
110
111         /* URI */ 
112         string get_uri(); 
113         void set_uri(string  v);
114
115         /* ATTACH */ 
116         icalattach *get_attach(); 
117         void set_attach(icalattach *v);
118
119         /* CLASS */ 
120         enum icalproperty_class get_class(); 
121         void set_class(enum icalproperty_class v);
122
123         /* FLOAT */ 
124         float get_float(); 
125         void set_float(float v);
126
127         /* QUERY */ 
128         string get_query(); 
129         void set_query(string  v);
130
131         /* STRING */ 
132         string get_string(); 
133         void set_string(string  v);
134
135         /* TRANSP */ 
136         enum icalproperty_transp get_transp(); 
137         void set_transp(enum icalproperty_transp v);
138
139         /* DATE-TIME */ 
140         struct icaltimetype get_datetime(); 
141         void set_datetime(struct icaltimetype v);
142
143         /* GEO */ 
144         struct icalgeotype get_geo(); 
145         void set_geo(struct icalgeotype v);
146
147         /* DATE */ 
148         struct icaltimetype get_date(); 
149         void set_date(struct icaltimetype v);
150
151         /* ACTION */ 
152         enum icalproperty_action get_action(); 
153         void set_action(enum icalproperty_action v);
154
155 private:
156         icalvalue* imp;
157 };
158
159
160 typedef ICPointerHolder<ICalValue> ICalValueTmpPtr;    /* see icptrholder.h for comments */
161
162 #endif /*ICALVALUE_H*/