Apply addressbook API doxygen review
[framework/osp/social.git] / inc / FSclEmail.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 /**
18 * @file         FSclEmail.h
19 * @brief        This is the header file for the %Email class.
20 *
21 * This header file contains the declarations of the %Email class.
22 */
23 #ifndef _FSCL_EMAIL_H_
24 #define _FSCL_EMAIL_H_
25
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FSclTypes.h>
30
31 namespace Tizen { namespace Social
32 {
33
34 /**
35 * @class        Email
36 * @brief        This class represents an email.
37 *
38 * @since        2.0
39 *
40 * @final        This class is not intended for extension.
41 *
42 * The %Email class represents an email.
43 * An email consists of the email address and email type.
44 *
45 * The following example demonstrates how to use the %Email class.
46 *
47 * @code
48 using namespace Tizen::Base;
49 using namespace Tizen::Social;
50
51 void
52 MyClass::SomeMethod(void)
53 {
54         result r = E_SUCCESS;
55
56         // Creates an instance of %Email
57         Email email = Email();
58
59         // Sets the email address
60         r = email.SetEmail(L"hello@Tizen.com");
61         if (IsFailed(r))
62         {
63                 return r;
64         }
65
66         // Sets the email type
67         email.SetType(EMAIL_TYPE_PERSONAL);
68
69         return E_SUCCESS;
70 }
71 * @endcode
72 */
73 class _OSP_EXPORT_ Email
74         : public Tizen::Base::Object
75 {
76 public:
77         /**
78          * This is the default constructor for this class.
79          *
80          * @since       2.0
81          */
82         Email(void);
83
84         /**
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.
87          *
88          * @since       2.0
89          *
90          * @param[in]   type            The type of email
91          * @param[in]   email           The email address
92          */
93         Email(EmailType type, const Tizen::Base::String& email);
94
95         /**
96          * Copying of objects using this copy constructor is allowed.
97          *
98          * @since       2.0
99          *
100          * @param[in]   rhs     An instance of %Email
101          */
102         Email(const Email& rhs);
103
104         /**
105          * This destructor overrides Tizen::Base::Object::~Object().
106          *
107          * @since       2.0
108          */
109         virtual ~Email(void);
110
111         /**
112          * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
113          *
114          * @since       2.0
115          *
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
117          *                      else @c false
118          * @param[in]   rhs             An instance of Tizen::Base::Object to compare
119          */
120         virtual bool Equals(const Tizen::Base::Object& rhs) const;
121
122         /**
123          * Gets the hash value of the current instance of Tizen::Base::Object.
124          *
125          * @since       2.0
126          *
127          * @return      An integer value indicating the hash value of the current instance of Tizen::Base::Object
128          */
129         virtual int GetHashCode(void) const;
130
131         /**
132      * Gets the type of the email.
133      *
134          * @if OSPCOMPAT
135      * @brief <i> [Compatibility] </i>
136          * @endif
137      * @since   2.0
138          * @if OSPCOMPAT
139          * @compatibility            This method has compatibility issues with OSP compatible applications. @n
140      *                           For more information, see @ref CompEmailGetTypePage "here".
141          * @endif
142      *
143      * @return  The type of the email
144      */
145         EmailType GetType(void) const;
146
147         /**
148          * @if OSPCOMPAT
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.
153      *
154      * @section             CompEmailGetTypePageSolutionSection          Resolutions
155          * The issue mentioned above has been resolved in Tizen.
156          * @endif
157      */
158
159         /**
160          * Gets the email address.
161          *
162          * @since       2.0
163          *
164          * @return      The email address
165          */
166         Tizen::Base::String GetEmail(void) const;
167
168         /**
169          * Sets the type of the email.
170          *
171          * @since       2.0
172          *
173          * @param[in]   type            The type of the email to set
174          */
175         void SetType(EmailType type);
176
177         /**
178          * Sets the email address.
179          *
180          * @if OSPCOMPAT
181          * @brief <i> [Compatibility] </i>
182          * @endif
183          * @since       2.0
184          * @if OSPCOMPAT
185          * @compatibility            This method has compatibility issues with OSP compatible applications. @n
186          *                            For more information, see @ref CompEmailSetEmailPage "here".
187          * @endif
188          *
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.
193          */
194         result SetEmail(const Tizen::Base::String& email);
195
196         /**
197          * @if OSPCOMPAT
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.
202          *
203          * @section             CompEmailSetEmailPageSolutionSection            Resolutions
204          * The issue mentioned above has been resolved in Tizen.
205          * @endif
206          */
207
208         /**
209          * Gets the label of an email.
210          *
211          * @since       2.0
212          *
213          * @return      The email label
214          * @see SetLabel()
215          */
216         Tizen::Base::String GetLabel(void) const;
217
218         /**
219          * Sets the label of an email.
220          *
221          * @since       2.0
222          *
223          * @param[in]   label   The email label
224          * @see GetLabel()
225          */
226         void SetLabel(const Tizen::Base::String& label);
227
228         /**
229          * Copying of objects using this copy assignment operator is allowed.
230          *
231          * @since       2.0
232          *
233          * @param[in]   rhs     An instance of %Email
234          */
235         Email& operator =(const Email& rhs);
236
237         /**
238          * Checks whether the value of the specified instance of %Email is equal to the value of the current instance.
239          *
240          * @since       2.0
241          *
242          * @return              @c true if the value of the specified instance of %Email equals the value of the current instance, @n
243          *                              else @c false
244          * @param[in]   rhs             An instance of %Email
245          */
246         bool operator ==(const Email& rhs) const;
247
248         /**
249          * Checks whether the value of the specified instance of %Email does not equal the value of the current instance.
250          *
251          * @since       2.0
252          *
253          * @return              @c true if the value of the specified instance of %Email does not equal the value of the current instance, @n
254          *                              else @c false
255          * @param[in]   rhs             An instance of %Email
256          */
257         bool operator !=(const Email& rhs) const;
258
259 private:
260         friend class _EmailImpl;
261         class _EmailImpl* __pEmailImpl;
262
263 }; // Email
264
265 }} // Tizen::Social
266
267 #endif // _FSCL_EMAIL_H_