2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef CONVERSATION_H
20 #define CONVERSATION_H
22 #include <dpl/shared_ptr.h>
26 #include "IConversation.h"
29 #include <msg_storage.h>
31 #include <msg_transport.h>
38 class Conversation : public IConversation
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
52 unsigned short getType();
54 unsigned long getMessageCount();
55 unsigned long getUnreadMessages();
56 std::string getPreview();
57 std::string getSubject();
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();
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);
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);
92 unsigned short int m_type;
94 unsigned long m_messageCount;
95 unsigned long m_unreadMessages;
96 std::string m_preview;
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;