Update change log and spec for wrt-plugins-tizen_0.4.38
[framework/web/wrt-plugins-tizen.git] / src / Messaging / Conversation.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17  
18
19 #ifndef CONVERSATION_H
20 #define CONVERSATION_H
21
22 #include <dpl/shared_ptr.h>
23 #include <map>
24 #include <string>
25 #include <vector>
26 #include "IConversation.h"
27
28 extern "C" {
29 #include <msg_storage.h>
30 #include <msg.h>
31 #include <msg_transport.h>
32 }
33
34 namespace DeviceAPI {
35 namespace Messaging {
36
37
38 class Conversation : public IConversation
39 {
40 public: 
41         Conversation();
42         Conversation(unsigned int threadId, MessageType msgType);
43         Conversation(unsigned int threadIndex); // msg thread with index of all thread view for test
44         Conversation(std::string msgId, MessageType msgType);
45 //      Conversation(msg_thread_view_t msg_thread); // msg thread with thread data
46         Conversation(msg_struct_t msg_thread); // msg thread with thread data   
47
48         ~Conversation();
49
50         // getter
51         int getConvId();
52         unsigned short getType();
53         time_t getTime();
54         unsigned long getMessageCount();
55         unsigned long getUnreadMessages();
56         std::string getPreview();
57         std::string getSubject();
58         bool getRead();
59         std::string getFrom();
60         std::vector<std::string> getTo();
61         std::vector<std::string> getCC();
62         std::vector<std::string> getBCC();
63         int getLastMessageId();
64         bool getResult();
65         int getDirection();
66         bool makeConversationFromMsgId(unsigned int msgId, MessageType msgType);
67         void makeConversationFromThreadIndex(unsigned int threadIndex);
68 //      void makeConversationFromThread(msg_thread_view_t msg_thread);
69         void makeConversationFromThread(msg_struct_t msg_thread);
70         bool makeConversationFromEmailThreadId(unsigned int emailTreadId);
71         void makeEmptyConversation(unsigned int threadIndex, MessageType msgType);      
72         void setConvId(const int id);
73 #if 0
74         // setter
75         void setId(unsigned int id);
76         void setType(unsigned short type);
77         void setTime(time_t* time);
78         void setMessageCount(unsigned long messageCount);
79         void setUnreadMessages(unsigned long unreadMessages);
80         void setPreview(unsigned long unreadMessages);
81         void setRead(bool read);
82         void setFrom(std::string from);
83         void setTo(std::vector<std::string> to);
84         void setCC(std::vector<std::string> cc);
85         void setBCC(std::vector<std::string> bcc);
86         void setLastMessageId(unsigned int id);
87 #endif  
88
89         
90 private:        
91         int m_Id;
92         unsigned short int m_type;
93         time_t m_time;
94         unsigned long m_messageCount;
95         unsigned long m_unreadMessages;
96         std::string m_preview;
97         bool m_read;
98         std::string m_from;
99         std::string m_subject;
100         std::vector<std::string> m_to;
101         std::vector<std::string> m_cc;
102         std::vector<std::string> m_bcc;
103         int m_lastMessageId;
104         int m_direction;
105         bool m_result;
106
107 };
108 }
109 }
110
111 #endif
112