2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @brief This is the header file for the %Address class.
21 * This header file contains the declarations of the %Address class.
23 #ifndef _FSCL_ADDRESS_H_
24 #define _FSCL_ADDRESS_H_
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FSclTypes.h>
31 namespace Tizen { namespace Social
36 * The maximum length of the extended field.
38 * @brief <i> [Deprecated] </i>
39 * @deprecated This constant is deprecated because there is no limitation any more.
43 static const int MAX_ADDR_EXTENDED_LENGTH = 50;
47 * The maximum length of the street field.
49 * @brief <i> [Deprecated] </i>
50 * @deprecated This constant is deprecated because there is no limitation any more.
54 static const int MAX_ADDR_STREET_LENGTH = 50;
58 * The maximum length of the city field.
60 * @brief <i> [Deprecated] </i>
61 * @deprecated This constant is deprecated because there is no limitation any more.
65 static const int MAX_ADDR_CITY_LENGTH = 50;
69 * The maximum length of the state field.
71 * @brief <i> [Deprecated] </i>
72 * @deprecated This constant is deprecated because there is no limitation any more.
76 static const int MAX_ADDR_STATE_LENGTH = 50;
80 * The maximum length of the postal code field.
82 * @brief <i> [Deprecated] </i>
83 * @deprecated This constant is deprecated because there is no limitation any more.
87 static const int MAX_ADDR_POSTAL_CODE_LENGTH = 20;
91 * The maximum length of the country field.
93 * @brief <i> [Deprecated] </i>
94 * @deprecated This constant is deprecated because the maximum length of the country name has been changed.
98 static const int MAX_ADDR_COUNTRY_LENGTH = 20;
102 * The maximum length of the post office box number field.
104 * @brief <i> [Deprecated] </i>
105 * @deprecated This constant is deprecated because there is no limitation any more.
109 static const int MAX_ADDR_POBOXNUM_LENGTH = 20;
113 * @brief This class represents the structured address type representing the ADR type definition of the vCard.
117 * @final This class is not intended for extension.
119 * The %Address class represents the structured address type representing the ADR type definition of the vCard.
120 * It is based on the MIME directory profile specification (RFC 2426).
121 * The address information consists of country, city, state, street, post office box number, postal code, and the address type.
122 * This class represents the structured address type representing the ADR type definition of the vCard.
123 * It is based on the MIME directory profile specification (RFC 2426).
125 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/social/addressbook_namespace.htm">Addressbook</a>.
127 class _OSP_EXPORT_ Address
128 : public Tizen::Base::Object
132 * This is the default constructor for this class. @n
133 * It creates a fully initialized instance of the %Address class.
140 * Copying of objects using this copy constructor is allowed.
144 * @param[in] rhs An instance of %Address
146 Address(const Address& rhs);
149 * This destructor overrides Tizen::Base::Object::~Object().
153 virtual ~Address(void);
156 * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
160 * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n
162 * @param[in] rhs An instance of Tizen::Base::Object to compare
164 virtual bool Equals(const Tizen::Base::Object& rhs) const;
167 * Gets the hash value of the current instance of Tizen::Base::Object.
171 * @return An integer value indicating the hash value of the current instance of Tizen::Base::Object
173 virtual int GetHashCode(void) const;
176 * Gets the type of the address.
179 * @brief <i> [Compatibility] </i>
183 * @compatibility This method has compatibility issues with OSP compatible applications. @n
184 * For more information, see @ref CompAddressGetTypePage "here".
187 * @return The type of the address
189 AddressType GetType(void) const;
193 * @page CompAddressGetTypePage Compatibility for GetType()
194 * @section CompAddressGetTypePageIssueSection Issues
195 * Implementing this method in OSP compatible applications has the following issue: @n
196 * -# ADDRESS_TYPE_CUSTOM is not supported. If the type of the address is ADDRESS_TYPE_CUSTOM, ADDRESS_TYPE_OTHER is returned instead.
198 * @section CompAddressGetTypePageSolutionSection Resolutions
199 * The issue mentioned above has been resolved in Tizen.
204 * Gets the extended field of the address.
208 * @return The extended field of the address
210 Tizen::Base::String GetExtended(void) const;
213 * Gets the street of the address.
217 * @return The street of the address
219 Tizen::Base::String GetStreet(void) const;
222 * Gets the city of the address.
226 * @return The city of the address
228 Tizen::Base::String GetCity(void) const;
231 * Gets the state of the address.
235 * @return The state of the address
237 Tizen::Base::String GetState(void) const;
240 * Gets the postal code of the address.
244 * @return The postal code of the address
246 Tizen::Base::String GetPostalCode(void) const;
249 * Gets the country of the address.
253 * @return The country of the address
255 Tizen::Base::String GetCountry(void) const;
258 * Gets the post office box number of the address.
262 * @return The post office box number of the address
264 Tizen::Base::String GetPostOfficeBoxNumber(void) const;
267 * Sets the type of the address.
271 * @param[in] type The address type to set
274 void SetType(AddressType type);
277 * Sets the extended field of the address.
280 * @brief <i> [Compatibility] </i>
284 * @compatibility This method has compatibility issues with OSP compatible applications. @n
285 * For more information, see @ref CompAddressSetExtendedPage "here".
288 * @return An error code
289 * @param[in] extended The new extended value to set
290 * @exception E_SUCCESS The method is successful.
291 * @exception E_INVALID_ARG The length of the specified @c extended exceeds #MAX_ADDR_EXTENDED_LENGTH.
293 result SetExtended(const Tizen::Base::String& extended);
297 * @page CompAddressSetExtendedPage Compatibility for SetExtended()
298 * @section CompAddressSetExtendedPageIssueSection Issues
299 * Implementing this method in OSP compatible applications has the following issue: @n
300 * -# If the length of the extended address to be set is greater than @c 50 characters, E_INVALID_ARG is returned.
302 * @section CompAddressSetExtendedPageSolutionSection Resolutions
303 * The issue mentioned above has been resolved in Tizen.
308 * Sets the street of the address.
311 * @brief <i> [Compatibility] </i>
315 * @compatibility This method has compatibility issues with OSP compatible applications. @n
316 * For more information, see @ref CompAddressSetStreetPage "here".
319 * @return An error code
320 * @param[in] street The new street value to set
321 * @exception E_SUCCESS The method is successful.
322 * @exception E_INVALID_ARG The specified @c street is an empty string.
324 result SetStreet(const Tizen::Base::String& street);
328 * @page CompAddressSetStreetPage Compatibility for SetStreet()
329 * @section CompAddressSetStreetPageIssueSection Issues
330 * Implementing this method in OSP compatible applications has the following issue: @n
331 * -# If the length of the street to be set is greater than @c 50 characters, E_INVALID_ARG is returned.
333 * @section CompAddressSetStreetPageSolutionSection Resolutions
334 * The issue mentioned above has been resolved in Tizen.
339 * Sets the city of the address.
342 * @brief <i> [Compatibility] </i>
346 * @compatibility This method has compatibility issues with OSP compatible applications. @n
347 * For more information, see @ref CompAddressSetCityPage "here".
350 * @return An error code
351 * @param[in] city The new city value to set
352 * @exception E_SUCCESS The method is successful.
353 * @exception E_INVALID_ARG The specified @c city is an empty string.
355 result SetCity(const Tizen::Base::String& city);
359 * @page CompAddressSetCityPage Compatibility for SetCity()
360 * @section CompAddressSetCityPageIssueSection Issues
361 * Implementing this method in OSP compatible applications has the following issue: @n
362 * -# If the length of the city to be set is greater than @c 50 characters, E_INVALID_ARG is returned.
364 * @section CompAddressSetCityPageSolutionSection Resolutions
365 * The issue mentioned above has been resolved in Tizen.
370 * Sets the state of the address.
373 * @brief <i> [Compatibility] </i>
377 * @compatibility This method has compatibility issues with OSP compatible applications. @n
378 * For more information, see @ref CompAddressSetStatePage "here".
381 * @return An error code
382 * @param[in] state The new state value to set
383 * @exception E_SUCCESS The method is successful.
384 * @exception E_INVALID_ARG The specified @c state is an empty string.
386 result SetState(const Tizen::Base::String& state);
390 * @page CompAddressSetStatePage Compatibility for SetState()
391 * @section CompAddressSetStatePageIssueSection Issues
392 * Implementing this method in OSP compatible applications has the following issue: @n
393 * -# If the length of the state to be set is greater than @c 50 characters, E_INVALID_ARG is returned.
395 * @section CompAddressSetStatePageSolutionSection Resolutions
396 * The issue mentioned above has been resolved in Tizen.
401 * Sets the postal code of the address.
404 * @brief <i> [Compatibility] </i>
409 * @compatibility This method has compatibility issues with OSP compatible applications. @n
410 * For more information, see @ref CompAddressSetPostalCodePage "here".
413 * @return An error code
414 * @param[in] postalCode The new postal code value to set
415 * @exception E_SUCCESS The method is successful.
416 * @exception E_INVALID_ARG The specified @c postalCode is an empty string.
418 result SetPostalCode(const Tizen::Base::String& postalCode);
422 * @page CompAddressSetPostalCodePage Compatibility for SetPostalCode()
423 * @section CompAddressSetPostalCodePageIssueSection Issues
424 * Implementing this method in OSP compatible applications has the following issue: @n
425 * -# If the length of the postal code to be set is greater than @c 20 characters, E_INVALID_ARG is returned.
427 * @section CompAddressSetPostalCodePageSolutionSection Resolutions
428 * The issue mentioned above has been resolved in Tizen.
433 * Sets the country of the address.
436 * @brief <i> [Compatibility] </i>
441 * @compatibility This method has compatibility issues with OSP compatible applications. @n
442 * For more information, see @ref CompAddressSetCountryCodePage "here".
445 * @return An error code
446 * @param[in] country The new country value to set
447 * @exception E_SUCCESS The method is successful.
448 * @exception E_INVALID_ARG The specified @c country is an empty string.
450 result SetCountry(const Tizen::Base::String& country);
454 * @page CompAddressSetCountryCodePage Compatibility for SetCountry()
455 * @section CompAddressSetCountryCodePageIssueSection Issues
456 * Implementing this method in OSP compatible applications has the following issue: @n
457 * -# If the length of the country to be set is greater than @c 20 characters, E_INVALID_ARG is returned.
459 * @section CompAddressSetCountryCodePageSolutionSection Resolutions
460 * The issue mentioned above has been resolved in Tizen.
465 * Sets the post office box number of the address.
468 * @brief <i> [Compatibility] </i>
472 * @compatibility This method has compatibility issues with OSP compatible applications. @n
473 * For more information, see @ref CompAddressSetPostOfficeBoxNumberPage "here".
476 * @return An error code
477 * @param[in] postOfficeBoxNumber The new post office box number value to set
478 * @exception E_SUCCESS The method is successful.
479 * @exception E_INVALID_ARG The specified @c postOfficeBoxNumber is an empty string.
481 result SetPostOfficeBoxNumber(const Tizen::Base::String& postOfficeBoxNumber);
485 * @page CompAddressSetPostOfficeBoxNumberPage Compatibility for SetPostOfficeBoxNumber()
486 * @section CompAddressSetPostOfficeBoxNumberPageIssueSection Issues
487 * Implementing this method in OSP compatible applications has the following issue: @n
488 * -# If the length of the post office box number to be set is greater than @c 20 characters, E_INVALID_ARG is returned.
490 * @section CompAddressSetPostOfficeBoxNumberPageSolutionSection Resolutions
491 * The issue mentioned above has been resolved in Tizen.
496 * Gets the label of an address.
500 * @return The address label
503 Tizen::Base::String GetLabel(void) const;
506 * Sets the label of an address.
510 * @param[in] label The address label
513 void SetLabel(const Tizen::Base::String& label);
516 * Copying of objects using this copy assignment operator is allowed.
520 * @param[in] rhs An instance of %Address
522 Address& operator =(const Address& rhs);
525 * Compares the specified instance of %Address with the calling instance.
529 * @return @c true if the data of the specified instance is equal to the data of the current instance, @n
531 * @param[in] rhs The source data
533 bool operator ==(const Address& rhs) const;
536 * Compares the specified instance to the calling instance for inequality.
540 * @return @c true if the data of the specified instance is not equal to the data of the current instance, @n
542 * @param[in] rhs The source data
544 bool operator !=(const Address& rhs) const;
547 friend class _AddressImpl;
548 class _AddressImpl* __pAddressImpl;
553 #endif //_FSCL_ADDRESS_H_