2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @brief This is the header file for the %Address class.
20 * This header file contains the declarations of the %Address class.
22 #ifndef _FSCL_ADDRESS_H_
23 #define _FSCL_ADDRESS_H_
25 #include <FBaseResult.h>
26 #include <FBaseObject.h>
27 #include <FBaseString.h>
28 #include <FSclTypes.h>
30 namespace Tizen { namespace Social
35 * The maximum length of the extended field.
37 * @brief <i> [Deprecated] </i>
38 * @deprecated This constant is deprecated because there is no limitation any more.
42 static const int MAX_ADDR_EXTENDED_LENGTH = 50;
46 * The maximum length of the street field.
48 * @brief <i> [Deprecated] </i>
49 * @deprecated This constant is deprecated because there is no limitation any more.
53 static const int MAX_ADDR_STREET_LENGTH = 50;
57 * The maximum length of the city field.
59 * @brief <i> [Deprecated] </i>
60 * @deprecated This constant is deprecated because there is no limitation any more.
64 static const int MAX_ADDR_CITY_LENGTH = 50;
68 * The maximum length of the state field.
70 * @brief <i> [Deprecated] </i>
71 * @deprecated This constant is deprecated because there is no limitation any more.
75 static const int MAX_ADDR_STATE_LENGTH = 50;
79 * The maximum length of the postal code field.
81 * @brief <i> [Deprecated] </i>
82 * @deprecated This constant is deprecated because there is no limitation any more.
86 static const int MAX_ADDR_POSTAL_CODE_LENGTH = 20;
90 * The maximum length of the country field.
92 * @brief <i> [Deprecated] </i>
93 * @deprecated This constant is deprecated because the maximum length of the country name has been changed.
97 static const int MAX_ADDR_COUNTRY_LENGTH = 20;
101 * The maximum length of the post office box number field.
103 * @brief <i> [Deprecated] </i>
104 * @deprecated This constant is deprecated because there is no limitation any more.
108 static const int MAX_ADDR_POBOXNUM_LENGTH = 20;
112 * @brief This class represents the structured address type representing the ADR type definition of a vCard.
116 * @final This class is not intended for extension.
118 * The %Address class represents the structured address type representing the ADR type definition of a vCard.
119 * It is based on the MIME directory profile specification (RFC 2426).
120 * The address information consists of the country, city, state, street, post office box number, postal code, and address type.
121 * This class represents the structured address type representing the ADR type definition of a vCard.
122 * It is based on the MIME directory profile specification (RFC 2426).
124 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/social/addressbook_namespace.htm">Addressbook</a>.
126 class _OSP_EXPORT_ Address
127 : public Tizen::Base::Object
131 * This is the default constructor for this class. @n
132 * It creates a fully initialized instance of the %Address class.
139 * Copying of objects using this copy constructor is allowed.
143 * @param[in] rhs An instance of %Address to copy
145 Address(const Address& rhs);
148 * This destructor overrides Tizen::Base::Object::~Object().
152 virtual ~Address(void);
155 * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
159 * @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
161 * @param[in] rhs An instance of Tizen::Base::Object to compare
163 virtual bool Equals(const Tizen::Base::Object& rhs) const;
166 * Gets the hash value of the current instance of Tizen::Base::Object.
170 * @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object
172 virtual int GetHashCode(void) const;
175 * Gets the type of the address.
178 * @brief <i> [Compatibility] </i>
182 * @compatibility This method has compatibility issues with OSP compatible applications. @n
183 * For more information, see @ref CompAddressGetTypePage "here".
186 * @return The type of the address
188 AddressType GetType(void) const;
192 * @page CompAddressGetTypePage Compatibility for GetType()
193 * @section CompAddressGetTypePageIssueSection Issues
194 * Implementing this method in OSP compatible applications has the following issue: @n
195 * -# @c ADDRESS_TYPE_CUSTOM is not supported. If the type of the address is @c ADDRESS_TYPE_CUSTOM, @c ADDRESS_TYPE_OTHER is returned instead.
197 * @section CompAddressGetTypePageSolutionSection Resolutions
198 * The issue mentioned above has been resolved in Tizen.
203 * Gets the extended field of the address.
207 * @return The extended field of the address
209 Tizen::Base::String GetExtended(void) const;
212 * Gets the street of the address.
216 * @return The street of the address
218 Tizen::Base::String GetStreet(void) const;
221 * Gets the city of the address.
225 * @return The city of the address
227 Tizen::Base::String GetCity(void) const;
230 * Gets the state of the address.
234 * @return The state of the address
236 Tizen::Base::String GetState(void) const;
239 * Gets the postal code of the address.
243 * @return The postal code of the address
245 Tizen::Base::String GetPostalCode(void) const;
248 * Gets the country of the address.
252 * @return The country of the address
254 Tizen::Base::String GetCountry(void) const;
257 * Gets the post office box number of the address.
261 * @return The post office box number of the address
263 Tizen::Base::String GetPostOfficeBoxNumber(void) const;
266 * Sets the type of the address.
270 * @param[in] type The address type to set
273 void SetType(AddressType type);
276 * Sets the extended field of the address.
279 * @brief <i> [Compatibility] </i>
283 * @compatibility This method has compatibility issues with OSP compatible applications. @n
284 * For more information, see @ref CompAddressSetExtendedPage "here".
287 * @return An error code
288 * @param[in] extended The new extended value to set
289 * @exception E_SUCCESS The method is successful.
291 result SetExtended(const Tizen::Base::String& extended);
295 * @page CompAddressSetExtendedPage Compatibility for SetExtended()
296 * @section CompAddressSetExtendedPageIssueSection Issues
297 * Implementing this method in OSP compatible applications has the following issue: @n
298 * -# If the length of the extended address to be set is greater than @c 50 characters, @c E_INVALID_ARG is returned.
300 * @section CompAddressSetExtendedPageSolutionSection Resolutions
301 * The issue mentioned above has been resolved in Tizen.
306 * Sets the street of the address.
309 * @brief <i> [Compatibility] </i>
313 * @compatibility This method has compatibility issues with OSP compatible applications. @n
314 * For more information, see @ref CompAddressSetStreetPage "here".
317 * @return An error code
318 * @param[in] street The new street value to set
319 * @exception E_SUCCESS The method is successful.
321 result SetStreet(const Tizen::Base::String& street);
325 * @page CompAddressSetStreetPage Compatibility for SetStreet()
326 * @section CompAddressSetStreetPageIssueSection Issues
327 * Implementing this method in OSP compatible applications has the following issue: @n
328 * -# If the length of the street to be set is greater than @c 50 characters, @c E_INVALID_ARG is returned.
330 * @section CompAddressSetStreetPageSolutionSection Resolutions
331 * The issue mentioned above has been resolved in Tizen.
336 * Sets the city of the address.
339 * @brief <i> [Compatibility] </i>
343 * @compatibility This method has compatibility issues with OSP compatible applications. @n
344 * For more information, see @ref CompAddressSetCityPage "here".
347 * @return An error code
348 * @param[in] city The new city value to set
349 * @exception E_SUCCESS The method is successful.
351 result SetCity(const Tizen::Base::String& city);
355 * @page CompAddressSetCityPage Compatibility for SetCity()
356 * @section CompAddressSetCityPageIssueSection Issues
357 * Implementing this method in OSP compatible applications has the following issue: @n
358 * -# If the length of the city to be set is greater than @c 50 characters, @c E_INVALID_ARG is returned.
360 * @section CompAddressSetCityPageSolutionSection Resolutions
361 * The issue mentioned above has been resolved in Tizen.
366 * Sets the state of the address.
369 * @brief <i> [Compatibility] </i>
373 * @compatibility This method has compatibility issues with OSP compatible applications. @n
374 * For more information, see @ref CompAddressSetStatePage "here".
377 * @return An error code
378 * @param[in] state The new state value to set
379 * @exception E_SUCCESS The method is successful.
381 result SetState(const Tizen::Base::String& state);
385 * @page CompAddressSetStatePage Compatibility for SetState()
386 * @section CompAddressSetStatePageIssueSection Issues
387 * Implementing this method in OSP compatible applications has the following issue: @n
388 * -# If the length of the state to be set is greater than @c 50 characters, @c E_INVALID_ARG is returned.
390 * @section CompAddressSetStatePageSolutionSection Resolutions
391 * The issue mentioned above has been resolved in Tizen.
396 * Sets the postal code of the address.
399 * @brief <i> [Compatibility] </i>
404 * @compatibility This method has compatibility issues with OSP compatible applications. @n
405 * For more information, see @ref CompAddressSetPostalCodePage "here".
408 * @return An error code
409 * @param[in] postalCode The new postal code value to set
410 * @exception E_SUCCESS The method is successful.
412 result SetPostalCode(const Tizen::Base::String& postalCode);
416 * @page CompAddressSetPostalCodePage Compatibility for SetPostalCode()
417 * @section CompAddressSetPostalCodePageIssueSection Issues
418 * Implementing this method in OSP compatible applications has the following issue: @n
419 * -# If the length of the postal code to be set is greater than @c 20 characters, @c E_INVALID_ARG is returned.
421 * @section CompAddressSetPostalCodePageSolutionSection Resolutions
422 * The issue mentioned above has been resolved in Tizen.
427 * Sets the country of the address.
430 * @brief <i> [Compatibility] </i>
435 * @compatibility This method has compatibility issues with OSP compatible applications. @n
436 * For more information, see @ref CompAddressSetCountryCodePage "here".
439 * @return An error code
440 * @param[in] country The new country value to set
441 * @exception E_SUCCESS The method is successful.
443 result SetCountry(const Tizen::Base::String& country);
447 * @page CompAddressSetCountryCodePage Compatibility for SetCountry()
448 * @section CompAddressSetCountryCodePageIssueSection Issues
449 * Implementing this method in OSP compatible applications has the following issue: @n
450 * -# If the length of the country to be set is greater than @c 20 characters, @c E_INVALID_ARG is returned.
452 * @section CompAddressSetCountryCodePageSolutionSection Resolutions
453 * The issue mentioned above has been resolved in Tizen.
458 * Sets the post office box number of the address.
461 * @brief <i> [Compatibility] </i>
465 * @compatibility This method has compatibility issues with OSP compatible applications. @n
466 * For more information, see @ref CompAddressSetPostOfficeBoxNumberPage "here".
469 * @return An error code
470 * @param[in] postOfficeBoxNumber The new post office box number value to set
471 * @exception E_SUCCESS The method is successful.
473 result SetPostOfficeBoxNumber(const Tizen::Base::String& postOfficeBoxNumber);
477 * @page CompAddressSetPostOfficeBoxNumberPage Compatibility for SetPostOfficeBoxNumber()
478 * @section CompAddressSetPostOfficeBoxNumberPageIssueSection Issues
479 * Implementing this method in OSP compatible applications has the following issue: @n
480 * -# If the length of the post office box number to be set is greater than @c 20 characters, @c E_INVALID_ARG is returned.
482 * @section CompAddressSetPostOfficeBoxNumberPageSolutionSection Resolutions
483 * The issue mentioned above has been resolved in Tizen.
488 * Gets the label of the address.
492 * @return The address label
495 Tizen::Base::String GetLabel(void) const;
498 * Sets the label of the address.
502 * @param[in] label The address label
505 void SetLabel(const Tizen::Base::String& label);
508 * Copying of objects using this copy assignment operator is allowed.
512 * @param[in] rhs An instance of %Address to copy
514 Address& operator =(const Address& rhs);
517 * Compares the specified instance of %Address with the current instance.
521 * @return @c true if the data of the specified instance is equal to the data of the current instance, @n
523 * @param[in] rhs The source data
525 bool operator ==(const Address& rhs) const;
528 * Compares the specified instance to the current instance for inequality.
532 * @return @c true if the data of the specified instance is not equal to the data of the current instance, @n
534 * @param[in] rhs The source data
536 bool operator !=(const Address& rhs) const;
539 friend class _AddressImpl;
540 class _AddressImpl* __pAddressImpl;
545 #endif //_FSCL_ADDRESS_H_