1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/**
* @file FSclPhoneNumber.h
* @brief This is the header file for the %PhoneNumber class.
*
* This header file contains the declarations of the %PhoneNumber class.
*/
#ifndef _FSCL_PHONE_NUMBER_H_
#define _FSCL_PHONE_NUMBER_H_
#include <FBaseResult.h>
#include <FBaseObject.h>
#include <FSclTypes.h>
namespace Tizen { namespace Social
{
/**
* @class PhoneNumber
* @brief This class stores the information of a phone number.
*
* @since 2.0
*
* @final This class is not intended for extension.
*
* The %PhoneNumber class consists of the phone number and phone number type.
*
* The following example demonstrates how to use the %PhoneNumber class.
*
* @code
using namespace Tizen::Base;
using namespace Tizen::Social::Services;
result
MyClass::SomeMethod(void)
{
result r = E_SUCCESS;
// Creates an instance of PhoneNumber
PhoneNumber phoneNumber = PhoneNumber();
// Sets the number
r = phoneNumber.SetPhoneNumber(L"010-111-2222");
if (IsFailed(r))
{
return r;
}
// Sets the type
phoneNumber.SetType(PHONENUMBER_TYPE_MOBILE);
return E_SUCCESS;
}
* @endcode
*/
class _OSP_EXPORT_ PhoneNumber
: public Tizen::Base::Object
{
public:
/**
* This is the default constructor for this class.
*
* @since 2.0
*/
PhoneNumber(void);
/**
* Initializes this instance of %PhoneNumber with the specified type and phone number.
*
* @since 2.0
*
* @param[in] type The type of the phone number
* @param[in] number The phone number
*/
PhoneNumber(PhoneNumberType type, const Tizen::Base::String& number);
/**
* Copying of objects using this copy constructor is allowed.
*
* @since 2.0
*
* @param[in] rhs An instance of %PhoneNumber to copy
*/
PhoneNumber(const PhoneNumber& rhs);
/**
* This destructor overrides Tizen::Base::Object::~Object().
*
* @since 2.0
*/
virtual ~PhoneNumber(void);
/**
* Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
*
* @since 2.0
*
* @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
* else @c false
* @param[in] rhs An instance of Tizen::Base::Object to compare
*/
virtual bool Equals(const Tizen::Base::Object& rhs) const;
/**
* Gets the hash value of the current instance of Tizen::Base::Object.
*
* @since 2.0
*
* @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object
*/
virtual int GetHashCode(void) const;
/**
* Gets the type of the phone number.
*
* @if OSPCOMPAT
* @brief <i> [Compatibility] </i>
* @endif
* @since 2.0
* @if OSPCOMPAT
* @compatibility This method has compatibility issues with OSP compatible applications. @n
* For more information, see @ref CompPhoneNumberGetTypePage "here".
* @endif
*
* @return The type of the phone number
*/
PhoneNumberType GetType(void) const;
/**
* @if OSPCOMPAT
* @page CompPhoneNumberGetTypePage Compatibility for GetType()
* @section CompPhoneNumberGetTypePageIssueSection Issues
* Implementing this method in OSP compatible applications has the following issue: @n
* -# PHONENUMBER_TYPE_CUSTOM is not supported. If the type of the phone number is PHONENUMBER_TYPE_CUSTOM, PHONENUMBER_TYPE_OTHER is returned instead.
*
* @section CompPhoneNumberGetTypePageSolutionSection Resolutions
* The issue mentioned above has been resolved in Tizen.
* @endif
*/
/**
* Gets the phone number.
*
* @since 2.0
*
* @return The phone number
*/
Tizen::Base::String GetPhoneNumber(void) const;
/**
* Sets the type of the phone number.
*
* @since 2.0
*
* @param[in] type The type of the phone number
*/
void SetType(PhoneNumberType type);
/**
* Sets the specified phone number.
*
* @if OSPCOMPAT
* @brief <i> [Compatibility] </i>
* @endif
* @since 2.0
* @if OSPCOMPAT
* @compatibility This method has compatibility issues with OSP compatible applications. @n
* For more information, see @ref CompPhoneNumberSetPhoneNumberPage "here".
* @endif
*
* @return An error code
* @param[in] number The phone number to set
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c number is an empty string.
*/
result SetPhoneNumber(const Tizen::Base::String& number);
/**
* @if OSPCOMPAT
* @page CompPhoneNumberSetPhoneNumberPage Compatibility for SetPhoneNumber()
* @section CompPhoneNumberSetPhoneNumberPageIssueSection Issues
* Implementing this method in OSP compatible applications has the following issue: @n
* -# If the length of the phone number to be set is greater than 50 characters, @c E_INVALID_ARG is returned.
* -# Only alphabets (a~z, A~Z), numbers, plus (+), asterisk (*), pound (#), and comma (,) are allowed.
*
* @section CompPhoneNumberSetPhoneNumberPageSolutionSection Resolutions
* The issue mentioned above has been resolved in Tizen.
* @endif
*/
/**
* Gets the label of a phone number.
*
* @since 2.0
*
* @return The phone number label
* @see SetLabel()
*/
Tizen::Base::String GetLabel(void) const;
/**
* Sets the label of an event.
*
* @since 2.0
*
* @param[in] label The phone number label
* @see GetLabel()
*/
void SetLabel(const Tizen::Base::String& label);
/**
* Copying of objects using this copy assignment operator is allowed.
*
* @since 2.0
*
* @param[in] rhs An instance of %PhoneNumber to copy
*/
PhoneNumber& operator =(const PhoneNumber& rhs);
/**
* Checks whether the data in the specified instance of %PhoneNumber is equal to the data in the current instance.
*
* @since 2.0
*
* @return @c true if the data in the specified instance equals the data in the current instance, @n
* else @c false
* @param[in] rhs An instance of %PhoneNumber
*/
bool operator ==(const PhoneNumber& rhs) const;
/**
* Checks whether the data in the specified instance of %PhoneNumber is not equal to the data in the current instance.
*
* @since 2.0
*
* @return @c true if the data in the specified instance is not equal to the data in the current instance, @n
* else @c false
* @param[in] rhs An instance of %PhoneNumber
*/
bool operator !=(const PhoneNumber& rhs) const;
private:
friend class _PhoneNumberImpl;
class _PhoneNumberImpl * __pPhoneNumberImpl;
}; // PhoneNumber
}} // Tizen::Social
#endif // _FSCL_PHONE_NUMBER_H_
|