tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / tizen / Messaging / Mms.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  * @file       Mms.h
20  * @author     Pawel Misiak (p.misiak@samsung.com)
21  * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
22  * @version    0.1
23  * @brief
24  */
25 #ifndef MMS_H
26 #define MMS_H
27
28 #include <API/Messaging/IMms.h>
29 #include <API/Messaging/MmsSlides.h>
30 #include "MmsSlide.h"
31 #include "ISendingObserver.h"
32
33 extern "C" {
34 #include <MsgTypes.h>
35 #include <MapiTransport.h>
36 }
37
38 namespace WrtDeviceApis {
39 namespace Messaging {
40 class Mms : public Api::IMms,
41     public ISendingObserver,
42     public Api::MmsSlides
43 {
44   public:
45     explicit Mms(const std::string& id = "");
46
47     ~Mms();
48
49     // implementation of interface of IMessage class
50     virtual void update(bool draftsOnly = false);
51
52     virtual void readAllData();
53
54     virtual void moveToFolder(const Api::FolderType newFolder);
55
56     virtual void moveToFolder(const std::string& newFolder);
57
58     virtual void copyToFolder(const Api::FolderType newFolder);
59
60     virtual void copyToFolder(const std::string& newFolder);
61
62     virtual void remove();
63
64     virtual void send();
65
66     virtual void sendingCallback(MSG_SENT_STATUS_S *sent_status);
67
68     virtual void sendCancel();
69
70     void setSendingStatusOk();
71
72     void setSendingStatusFailed();
73
74     static Api::FolderType toFolder(const std::string &folder);
75
76   private:
77
78     void updatePriority();
79
80     void updateRecipientList();
81
82     void updateSubject();
83
84     void updateBodyAndAttachments();
85
86     void updateReadStatus();
87
88     void readPriority(msg_message_t& messageData);
89
90     void readRecipientList(msg_message_t& messageData);
91
92     void readSubject(msg_message_t& messageData);
93
94     void readBodyAndAttachments(msg_message_t& messageData);
95
96     void readFolder(msg_message_t& messageData);
97
98     void readDateTime(msg_message_t& messageData);
99
100     void readReadStatus(msg_message_t& messageData);
101
102     void createNewMessage();
103
104     void readExistingMessage();
105
106   private:
107
108     std::string m_bodyFilePath;
109
110     msg_message_t m_messageData;
111 };
112
113 typedef DPL::SharedPtr<Mms> MmsPtr;
114 }
115 }
116
117 #endif