Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / platform / API / Messaging / IEmail.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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. 
15 */
16
17 /**
18  *
19  *
20  * @file       IEmail.h
21  * @author     Pawel Misiak (p.misiak@samsung.com)
22  * @version    0.1
23  * @brief
24  */
25 #ifndef IEMAIL_H
26 #define IEMAIL_H
27
28 #include <string>
29 #include <dpl/shared_ptr.h>
30 #include "VirtualMessage.h"
31 #include "IMessage.h"
32 #include "Subject.h"
33 #include "ToRecipient.h"
34 #include "CcRecipient.h"
35 #include "BccRecipient.h"
36 #include "Attachments.h"
37 #include <API/Messaging/EmailAccountInfo.h>
38
39 namespace TizenApis {
40 namespace Api {
41 namespace Messaging {
42
43 class IEmail : virtual public IMessage,
44     public CcRecipient,
45     public BccRecipient,
46     public Attachments
47 {
48   public:
49     explicit IEmail(const std::string& id = "");
50
51     virtual ~IEmail();
52
53     IEmail & operator <<(const VirtualMessage& msg);
54
55     void setHtmlBody(const std::string& htmlBody = "") 
56     {
57                 m_htmlBody = htmlBody;
58     }
59
60     std::string getHtmlBody() const 
61     {
62                 return m_htmlBody;
63     }
64         
65     void setEmailAccount(const EmailAccountInfo& account)
66     {
67                 m_EmailAccount = account;
68     }
69
70     EmailAccountInfo getEmailAccount()
71     {
72                 return m_EmailAccount;
73     }
74         
75     virtual int getAccountID() = 0;
76     virtual int getUID() = 0;
77     virtual int isBodyDownloaded() = 0;
78     
79     virtual int downloadBody() = 0;
80     virtual void downloadBodyCancel(int handle ) = 0;
81
82     virtual int downloadAttachment(const Api::Messaging::IAttachmentPtr& attachment) = 0;
83
84     virtual bool hasAttachment() = 0;
85
86 #if 0   
87     virtual void sync(int account_id);  
88     virtual void sync_folder(int account_id, int folder_id);
89 #endif    
90   private:
91     std::string m_htmlBody;             //html body for Email.
92     EmailAccountInfo m_EmailAccount;    
93 };
94
95 typedef DPL::SharedPtr<IEmail> IEmailPtr;
96 }
97 }
98 }
99 #endif // IEMAIL_H
100