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 virtual void downloadAttachmentCancel( int handle );
85 // implementation of interface of IMessage class
86 virtual void update(bool draftsOnly = false);
88 virtual void readAllData();
90 virtual void moveToFolder(const Api::Messaging::FolderType newFolder);
92 virtual void moveToFolder(const std::string& newFolder);
94 virtual void copyToFolder(const Api::Messaging::FolderType newFolder);
96 virtual void copyToFolder(const std::string& newFolder);
98 virtual void remove();
100 virtual int getAccountID();
102 virtual int getUID();
104 virtual int isBodyDownloaded();
106 virtual bool hasAttachment();
111 void create( Api::Messaging::EmailAccountInfo& account );
123 void updateRecipients();
127 void updateAttachments();
129 void updateSubject();
131 void updateReadStatus();
135 void updateMessage();
137 void addMessageToDraft();
139 void createSendMessage();
141 void updatePriority();
143 int getIntId() const;
146 DPL::Mutex m_updateMutex;
149 ScopedMailbox m_mailbox; //delete?