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.
18 * @file FSclPhoneNumber.h
19 * @brief This is the header file for the %PhoneNumber class.
21 * This header file contains the declarations of the %PhoneNumber class.
23 #ifndef _FSCL_PHONE_NUMBER_H_
24 #define _FSCL_PHONE_NUMBER_H_
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FSclTypes.h>
30 namespace Tizen { namespace Social
35 * @brief This class stores the information of a phone number.
39 * @final This class is not intended for extension.
41 * The %PhoneNumber class consists of the phone number and phone number type.
43 * The following example demonstrates how to use the %PhoneNumber class.
46 using namespace Tizen::Base;
47 using namespace Tizen::Social::Services;
50 MyClass::SomeMethod(void)
54 // Creates an instance of PhoneNumber
55 PhoneNumber phoneNumber = PhoneNumber();
58 r = phoneNumber.SetPhoneNumber(L"010-111-2222");
65 phoneNumber.SetType(PHONENUMBER_TYPE_MOBILE);
71 class _OSP_EXPORT_ PhoneNumber
72 : public Tizen::Base::Object
76 * This is the default constructor for this class.
83 * Initializes this instance of %PhoneNumber with the specified type and phone number.
87 * @param[in] type The type of the phone number
88 * @param[in] number The phone number
90 PhoneNumber(PhoneNumberType type, const Tizen::Base::String& number);
93 * Copying of objects using this copy constructor is allowed.
97 * @param[in] rhs An instance of %PhoneNumber
99 PhoneNumber(const PhoneNumber& rhs);
102 * This destructor overrides Tizen::Base::Object::~Object().
106 virtual ~PhoneNumber(void);
109 * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
113 * @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
115 * @param[in] rhs An instance of Tizen::Base::Object to compare
117 virtual bool Equals(const Tizen::Base::Object& rhs) const;
120 * Gets the hash value of the current instance of Tizen::Base::Object.
124 * @return An integer value indicating the hash value of the current instance of Tizen::Base::Object
126 virtual int GetHashCode(void) const;
129 * Gets the type of the phone number.
132 * @brief <i> [Compatibility] </i>
136 * @compatibility This method has compatibility issues with OSP compatible applications. @n
137 * For more information, see @ref CompPhoneNumberGetTypePage "here".
140 * @return The type of the phone number
142 PhoneNumberType GetType(void) const;
146 * @page CompPhoneNumberGetTypePage Compatibility for GetType()
147 * @section CompPhoneNumberGetTypePageIssueSection Issues
148 * Implementing this method in OSP compatible applications has the following issue: @n
149 * -# PHONENUMBER_TYPE_CUSTOM is not supported. If the type of the phone number is PHONENUMBER_TYPE_CUSTOM, PHONENUMBER_TYPE_OTHER is returned instead.
151 * @section CompPhoneNumberGetTypePageSolutionSection Resolutions
152 * The issue mentioned above has been resolved in Tizen.
157 * Gets the phone number.
161 * @return The phone number
163 Tizen::Base::String GetPhoneNumber(void) const;
166 * Sets the type of the phone number.
170 * @param[in] type The type of the phone number
172 void SetType(PhoneNumberType type);
175 * Sets the specified phone number.
178 * @brief <i> [Compatibility] </i>
182 * @compatibility This method has compatibility issues with OSP compatible applications. @n
183 * For more information, see @ref CompPhoneNumberSetPhoneNumberPage "here".
186 * @return An error code
187 * @param[in] number The phone number to set
188 * @exception E_SUCCESS The method is successful.
189 * @exception E_INVALID_ARG The specified number is an empty string.
191 result SetPhoneNumber(const Tizen::Base::String& number);
195 * @page CompPhoneNumberSetPhoneNumberPage Compatibility for SetPhoneNumber()
196 * @section CompPhoneNumberSetPhoneNumberPageIssueSection Issues
197 * Implementing this method in OSP compatible applications has the following issue: @n
198 * -# If the length of the phone number to be set is greater than 50 characters, E_INVALID_ARG is returned.
199 * -# Only alphabets (a~z, A~Z), numbers, plus (+), asterisk (*), pound (#), and comma (,) are allowed.
201 * @section CompPhoneNumberSetPhoneNumberPageSolutionSection Resolutions
202 * The issue mentioned above has been resolved in Tizen.
207 * Gets the label of a phone number.
211 * @return The phone number label
214 Tizen::Base::String GetLabel(void) const;
217 * Sets the label of an event.
221 * @param[in] label The phone number label
224 void SetLabel(const Tizen::Base::String& label);
227 * Copying of objects using this copy assignment operator is allowed.
231 * @param[in] rhs An instance of %PhoneNumber
233 PhoneNumber& operator =(const PhoneNumber& rhs);
236 * Checks whether the data in the specified instance of %PhoneNumber is equal to the data in the current instance.
240 * @return @c true if the data in the specified instance equals the data in the current instance, @n
242 * @param[in] rhs An instance of %PhoneNumber
244 bool operator ==(const PhoneNumber& rhs) const;
247 * Checks whether the data in the specified instance of %PhoneNumber is not equal to the data in the current instance.
251 * @return @c true if the data in the specified instance is not equal to the data in the current instance, @n
253 * @param[in] rhs An instance of %PhoneNumber
255 bool operator !=(const PhoneNumber& rhs) const;
258 friend class _PhoneNumberImpl;
259 class _PhoneNumberImpl * __pPhoneNumberImpl;
265 #endif // _FSCL_PHONE_NUMBER_H_