merge with master
[platform/framework/native/messaging.git] / inc / FMsgEmailAttachment.h
1 // 
2 // Open Service Platform
3 // Copyright (c) 2012-2013 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                 FMsgEmailAttachment.h
19 * @brief                This is the header file for the %EmailAttachment class.
20 *
21 * This header file contains the declarations of the %EmailAttachment class.
22 */
23
24 #ifndef _FMSG_EMAIL_ATTACHMENT_H_
25 #define _FMSG_EMAIL_ATTACHMENT_H_
26
27 namespace Tizen { namespace Base
28 {
29 class String;
30 } }
31
32 #include <FBaseObject.h>
33 #include <FMsgTypes.h>
34
35 namespace Tizen { namespace Messaging
36 {
37         // forward declaration
38         class _EmailAttachmentImpl;
39
40         /**
41         * @class        EmailAttachment
42         * @brief        This class provides methods for handling email attachments.
43         *
44         * @since                2.0
45         *
46         * The %EmailAttachment class provides methods for handling email attachments.
47         */
48         class _OSP_EXPORT_ EmailAttachment
49                 : public Tizen::Base::Object
50         {
51                 // Life cycle
52         public:
53                 /**
54                 * This is the default constructor for this class.
55                 *
56                 * @since                2.0
57                 */
58                 EmailAttachment(void);
59
60                 /**
61                 * This is the destructor for this class.
62                 *
63                 * @since                2.0
64                 */
65                 virtual ~EmailAttachment(void);
66
67                 /**
68                 * This is the copy constructor for the %EmailAttachment class. @n
69                 * Copying of objects using this copy constructor is allowed.
70                 *
71                 * @since                2.0
72                 *
73                 * @param[in]    rhs             An instance of %EmailAttachment
74                 */
75                 EmailAttachment(const EmailAttachment& rhs);
76
77         public:
78                 /**
79                 * Assigns the value of the specified instance to the current instance of %EmailAttachment. @n
80                 * Copying of objects using this copy assignment operator is allowed.
81                 *
82                 * @since                2.0
83                 *
84                 * @return               The reference of this instance
85                 * @param[in]    rhs             An instance of %EmailAttachment
86                 */
87                 EmailAttachment& operator =(const EmailAttachment& rhs);
88
89                 /**
90                 * Compares the calling instance with the specified instance.
91                 *
92                 * @since                2.0
93                 *
94                 * @return               @c true if the specified instance of Tizen::Base::Object is equal to the calling %EmailAttachment instance, @n
95                 *                               else @c false
96                 * @param[in]    obj             An instance of Tizen::Base::Object to compare
97                 */
98                 virtual bool Equals(const Tizen::Base::Object& obj) const;
99
100                 /**
101                 * Gets the hash value of the current instance.
102                 *
103                 * @since                2.0
104                 *
105                 * @return               The hash value of the current instance
106                 */
107                 virtual int GetHashCode(void) const;
108
109                 // Operation
110         public:
111                 ///////////////////////////////////////////////////////////////
112                 // Getters
113                 ///////////////////////////////////////////////////////////////
114                 /**
115                 * Gets the name of an email attachment.
116                 *
117                 * @since                2.0
118                 *
119                 * @return               The name of an email attachment
120                 * @see                  SetName()
121                 */
122                 Tizen::Base::String GetName(void) const;
123
124                 /**
125                 * Gets the file path of an email attachment.
126                 *
127                 * @since                2.0
128                 *
129                 * @return               The file path of an email attachment
130                 * @see                  SetFilePath()
131                 */
132                 Tizen::Base::String GetFilePath(void) const;
133
134                 /**
135                 * Gets the size of an email attachment.
136                 *
137                 * @since                2.0
138                 *
139                 * @return               The size of an email attachment
140                 */
141                 int GetSize(void) const;
142
143                 /**
144                 * Gets the inline-content status of an email attachment.
145                 *
146                 * @since                2.0
147                 *
148                 * @return               @c true if an email attachment has inline-content(s), @n
149                 *                               else @c false
150                 * @see                  SetInlineContentStatus()
151                 */
152                 bool GetInlineContentStatus(void) const;
153
154                 /**
155                 * Gets the DRM status of an email attachment.
156                 *
157                 * @since                2.0
158                 *
159                 * @return               @c true if an email attachment contains DRM, @n
160                 *                               else @c false
161                 * @see                  SetDrmStatus()
162                 */
163                 bool GetDrmStatus(void) const;
164
165                 /**
166                 * Gets the MIME type of an email attachment.
167                 *
168                 * @since                2.0
169                 *
170                 * @return               The MIME type of an email attachment
171                 * @see                  SetMimeType()
172                 */
173                 Tizen::Base::String GetMimeType(void) const;
174
175
176         public:
177                 ///////////////////////////////////////////////////////////////
178                 // Setters
179                 ///////////////////////////////////////////////////////////////
180                 /**
181                 * Sets the name of an email attachment.
182                 *
183                 * @since                2.0
184                 *
185                 * @return               An error code
186                 * @param[in]    name                            The name of the email attachment
187                 * @exception    E_SUCCESS                       The method is successful.
188                 * @exception    E_MAX_EXCEEDED          The length of the name exceeds the maximum limit (Maximum 256 characters).
189                 * @see                  GetName()
190                 */
191                 result SetName(const Tizen::Base::String& name);
192
193                 /**
194                 * Sets the file path of an email attachment.
195                 *
196                 * @since                2.0
197                 *
198                 * @return               An error code
199                 * @param[in]    filePath                        The file path of the attachment
200                 * @exception    E_SUCCESS                       The method is successful.
201                 * @exception    E_INVALID_ARG           The length of the specified @c filePath is too long or @c 0.
202                 * @exception    E_FILE_NOT_FOUND        The specified file cannot be found or accessed.
203                 * @see                  GetFilePath()
204                 */
205                 result SetFilePath(const Tizen::Base::String& filePath);
206
207                 /**
208                 * Sets the inline-content status of an email attachment.
209                 *
210                 * @since                2.0
211                 *
212                 * @param[in]    status                          Set to @c true to change the inline-content status of the attachment to true, @n
213                 *                                                                       else @c false
214                 * @see                  GetInlineContentStatus()
215                 */
216                 void SetInlineContentStatus(bool status);
217
218                 /**
219                 * Sets the DRM status of an email attachment.
220                 *
221                 * @since                2.0
222                 *
223                 * @param[in]    status                          Set to @c true to change the DRM status of the attachment to true, @n
224                 *                                                                       else @c false
225                 * @see                  GetDrmStatus()
226                 */
227                 void SetDrmStatus(bool status);
228
229                 /**
230                 * Sets the MIME type of an email attachment.
231                 *
232                 * @since                2.0
233                 *
234                 * @return               An error code
235                 * @param[in]    type                            The MIME type of the attachment
236                 * @exception    E_SUCCESS                       The method is successful.
237                 * @exception    E_INVALID_ARG           The length of the specified @c type is @c 0.
238                 * @see                  GetMimeType()
239                 */
240                 result SetMimeType(const Tizen::Base::String& type);
241
242         private:
243                 _EmailAttachmentImpl* __pImpl;
244
245                 // friend class
246                 friend class _EmailAttachmentImpl;
247         }; // EmailAttachment
248 } } // Tizen::Messaging
249
250 #endif // _FMSG_EMAIL_ATTACHMENT_H_