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.
18 * @brief This is the header file for the %Email class.
20 * This header file contains the declarations of the %Email class.
22 #ifndef _FSCL_EMAIL_H_
23 #define _FSCL_EMAIL_H_
25 #include <FBaseResult.h>
26 #include <FBaseObject.h>
27 #include <FBaseString.h>
28 #include <FSclTypes.h>
30 namespace Tizen { namespace Social
35 * @brief This class represents an email.
39 * @final This class is not intended for extension.
41 * The %Email class represents an email.
42 * An email consists of the email address and email type.
44 * The following example demonstrates how to use the %Email class.
47 using namespace Tizen::Base;
48 using namespace Tizen::Social;
51 MyClass::SomeMethod(void)
55 // Creates an instance of %Email
56 Email email = Email();
58 // Sets the email address
59 r = email.SetEmail(L"hello@Tizen.com");
65 // Sets the email type
66 email.SetType(EMAIL_TYPE_PERSONAL);
72 class _OSP_EXPORT_ Email
73 : public Tizen::Base::Object
77 * This is the default constructor for this class.
84 * Initializes this instance of %Email with the specified @c type and @c email. @n
85 * This constructs an instance of %Email with the specified @c type.
89 * @param[in] type The type of email
90 * @param[in] email The email address
92 Email(EmailType type, const Tizen::Base::String& email);
95 * Copying of objects using this copy constructor is allowed.
99 * @param[in] rhs An instance of %Email to copy
101 Email(const Email& rhs);
104 * This destructor overrides Tizen::Base::Object::~Object().
108 virtual ~Email(void);
111 * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
115 * @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
117 * @param[in] rhs An instance of Tizen::Base::Object to compare
119 virtual bool Equals(const Tizen::Base::Object& rhs) const;
122 * Gets the hash value of the current instance of Tizen::Base::Object.
126 * @return The integer value that indicates the hash value of the current instance of Tizen::Base::Object
128 virtual int GetHashCode(void) const;
131 * Gets the type of the email.
134 * @brief <i> [Compatibility] </i>
138 * @compatibility This method has compatibility issues with OSP compatible applications. @n
139 * For more information, see @ref CompEmailGetTypePage "here".
142 * @return The type of the email
144 EmailType GetType(void) const;
148 * @page CompEmailGetTypePage Compatibility for GetType()
149 * @section CompEmailGetTypePageIssueSection Issues
150 * Implementing this method in OSP compatible applications has the following issue: @n
151 * -# EMAIL_TYPE_CUSTOM is not supported. If the type of the email is EMAIL_TYPE_CUSTOM, EMAIL_TYPE_OTHER is returned instead.
153 * @section CompEmailGetTypePageSolutionSection Resolutions
154 * The issue mentioned above has been resolved in Tizen.
159 * Gets the email address.
163 * @return The email address
165 Tizen::Base::String GetEmail(void) const;
168 * Sets the type of the email.
172 * @param[in] type The type of the email to set
174 void SetType(EmailType type);
177 * Sets the email address.
180 * @brief <i> [Compatibility] </i>
184 * @compatibility This method has compatibility issues with OSP compatible applications. @n
185 * For more information, see @ref CompEmailSetEmailPage "here".
188 * @return An error code
189 * @param[in] email The email address
190 * @exception E_SUCCESS The method is successful.
191 * @exception E_INVALID_ARG The specified @c email address is an empty string.
193 result SetEmail(const Tizen::Base::String& email);
197 * @page CompEmailSetEmailPage Compatibility for SetEmail()
198 * @section CompEmailSetEmailPageIssueSection Issues
199 * Implementing this method in OSP compatible applications has the following issue: @n
200 * -# If the length of an email address to be set is greater than 100 characters, E_INVALID_ARG is returned.
202 * @section CompEmailSetEmailPageSolutionSection Resolutions
203 * The issue mentioned above has been resolved in Tizen.
208 * Gets the label of an email.
212 * @return The email label
215 Tizen::Base::String GetLabel(void) const;
218 * Sets the label of an email.
222 * @param[in] label The email label
225 void SetLabel(const Tizen::Base::String& label);
228 * Copying of objects using this copy assignment operator is allowed.
232 * @param[in] rhs An instance of %Email to copy
234 Email& operator =(const Email& rhs);
237 * Checks whether the value of the specified instance of %Email is equal to the value of the current instance.
241 * @return @c true if the value of the specified instance of %Email equals the value of the current instance, @n
243 * @param[in] rhs An instance of %Email
245 bool operator ==(const Email& rhs) const;
248 * Checks whether the value of the specified instance of %Email is not equal to the value of the current instance.
252 * @return @c true if the value of the specified instance of %Email is not equal to the value of the current instance, @n
254 * @param[in] rhs An instance of %Email
256 bool operator !=(const Email& rhs) const;
259 friend class _EmailImpl;
260 class _EmailImpl* __pEmailImpl;
266 #endif // _FSCL_EMAIL_H_