Imported Upstream version 0.8~alpha1
[platform/upstream/syncevolution.git] / src / client-api / src / include / common / vocl / vCard / vCardProperty.h
1 /*
2  * Funambol is a mobile platform developed by Funambol, Inc. 
3  * Copyright (C) 2003 - 2007 Funambol, Inc.
4  * 
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Affero General Public License version 3 as published by
7  * the Free Software Foundation with the addition of the following permission 
8  * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
9  * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE 
10  * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
11  * 
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
15  * details.
16  * 
17  * You should have received a copy of the GNU Affero General Public License 
18  * along with this program; if not, see http://www.gnu.org/licenses or write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20  * MA 02110-1301 USA.
21  * 
22  * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite 
23  * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
24  * 
25  * The interactive user interfaces in modified source and object code versions
26  * of this program must display Appropriate Legal Notices, as required under
27  * Section 5 of the GNU Affero General Public License version 3.
28  * 
29  * In accordance with Section 7(b) of the GNU Affero General Public License
30  * version 3, these Appropriate Legal Notices must retain the display of the
31  * "Powered by Funambol" logo. If the display of the logo is not reasonably 
32  * feasible for technical reasons, the Appropriate Legal Notices must display
33  * the words "Powered by Funambol".
34  */
35
36
37 //
38 // @author Stefano Fornari @ Funambol
39 // @version $Id: vCardProperty.h,v 1.8 2008-04-11 08:17:13 marco_garatti Exp $
40 //
41 #include <string.h>
42
43 #ifndef INCL_PIM_PROPERTY
44 #define INCL_PIM_PROPERTY
45 /** @cond DEV */
46
47 #include "base/fscapi.h"
48 #include "base/globalsdef.h"
49
50 BEGIN_NAMESPACE
51
52 /**
53  * This object represents a property for VCard and ICalendar object
54  * (i.e. its value and its parameters)
55  */
56 class vCardProperty {
57
58     // ------------------------------------------------------------ Private data
59
60     private:
61         WCHAR* encoding     ;
62         WCHAR* language     ;
63         WCHAR* value        ;
64         WCHAR* chrset       ;
65
66         /**
67          * Sets internal members releasing the currently allocated memory (if
68          * any was allocate). The passed value is duplicated so that the caller
69          * can independently release it.
70          *
71          * @param property the address of the pointer to set to the new
72          *                 allocated memory
73          * @param v the value to set into the property
74          */
75         void set(WCHAR** property, WCHAR* v);
76
77     // -------------------------------------------- Constructors and Destructors
78     public:
79         /**
80          * Creates property without parameters but with the specified value
81          */
82         vCardProperty (WCHAR* v = NULL);
83
84         ~vCardProperty();
85
86     // ---------------------------------------------------------- Public methods
87
88         /**
89          * Returns the encoding parameter of this property
90          *
91          * @param buf if not NULL, the value is copied in this buffer
92          * @param size buffer size
93          *
94          * @return the encoding parameter of this property
95          */
96         WCHAR* getEncoding (WCHAR* buf = NULL, int size = -1);
97
98         /**
99          * Returns the language parameter of this property
100          *
101          * @param buf if not NULL, the value is copied in this buffer
102          * @param size buffer size
103          *
104          * @return the language parameter of this property
105          */
106         WCHAR* getLanguage (WCHAR* buf = NULL, int size = -1);
107
108         /**
109          * Returns the value parameter of this property
110          *
111          * @param buf if not NULL, the value is copied in this buffer
112          * @param size buffer size
113          *
114          * @return the value parameter of this property
115          */
116         WCHAR* getValue (WCHAR* buf = NULL, int size = -1);
117
118         /**
119          * Returns the charset parameter of this property
120          *
121          * @param buf if not NULL, the value is copied in this buffer
122          * @param size buffer size
123          *
124          * @return the charset parameter of this property
125          */
126         WCHAR* getCharset (WCHAR* buf = NULL, int size = -1);
127
128         /**
129          * Sets the encoding parameter of this property
130          *
131          * @param encoding the encoding to set
132          */
133         void setEncoding (WCHAR* encoding);
134
135         /**
136          * Sets the language parameter of this property
137          *
138          * @param language the language to set
139          */
140         void setLanguage (WCHAR* language);
141
142         /**
143          * Sets the value parameter of this property
144          *
145          * @param value the value to set
146          */
147         void setValue (WCHAR* value);
148
149         /**
150          * Sets the charset parameter of this property
151          *
152          * @param chrset the charset to set
153          */
154         void setCharset (WCHAR* chrset);
155
156
157         /**
158          * Creates and returns a new Property object. The object is created with
159          * the C++ new operator and must be deallocated with the delete C++
160          * operator
161          */
162         vCardProperty* clone();
163 };
164
165
166 END_NAMESPACE
167
168 /** @endcond */
169 #endif