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 FSclImAddress.h
18 * @brief This is the header file for the %ImAddress class.
20 * This header file contains the declarations of the %ImAddress class.
22 #ifndef _FSCL_IM_ADDRESS_H_
23 #define _FSCL_IM_ADDRESS_H_
25 #include <FBaseResult.h>
26 #include <FBaseObject.h>
27 #include <FBaseString.h>
29 namespace Tizen { namespace Social
33 * The maximum length of the IM address property.
35 * @brief <i> [Deprecated] </i>
36 * @deprecated This constant is deprecated because there is no limitation any more.
40 static const int MAX_IM_ADDRESS_LENGTH = 100;
44 * The IM service provider name for MSN.
46 * @brief <i> [Deprecated] </i>
47 * @deprecated This object is provided only for backward compatibility and will be deleted in the near future.
48 * Use IM_ADDRESS_MSN instead of this object.
52 _OSP_EXPORT_ extern const Tizen::Base::String IM_MSN;
56 * The IM service provider name for ICQ.
58 * @brief <i> [Deprecated] </i>
59 * @deprecated This object is provided only for backward compatibility and will be deleted in the near future.
60 * Use IM_ADDRESS_ICQ instead of this object.
64 _OSP_EXPORT_ extern const Tizen::Base::String IM_ICQ;
68 * The IM service provider name for AIM.
70 * @brief <i> [Deprecated] </i>
71 * @deprecated This object is provided only for backward compatibility and will be deleted in the near future.
72 * Use IM_ADDRESS_AIM instead of this object.
76 _OSP_EXPORT_ extern const Tizen::Base::String IM_AIM;
80 * The IM service provider name for Yahoo.
82 * @brief <i> [Deprecated] </i>
83 * @deprecated This object is provided only for backward compatibility and will be deleted in the near future.
84 * Use IM_ADDRESS_YAHOO instead of this object.
88 _OSP_EXPORT_ extern const Tizen::Base::String IM_YAHOO;
92 * The IM service provider name for Jabber.
94 * @brief <i> [Deprecated] </i>
95 * @deprecated This object is provided only for backward compatibility and will be deleted in the near future.
96 * Use IM_ADDRESS_JABBER instead of this object.
100 _OSP_EXPORT_ extern const Tizen::Base::String IM_JABBER;
104 * The IM service provider name for Google talk.
106 * @brief <i> [Deprecated] </i>
107 * @deprecated This object is provided only for backward compatibility and will be deleted in the near future.
108 * Use IM_ADDRESS_GTALK instead of this object.
112 _OSP_EXPORT_ extern const Tizen::Base::String IM_GTALK;
116 * The IM service provider name for Skype.
118 * @brief <i> [Deprecated] </i>
119 * @deprecated This object is provided only for backward compatibility and will be deleted in the near future.
120 * Use IM_ADDRESS_SKYPE instead of this object.
124 _OSP_EXPORT_ extern const Tizen::Base::String IM_SKYPE;
128 * The IM service provider name for QQ.
130 * @brief <i> [Deprecated] </i>
131 * @deprecated This object is provided only for backward compatibility and will be deleted in the near future.
132 * Use IM_ADDRESS_QQ instead of this object.
136 _OSP_EXPORT_ extern const Tizen::Base::String IM_QQ;
139 * The IM service provider name for AIM.
143 _OSP_EXPORT_ extern const wchar_t IM_ADDRESS_AIM[];
146 * The IM service provider name for Google talk.
150 _OSP_EXPORT_ extern const wchar_t IM_ADDRESS_GOOGLE_TALK[];
153 * The IM service provider name for ICQ.
157 _OSP_EXPORT_ extern const wchar_t IM_ADDRESS_ICQ[];
160 * The IM service provider name for Jabber.
164 _OSP_EXPORT_ extern const wchar_t IM_ADDRESS_JABBER[];
167 * The IM service provider name for MSN.
171 _OSP_EXPORT_ extern const wchar_t IM_ADDRESS_MSN[];
174 * The IM service provider name for QQ.
178 _OSP_EXPORT_ extern const wchar_t IM_ADDRESS_QQ[];
181 * The IM service provider name for Skype.
185 _OSP_EXPORT_ extern const wchar_t IM_ADDRESS_SKYPE[];
188 * The IM service provider name for Yahoo.
192 _OSP_EXPORT_ extern const wchar_t IM_ADDRESS_YAHOO[];
196 * @brief This class represents the Instant Messenger (IM) addresses.
200 * @final This class is not intended for extension.
202 * The %ImAddress class represents the Instant Messenger (IM) addresses. It consists of an IM service provider name and an account.
204 class _OSP_EXPORT_ ImAddress
205 : public Tizen::Base::Object
209 * This is the default constructor for this class.
216 * Initializes this instance of %ImAddress with the specified parameters. @n
217 * This constructs an instance of %ImAddress with the specified service provider name.
221 * @param[in] serviceProviderName The service provider name of the %ImAddress
222 * @param[in] imAddress The IM address
223 * @see #IM_ADDRESS_AIM
224 * @see #IM_ADDRESS_GOOGLE_TALK
225 * @see #IM_ADDRESS_ICQ
226 * @see #IM_ADDRESS_JABBER
227 * @see #IM_ADDRESS_MSN
228 * @see #IM_ADDRESS_QQ
229 * @see #IM_ADDRESS_SKYPE
230 * @see #IM_ADDRESS_YAHOO
232 ImAddress(const Tizen::Base::String& serviceProviderName, const Tizen::Base::String& imAddress);
235 * Copying of objects using this copy constructor is allowed.
239 * @param[in] rhs An instance of %ImAddress
241 ImAddress(const ImAddress& rhs);
244 * This destructor overrides Tizen::Base::Object::~Object().
248 virtual ~ImAddress(void);
251 * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
255 * @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
257 * @param[in] rhs An instance of Tizen::Base::Object to compare
259 virtual bool Equals(const Tizen::Base::Object& rhs) const;
262 * Gets the hash value of the current instance of Tizen::Base::Object.
266 * @return An integer value indicating the hash value of the current instance of Tizen::Base::Object
268 virtual int GetHashCode(void) const;
271 * Gets the service provider name of the IM address.
275 * @return The service provider name of the IM address
277 Tizen::Base::String GetServiceProviderName(void) const;
280 * Gets the IM address of the current instance of %ImAddress.
284 * @return The IM address
286 Tizen::Base::String GetImAddress(void) const;
289 * Sets the service provider name of the IM address.
293 * @return An error code
294 * @param[in] serviceProviderName The service provider name of the IM address
295 * @see #IM_ADDRESS_AIM
296 * @see #IM_ADDRESS_GOOGLE_TALK
297 * @see #IM_ADDRESS_ICQ
298 * @see #IM_ADDRESS_JABBER
299 * @see #IM_ADDRESS_MSN
300 * @see #IM_ADDRESS_QQ
301 * @see #IM_ADDRESS_SKYPE
302 * @see #IM_ADDRESS_YAHOO
304 void SetServiceProviderName(const Tizen::Base::String& serviceProviderName);
307 * Sets the IM address of the current instance of %ImAddress.
310 * @brief <i> [Compatibility] </i>
314 * @compatibility This method has compatibility issues with OSP compatible applications. @n
315 * For more information, see @ref CompImAddressSetImAddressPage "here".
318 * @return An error code
319 * @param[in] imAddress The IM address
320 * @exception E_SUCCESS The method is successful.
321 * @exception E_INVALID_ARG The specified @c imAddress is an empty string.
323 result SetImAddress(const Tizen::Base::String& imAddress);
327 * @page CompImAddressSetImAddressPage Compatibility for SetImAddress()
328 * @section CompImAddressSetImAddressPageIssueSection Issues
329 * Implementing this method in OSP compatible applications has the following issue: @n
330 * -# If the length of an IM address to be set is greater than 100 characters, E_INVALID_ARG is returned.
332 * @section CompImAddressSetImAddressPageSolutionSection Resolutions
333 * The issue mentioned above has been resolved in Tizen.
338 * Copying of objects using this copy assignment operator is allowed.
342 * @param[in] rhs An instance of %ImAddress
344 ImAddress& operator =(const ImAddress& rhs);
347 * Checks whether the value of the specified instance of %ImAddress is equal to the value of the current instance.
351 * @return @c true if the value of the specified instance of %ImAddress is equal to the value of the current instance, @n
353 * @param[in] rhs An instance of %ImAddress
355 bool operator ==(const ImAddress& rhs) const;
358 * Checks whether the value of the specified instance of %ImAddress does not match the value of the current instance.
362 * @return @c true if the value of the specified instance of %ImAddress is not equal to the value of the current instance, @n
364 * @param[in] rhs An instance of %ImAddress
366 bool operator !=(const ImAddress& rhs) const;
369 friend class _ImAddressImpl;
370 class _ImAddressImpl* __pImAddressImpl;
376 #endif // _FSCL_IM_ADDRESS_H_