2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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.
22 * @author Pawel Misiak (p.misiak@samsung.com)
30 #include <dpl/mutex.h>
31 #include <API/Messaging/IEmail.h>
32 #include <API/Messaging/IMessagingTypes.h>
33 #include <API/Messaging/EmailAccountInfo.h>
35 #include "ScopedMail.h"
36 #include "ScopedMailbox.h"
38 // The email service library
40 //temporary solution for email-service problem (compilation break)
44 #ifndef SUPPORT_CONTACT_ON_SIM
45 //#define SUPPORT_CONTACT_ON_SIM
51 #ifndef _PREVIEW_IN_MAILIST
52 #define _PREVIEW_IN_MAILIST
60 class Email : public Api::Messaging::IEmail
63 explicit Email(const std::string& id = std::string());
65 explicit Email(const std::string& id, int accountId);
67 explicit Email( Api::Messaging::EmailAccountInfo& account);
69 explicit Email(const Api::Messaging::FolderType folder);
75 virtual void sendCancel(int handle);
77 virtual int downloadBody();
79 virtual void downloadBodyCancel( int handle );
81 virtual int downloadAttachment(const Api::Messaging::IAttachmentPtr& attachment);
83 // implementation of interface of IMessage class
84 virtual void update(bool draftsOnly = false);
86 virtual void readAllData();
88 virtual void moveToFolder(const Api::Messaging::FolderType newFolder);
90 virtual void moveToFolder(const std::string& newFolder);
92 virtual void copyToFolder(const Api::Messaging::FolderType newFolder);
94 virtual void copyToFolder(const std::string& newFolder);
96 virtual void remove();
98 virtual int getAccountID();
100 virtual int getUID();
102 virtual int isBodyDownloaded();
104 virtual bool hasAttachment();
109 void create( Api::Messaging::EmailAccountInfo& account );
121 void updateRecipients();
125 void updateAttachments();
127 void updateSubject();
129 void updateReadStatus();
133 void addMessageToDraft();
135 void updatePriority();
137 int getIntId() const;
140 DPL::Mutex m_updateMutex;
143 ScopedMailbox m_mailbox;