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