2 * Funambol is a mobile platform developed by Funambol, Inc.
3 * Copyright (C) 2003 - 2007 Funambol, Inc.
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.
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
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,
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.
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.
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".
38 // @author Stefano Fornari @ Funambol
39 // @version $Id: Address.h,v 1.7 2008-04-11 08:17:13 marco_garatti Exp $
42 #ifndef INCL_PIM_ADDRESS
43 #define INCL_PIM_ADDRESS
46 #include "vocl/vCard/vCardProperty.h"
47 #include "base/globalsdef.h"
52 * An object representing an address
56 // ------------------------------------------------------------ Private data
59 vCardProperty* postOfficeAddress;
60 vCardProperty* roomNumber;
61 vCardProperty* street;
64 vCardProperty* postalCode;
65 vCardProperty* country;
69 * Sets the given property address to a clone of the given property. If
70 * oldProperty is not null the pointed object is deleted.
72 * @param oldProperty Property** to the address of the property to set
73 * @param newProperty the new property to set
75 void set(vCardProperty** oldProperty, vCardProperty& newProperty);
77 // -------------------------------------------- Constructors and Destructors
80 * Creates an empty address
85 // ---------------------------------------------------------- Public methods
88 * Returns the post office of this address
90 * @return the post office of this address or NULL if not defined
92 vCardProperty* getPostOfficeAddress ();
95 * Sets the address post office. The given property is cloned, so that the
96 * caller can independently release it as needed.
98 void setPostOfficeAddress(vCardProperty& p);
101 * Returns the address room number of this address
103 * @return the room number of this address or NULL if not defined
105 vCardProperty* getRoomNumber () ;
108 * Sets the address room number. The given property is cloned, so that the
109 * caller can independently release it as needed.
111 void setRoomNumber(vCardProperty& p);
114 * Returns the street of this address
116 * @return the street of this address or NULL if not defined
118 vCardProperty* getStreet () ;
121 * Sets the address street. The given property is cloned, so that the
122 * caller can independently release it as needed.
124 void setStreet(vCardProperty& p);
127 * Returns the city of this address
129 * @return the city of this address or NULL if not defined
131 vCardProperty* getCity () ;
134 * Sets the address city. The given property is cloned, so that the
135 * caller can independently release it as needed.
137 void setCity(vCardProperty& p);
140 * Returns the state of this address
142 * @return the state of this address or NULL if not defined
144 vCardProperty* getState () ;
147 * Sets the address state. The given property is cloned, so that the
148 * caller can independently release it as needed.
150 void setState(vCardProperty& p);
153 * Returns the postal code of this address
155 * @return the postal code of this address or NULL if not defined
157 vCardProperty* getPostalCode () ;
160 * Sets the address post office. The given property is cloned, so that the
161 * caller can independently release it as needed.
163 void setPostalCode(vCardProperty& p);
166 * Returns the country of this address
168 * @return the country of this address or NULL if not defined
170 vCardProperty* getCountry () ;
173 * Sets the address country. The given property is cloned, so that the
174 * caller can independently release it as needed.
176 void setCountry(vCardProperty& p);
179 * Returns the label of this address
181 * @return the label of this address or NULL if not defined
183 vCardProperty* getLabel () ;
186 * Sets the address label. The given property is cloned, so that the
187 * caller can independently release it as needed.
189 void setLabel(vCardProperty& p);
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++