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.
20 * @author Pawel Misiak (p.misiak@samsung.com)
27 #include <API/Messaging/ISms.h>
28 #include "ISendingObserver.h"
32 #include <MapiTransport.h>
33 #include <MapiControl.h>
36 namespace WrtDeviceApis {
38 class Sms : public Api::ISms,
39 public ISendingObserver,
40 public DPL::Event::Controller<DPL::TypeListDecl<int>::Type >
43 explicit Sms(const std::string& id = "");
47 // implementation of interface of IMessage class
48 virtual void update(bool draftsOnly = false);
50 virtual void readAllData();
52 virtual void moveToFolder(const Api::FolderType newFolder);
54 virtual void moveToFolder(const std::string& newFolder);
56 virtual void copyToFolder(const Api::FolderType newFolder);
58 virtual void copyToFolder(const std::string& newFolder);
60 virtual void remove();
64 virtual void sendCancel()
68 virtual void sendingCallback(MSG_SENT_STATUS_S *sent_status);
70 virtual void OnEventReceived(const int& /*event*/);
72 static Api::FolderType toFolder(const std::string &folder);
75 void sendSubMessage();
77 void setSendingStatusOk();
79 void setSendingStatusFailed();
81 void createNewMessage();
83 void readExistingMessage();
91 void updateSourceAddress();
93 void updateReadStatus();
95 void readRecipientList(msg_message_t& messageData);
97 void readBody(msg_message_t& messageData);
99 void readFolder(msg_message_t& messageData);
101 void readDateTime(msg_message_t& messageData);
103 void readReadStatus(msg_message_t& messageData);
105 void readSize(msg_message_t& messageData);
107 std::queue<msg_message_t>& currentQueue()
109 return m_sendRequests.front().queue;
112 msg_message_t createNewCopyOfPLatformMsg(const msg_message_t src) const;
115 msg_message_t m_messageData;
116 bool m_sendingFailed;
121 // queue of sub messages for each recipient
122 std::queue<msg_message_t> queue;
125 SendRequest() : failed(false)
129 // queue of send requests
130 std::queue<SendRequest> m_sendRequests;