Imported Upstream version 0.8~alpha1
[platform/upstream/syncevolution.git] / src / client-api / src / include / common / vocl / vCard / Address.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: Address.h,v 1.7 2008-04-11 08:17:13 marco_garatti Exp $
40 //
41
42 #ifndef INCL_PIM_ADDRESS
43 #define INCL_PIM_ADDRESS
44 /** @cond DEV */
45
46 #include "vocl/vCard/vCardProperty.h"
47 #include "base/globalsdef.h"
48
49 BEGIN_NAMESPACE
50
51 /**
52  * An object representing an address
53  */
54 class Address {
55
56     // ------------------------------------------------------------ Private data
57
58     private:
59         vCardProperty* postOfficeAddress;
60         vCardProperty* roomNumber;
61         vCardProperty* street;
62         vCardProperty* city;
63         vCardProperty* state;
64         vCardProperty* postalCode;
65         vCardProperty* country;
66         vCardProperty* label;
67
68         /**
69          * Sets the given property address to a clone of the given property. If
70          * oldProperty is not null the pointed object is deleted.
71          *
72          * @param oldProperty Property** to the address of the property to set
73          * @param newProperty the new property to set
74          */
75         void set(vCardProperty** oldProperty, vCardProperty& newProperty);
76
77     // -------------------------------------------- Constructors and Destructors
78     public:
79         /**
80          * Creates an empty address
81          */
82         Address();
83         ~Address();
84
85     // ---------------------------------------------------------- Public methods
86
87         /**
88          * Returns the post office of this address
89          *
90          * @return the post office of this address or NULL if not defined
91          */
92         vCardProperty* getPostOfficeAddress ();
93
94         /**
95          * Sets the address post office. The given property is cloned, so that the
96          * caller can independently release it as needed.
97          */
98         void setPostOfficeAddress(vCardProperty& p);
99
100         /**
101          * Returns the address room number of this address
102          *
103          * @return the room number of this address or NULL if not defined
104          */
105         vCardProperty* getRoomNumber () ;
106
107         /**
108          * Sets the address room number. The given property is cloned, so that the
109          * caller can independently release it as needed.
110          */
111         void setRoomNumber(vCardProperty& p);
112
113         /**
114          * Returns the street of this address
115          *
116          * @return the street of this address or NULL if not defined
117          */
118         vCardProperty* getStreet () ;
119
120         /**
121          * Sets the address street. The given property is cloned, so that the
122          * caller can independently release it as needed.
123          */
124         void setStreet(vCardProperty& p);
125
126         /**
127          * Returns the city of this address
128          *
129          * @return the city of this address or NULL if not defined
130          */
131         vCardProperty* getCity () ;
132
133         /**
134          * Sets the address city. The given property is cloned, so that the
135          * caller can independently release it as needed.
136          */
137         void setCity(vCardProperty& p);
138
139         /**
140          * Returns the state of this address
141          *
142          * @return the state of this address or NULL if not defined
143          */
144         vCardProperty* getState () ;
145
146         /**
147          * Sets the address state. The given property is cloned, so that the
148          * caller can independently release it as needed.
149          */
150         void setState(vCardProperty& p);
151
152         /**
153          * Returns the postal code of this address
154          *
155          * @return the postal code of this address or NULL if not defined
156          */
157         vCardProperty* getPostalCode () ;
158
159         /**
160          * Sets the address post office. The given property is cloned, so that the
161          * caller can independently release it as needed.
162          */
163         void setPostalCode(vCardProperty& p);
164
165         /**
166          * Returns the country of this address
167          *
168          * @return the country of this address or NULL if not defined
169          */
170         vCardProperty* getCountry () ;
171
172         /**
173          * Sets the address country. The given property is cloned, so that the
174          * caller can independently release it as needed.
175          */
176         void setCountry(vCardProperty& p);
177
178         /**
179          * Returns the label of this address
180          *
181          * @return the label of this address or NULL if not defined
182          */
183         vCardProperty* getLabel () ;
184
185         /**
186          * Sets the address label. The given property is cloned, so that the
187          * caller can independently release it as needed.
188          */
189         void setLabel(vCardProperty& p);
190
191         /**
192          * Creates and returns a new Address object. The object is created with
193          * the C++ new operator and must be deallocated with the delete C++
194          * operator
195          */
196         Address* clone();
197
198 };
199
200
201 END_NAMESPACE
202
203 /** @endcond */
204 #endif