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.
19 * @brief This is the header file for the %Email class.
21 * This header file contains the declarations of the %Email class.
23 #ifndef _FSCL_EMAIL_H_
24 #define _FSCL_EMAIL_H_
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FSclTypes.h>
31 namespace Tizen { namespace Social
36 * @brief This class represents an email.
40 * @final This class is not intended for extension.
42 * The %Email class represents an email.
43 * An email consists of the email address and email type.
45 * The following example demonstrates how to use the %Email class.
48 using namespace Tizen::Base;
49 using namespace Tizen::Social;
52 MyClass::SomeMethod(void)
56 // Creates an instance of %Email
57 Email email = Email();
59 // Sets the email address
60 r = email.SetEmail(L"hello@Tizen.com");
66 // Sets the email type
67 email.SetType(EMAIL_TYPE_PERSONAL);
73 class _OSP_EXPORT_ Email
74 : public Tizen::Base::Object
78 * This is the default constructor for this class.
85 * Initializes this instance of %Email with the specified @c type and @c email. @n
86 * This constructs an instance of %Email of the specified @c type.
90 * @param[in] type The type of email
91 * @param[in] email The email address
93 Email(EmailType type, const Tizen::Base::String& email);
96 * Copying of objects using this copy constructor is allowed.
100 * @param[in] rhs An instance of %Email
102 Email(const Email& rhs);
105 * This destructor overrides Tizen::Base::Object::~Object().
109 virtual ~Email(void);
112 * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
116 * @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
118 * @param[in] rhs An instance of Tizen::Base::Object to compare
120 virtual bool Equals(const Tizen::Base::Object& rhs) const;
123 * Gets the hash value of the current instance of Tizen::Base::Object.
127 * @return An integer value indicating the hash value of the current instance of Tizen::Base::Object
129 virtual int GetHashCode(void) const;
132 * Gets the type of the email.
135 * @brief <i> [Compatibility] </i>
139 * @compatibility This method has compatibility issues with OSP compatible applications. @n
140 * For more information, see @ref CompEmailGetTypePage "here".
143 * @return The type of the email
145 EmailType GetType(void) const;
149 * @page CompEmailGetTypePage Compatibility for GetType()
150 * @section CompEmailGetTypePageIssueSection Issues
151 * Implementing this method in OSP compatible applications has the following issue: @n
152 * -# EMAIL_TYPE_CUSTOM is not supported. If the type of the email is EMAIL_TYPE_CUSTOM, EMAIL_TYPE_OTHER is returned instead.
154 * @section CompEmailGetTypePageSolutionSection Resolutions
155 * The issue mentioned above has been resolved in Tizen.
160 * Gets the email address.
164 * @return The email address
166 Tizen::Base::String GetEmail(void) const;
169 * Sets the type of the email.
173 * @param[in] type The type of the email to set
175 void SetType(EmailType type);
178 * Sets the email address.
181 * @brief <i> [Compatibility] </i>
185 * @compatibility This method has compatibility issues with OSP compatible applications. @n
186 * For more information, see @ref CompEmailSetEmailPage "here".
189 * @return An error code
190 * @param[in] email The email address
191 * @exception E_SUCCESS The method is successful.
192 * @exception E_INVALID_ARG The specified @c email address is an empty string.
194 result SetEmail(const Tizen::Base::String& email);
198 * @page CompEmailSetEmailPage Compatibility for SetEmail()
199 * @section CompEmailSetEmailPageIssueSection Issues
200 * Implementing this method in OSP compatible applications has the following issue: @n
201 * -# If the length of an email address to be set is greater than 100 characters, E_INVALID_ARG is returned.
203 * @section CompEmailSetEmailPageSolutionSection Resolutions
204 * The issue mentioned above has been resolved in Tizen.
209 * Gets the label of an email.
213 * @return The email label
216 Tizen::Base::String GetLabel(void) const;
219 * Sets the label of an email.
223 * @param[in] label The email label
226 void SetLabel(const Tizen::Base::String& label);
229 * Copying of objects using this copy assignment operator is allowed.
233 * @param[in] rhs An instance of %Email
235 Email& operator =(const Email& rhs);
238 * Checks whether the value of the specified instance of %Email is equal to the value of the current instance.
242 * @return @c true if the value of the specified instance of %Email equals the value of the current instance, @n
244 * @param[in] rhs An instance of %Email
246 bool operator ==(const Email& rhs) const;
249 * Checks whether the value of the specified instance of %Email does not equal the value of the current instance.
253 * @return @c true if the value of the specified instance of %Email does not equal the value of the current instance, @n
255 * @param[in] rhs An instance of %Email
257 bool operator !=(const Email& rhs) const;
260 friend class _EmailImpl;
261 class _EmailImpl* __pEmailImpl;
267 #endif // _FSCL_EMAIL_H_