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.
18 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
21 #ifndef TIZEN_MESSAGING_EMAILSERVICE_H_
22 #define TIZEN_MESSAGING_EMAILSERVICE_H_
28 #include <emf-types.h>
30 #include <API/Messaging/EmailAccountInfo.h>
36 namespace EmailService {
40 T* result = static_cast<T*>(::malloc(sizeof(T)));
42 throw std::bad_alloc();
44 ::memset(result, 0, sizeof(*result));
48 emf_mail_t* createMail(const Api::Messaging::EmailAccountInfo& account);
50 emf_mail_t* readMail(int accountId,
53 emf_mailbox_t* getMailboxByType(int accountId,
54 emf_mailbox_type_e type);
56 int addMailToMailbox(emf_mail_t* mail,
57 emf_mailbox_t* mailbox);
59 void deleteMail(int accountId,
62 void freeAttachment(emf_attachment_info_t* attachment);
64 emf_mailbox_t* createMailbox(int accountId,
67 emf_mail_t* cloneMail(const emf_mail_t* mail);
69 emf_mailbox_t* getMailboxByMailId(int accountId,
72 void updateSeenFlag(int accountId, int mailId, bool isReadChangeStatus);