Add DRAFT stubs for Vehicle plugin
[profile/ivi/wrt-plugins-tizen.git] / src / platform / Tizen / Messaging / EmailService.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  * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
19  */
20
21 #ifndef TIZEN_MESSAGING_EMAILSERVICE_H_
22 #define TIZEN_MESSAGING_EMAILSERVICE_H_
23
24 #include <cstring>
25 #include <cstdlib>
26 #include <new>
27
28 #include <email-types.h>
29
30 #include <API/Messaging/EmailAccountInfo.h>
31
32 namespace TizenApis {
33 namespace Platform {
34 namespace Messaging {
35
36 namespace EmailService {
37 template<typename T>
38 T* alloc()
39 {
40     T* result = static_cast<T*>(::malloc(sizeof(T)));
41     if (NULL == result) {
42         throw std::bad_alloc();
43     }
44     ::memset(result, 0, sizeof(*result));
45     return result;
46 }
47
48 #if 1
49 email_mail_data_t* createMailData(const Api::Messaging::EmailAccountInfo& account);
50
51 email_mail_data_t* readMail(int mailId);
52
53 email_mailbox_t* getMailboxByType(int accountId,
54         email_mailbox_type_e type);
55
56 int addMail(email_mail_data_t* mail, email_attachment_data_t* attachment);
57
58 //int addMailToMailbox(email_mail_data_t* mail, email_mailbox_t* mailbox);
59
60 void deleteMail(int accountId, int mailId);
61
62 void freeAttachment(email_attachment_data_t* attachment);
63
64 //email_mailbox_t* createMailbox(int accountId, const char* name);
65
66 email_mail_data_t* cloneMail(const email_mail_data_t* mail);
67
68 email_mailbox_t* getMailboxByMailId(int accountId, int mailId);
69
70 void updateSeenFlag(int accountId, int mailId, bool isReadChangeStatus);
71
72 #else 
73
74 email_mail_t* createMail(const Api::Messaging::EmailAccountInfo& account);
75
76 email_mail_t* readMail(int accountId,
77         int mailId);
78
79 email_mailbox_t* getMailboxByType(int accountId,
80         email_mailbox_type_e type);
81
82 int addMailToMailbox(email_mail_t* mail,
83         email_mailbox_t* mailbox);
84
85 void deleteMail(int accountId,
86         int mailId);
87
88 void freeAttachment(email_attachment_info_t* attachment);
89
90 email_mailbox_t* createMailbox(int accountId,
91         const char* name);
92
93 email_mail_t* cloneMail(const email_mail_t* mail);
94
95 email_mailbox_t* getMailboxByMailId(int accountId,
96         int mailId);
97
98 void updateSeenFlag(int accountId, int mailId, bool isReadChangeStatus);
99
100 #endif
101
102 }
103 }
104 }
105 }
106 #endif