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.
292 result SetExtended(const Tizen::Base::String& extended);
296 * @page CompAddressSetExtendedPage Compatibility for SetExtended()
297 * @section CompAddressSetExtendedPageIssueSection Issues
298 * Implementing this method in OSP compatible applications has the following issue: @n
299 * -# If the length of the extended address to be set is greater than @c 50 characters, E_INVALID_ARG is returned.
301 * @section CompAddressSetExtendedPageSolutionSection Resolutions
302 * The issue mentioned above has been resolved in Tizen.
307 * Sets the street of the address.
310 * @brief <i> [Compatibility] </i>
314 * @compatibility This method has compatibility issues with OSP compatible applications. @n
315 * For more information, see @ref CompAddressSetStreetPage "here".
318 * @return An error code
319 * @param[in] street The new street value to set
320 * @exception E_SUCCESS The method is successful.
322 result SetStreet(const Tizen::Base::String& street);
326 * @page CompAddressSetStreetPage Compatibility for SetStreet()
327 * @section CompAddressSetStreetPageIssueSection Issues
328 * Implementing this method in OSP compatible applications has the following issue: @n
329 * -# If the length of the street to be set is greater than @c 50 characters, E_INVALID_ARG is returned.
331 * @section CompAddressSetStreetPageSolutionSection Resolutions
332 * The issue mentioned above has been resolved in Tizen.
337 * Sets the city of the address.
340 * @brief <i> [Compatibility] </i>
344 * @compatibility This method has compatibility issues with OSP compatible applications. @n
345 * For more information, see @ref CompAddressSetCityPage "here".
348 * @return An error code
349 * @param[in] city The new city value to set
350 * @exception E_SUCCESS The method is successful.
352 result SetCity(const Tizen::Base::String& city);
356 * @page CompAddressSetCityPage Compatibility for SetCity()
357 * @section CompAddressSetCityPageIssueSection Issues
358 * Implementing this method in OSP compatible applications has the following issue: @n
359 * -# If the length of the city to be set is greater than @c 50 characters, E_INVALID_ARG is returned.
361 * @section CompAddressSetCityPageSolutionSection Resolutions
362 * The issue mentioned above has been resolved in Tizen.
367 * Sets the state of the address.
370 * @brief <i> [Compatibility] </i>
374 * @compatibility This method has compatibility issues with OSP compatible applications. @n
375 * For more information, see @ref CompAddressSetStatePage "here".
378 * @return An error code
379 * @param[in] state The new state value to set
380 * @exception E_SUCCESS The method is successful.
382 result SetState(const Tizen::Base::String& state);
386 * @page CompAddressSetStatePage Compatibility for SetState()
387 * @section CompAddressSetStatePageIssueSection Issues
388 * Implementing this method in OSP compatible applications has the following issue: @n
389 * -# If the length of the state to be set is greater than @c 50 characters, E_INVALID_ARG is returned.
391 * @section CompAddressSetStatePageSolutionSection Resolutions
392 * The issue mentioned above has been resolved in Tizen.
397 * Sets the postal code of the address.
400 * @brief <i> [Compatibility] </i>
405 * @compatibility This method has compatibility issues with OSP compatible applications. @n
406 * For more information, see @ref CompAddressSetPostalCodePage "here".
409 * @return An error code
410 * @param[in] postalCode The new postal code value to set
411 * @exception E_SUCCESS The method is successful.
413 result SetPostalCode(const Tizen::Base::String& postalCode);
417 * @page CompAddressSetPostalCodePage Compatibility for SetPostalCode()
418 * @section CompAddressSetPostalCodePageIssueSection Issues
419 * Implementing this method in OSP compatible applications has the following issue: @n
420 * -# If the length of the postal code to be set is greater than @c 20 characters, E_INVALID_ARG is returned.
422 * @section CompAddressSetPostalCodePageSolutionSection Resolutions
423 * The issue mentioned above has been resolved in Tizen.
428 * Sets the country of the address.
431 * @brief <i> [Compatibility] </i>
436 * @compatibility This method has compatibility issues with OSP compatible applications. @n
437 * For more information, see @ref CompAddressSetCountryCodePage "here".
440 * @return An error code
441 * @param[in] country The new country value to set
442 * @exception E_SUCCESS The method is successful.
444 result SetCountry(const Tizen::Base::String& country);
448 * @page CompAddressSetCountryCodePage Compatibility for SetCountry()
449 * @section CompAddressSetCountryCodePageIssueSection Issues
450 * Implementing this method in OSP compatible applications has the following issue: @n
451 * -# If the length of the country to be set is greater than @c 20 characters, E_INVALID_ARG is returned.
453 * @section CompAddressSetCountryCodePageSolutionSection Resolutions
454 * The issue mentioned above has been resolved in Tizen.
459 * Sets the post office box number of the address.
462 * @brief <i> [Compatibility] </i>
466 * @compatibility This method has compatibility issues with OSP compatible applications. @n
467 * For more information, see @ref CompAddressSetPostOfficeBoxNumberPage "here".
470 * @return An error code
471 * @param[in] postOfficeBoxNumber The new post office box number value to set
472 * @exception E_SUCCESS The method is successful.
474 result SetPostOfficeBoxNumber(const Tizen::Base::String& postOfficeBoxNumber);
478 * @page CompAddressSetPostOfficeBoxNumberPage Compatibility for SetPostOfficeBoxNumber()
479 * @section CompAddressSetPostOfficeBoxNumberPageIssueSection Issues
480 * Implementing this method in OSP compatible applications has the following issue: @n
481 * -# If the length of the post office box number to be set is greater than @c 20 characters, E_INVALID_ARG is returned.
483 * @section CompAddressSetPostOfficeBoxNumberPageSolutionSection Resolutions
484 * The issue mentioned above has been resolved in Tizen.
489 * Gets the label of an address.
493 * @return The address label
496 Tizen::Base::String GetLabel(void) const;
499 * Sets the label of an address.
503 * @param[in] label The address label
506 void SetLabel(const Tizen::Base::String& label);
509 * Copying of objects using this copy assignment operator is allowed.
513 * @param[in] rhs An instance of %Address
515 Address& operator =(const Address& rhs);
518 * Compares the specified instance of %Address with the calling instance.
522 * @return @c true if the data of the specified instance is equal to the data of the current instance, @n
524 * @param[in] rhs The source data
526 bool operator ==(const Address& rhs) const;
529 * Compares the specified instance to the calling instance for inequality.
533 * @return @c true if the data of the specified instance is not equal to the data of the current instance, @n
535 * @param[in] rhs The source data
537 bool operator !=(const Address& rhs) const;
540 friend class _AddressImpl;
541 class _AddressImpl* __pAddressImpl;
546 #endif //_FSCL_ADDRESS_H_