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.
17 * @file FSclPhoneNumber.h
18 * @brief This is the header file for the %PhoneNumber class.
20 * This header file contains the declarations of the %PhoneNumber class.
22 #ifndef _FSCL_PHONE_NUMBER_H_
23 #define _FSCL_PHONE_NUMBER_H_
25 #include <FBaseResult.h>
26 #include <FBaseObject.h>
27 #include <FSclTypes.h>
29 namespace Tizen { namespace Social
34 * @brief This class stores the information of a phone number.
38 * @final This class is not intended for extension.
40 * The %PhoneNumber class consists of the phone number and phone number type.
42 * The following example demonstrates how to use the %PhoneNumber class.
45 using namespace Tizen::Base;
46 using namespace Tizen::Social::Services;
49 MyClass::SomeMethod(void)
53 // Creates an instance of PhoneNumber
54 PhoneNumber phoneNumber = PhoneNumber();
57 r = phoneNumber.SetPhoneNumber(L"010-111-2222");
64 phoneNumber.SetType(PHONENUMBER_TYPE_MOBILE);
70 class _OSP_EXPORT_ PhoneNumber
71 : public Tizen::Base::Object
75 * This is the default constructor for this class.
82 * Initializes this instance of %PhoneNumber with the specified type and phone number.
86 * @param[in] type The type of the phone number
87 * @param[in] number The phone number
89 PhoneNumber(PhoneNumberType type, const Tizen::Base::String& number);
92 * Copying of objects using this copy constructor is allowed.
96 * @param[in] rhs An instance of %PhoneNumber to copy
98 PhoneNumber(const PhoneNumber& rhs);
101 * This destructor overrides Tizen::Base::Object::~Object().
105 virtual ~PhoneNumber(void);
108 * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
112 * @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
114 * @param[in] rhs An instance of Tizen::Base::Object to compare
116 virtual bool Equals(const Tizen::Base::Object& rhs) const;
119 * Gets the hash value of the current instance of Tizen::Base::Object.
123 * @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object
125 virtual int GetHashCode(void) const;
128 * Gets the type of the phone number.
131 * @brief <i> [Compatibility] </i>
135 * @compatibility This method has compatibility issues with OSP compatible applications. @n
136 * For more information, see @ref CompPhoneNumberGetTypePage "here".
139 * @return The type of the phone number
141 PhoneNumberType GetType(void) const;
145 * @page CompPhoneNumberGetTypePage Compatibility for GetType()
146 * @section CompPhoneNumberGetTypePageIssueSection Issues
147 * Implementing this method in OSP compatible applications has the following issue: @n
148 * -# PHONENUMBER_TYPE_CUSTOM is not supported. If the type of the phone number is PHONENUMBER_TYPE_CUSTOM, PHONENUMBER_TYPE_OTHER is returned instead.
150 * @section CompPhoneNumberGetTypePageSolutionSection Resolutions
151 * The issue mentioned above has been resolved in Tizen.
156 * Gets the phone number.
160 * @return The phone number
162 Tizen::Base::String GetPhoneNumber(void) const;
165 * Sets the type of the phone number.
169 * @param[in] type The type of the phone number
171 void SetType(PhoneNumberType type);
174 * Sets the specified phone number.
177 * @brief <i> [Compatibility] </i>
181 * @compatibility This method has compatibility issues with OSP compatible applications. @n
182 * For more information, see @ref CompPhoneNumberSetPhoneNumberPage "here".
185 * @return An error code
186 * @param[in] number The phone number to set
187 * @exception E_SUCCESS The method is successful.
188 * @exception E_INVALID_ARG The specified @c number is an empty string.
190 result SetPhoneNumber(const Tizen::Base::String& number);
194 * @page CompPhoneNumberSetPhoneNumberPage Compatibility for SetPhoneNumber()
195 * @section CompPhoneNumberSetPhoneNumberPageIssueSection Issues
196 * Implementing this method in OSP compatible applications has the following issue: @n
197 * -# If the length of the phone number to be set is greater than 50 characters, @c E_INVALID_ARG is returned.
198 * -# Only alphabets (a~z, A~Z), numbers, plus (+), asterisk (*), pound (#), and comma (,) are allowed.
200 * @section CompPhoneNumberSetPhoneNumberPageSolutionSection Resolutions
201 * The issue mentioned above has been resolved in Tizen.
206 * Gets the label of a phone number.
210 * @return The phone number label
213 Tizen::Base::String GetLabel(void) const;
216 * Sets the label of an event.
220 * @param[in] label The phone number label
223 void SetLabel(const Tizen::Base::String& label);
226 * Copying of objects using this copy assignment operator is allowed.
230 * @param[in] rhs An instance of %PhoneNumber to copy
232 PhoneNumber& operator =(const PhoneNumber& rhs);
235 * Checks whether the data in the specified instance of %PhoneNumber is equal to the data in the current instance.
239 * @return @c true if the data in the specified instance equals the data in the current instance, @n
241 * @param[in] rhs An instance of %PhoneNumber
243 bool operator ==(const PhoneNumber& rhs) const;
246 * Checks whether the data in the specified instance of %PhoneNumber is not equal to the data in the current instance.
250 * @return @c true if the data in the specified instance is not equal to the data in the current instance, @n
252 * @param[in] rhs An instance of %PhoneNumber
254 bool operator !=(const PhoneNumber& rhs) const;
257 friend class _PhoneNumberImpl;
258 class _PhoneNumberImpl * __pPhoneNumberImpl;
264 #endif // _FSCL_PHONE_NUMBER_H_