31
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: This class shall be used for holding data required for
|
|
15 |
* server to client and vice versa. Also this shall be for
|
|
16 |
* one client many conversations
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
#ifndef __C_CS_CLIENT_CONVERSATION_H__
|
|
21 |
#define __C_CS_CLIENT_CONVERSATION_H__
|
|
22 |
|
|
23 |
// SYSTEM INCLUDES
|
|
24 |
|
|
25 |
//USER INCLUDES
|
|
26 |
#include <ccsdefs.h>
|
|
27 |
|
|
28 |
// FORWARD CLASS
|
|
29 |
class CCsConversationEntry;
|
|
30 |
|
|
31 |
// CLASS DECLARATION
|
|
32 |
/**
|
|
33 |
* CCsClientConversation
|
|
34 |
* This class shall be used for holding data required for
|
|
35 |
* server to client and vice versa. Also this shall be for
|
|
36 |
* one client many conversations
|
|
37 |
*
|
|
38 |
* @remarks Lib: csutils.lib
|
|
39 |
* @since S60 v5.0
|
|
40 |
*/
|
|
41 |
class CCsClientConversation: public CBase
|
|
42 |
{
|
|
43 |
public:
|
|
44 |
|
|
45 |
/**
|
|
46 |
*
|
|
47 |
* NewL
|
|
48 |
* Two phase construction
|
|
49 |
* @return Instance of CCsClientConversation
|
|
50 |
*/
|
|
51 |
IMPORT_C static CCsClientConversation* NewL();
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Destructor
|
|
55 |
*/
|
|
56 |
IMPORT_C ~CCsClientConversation();
|
|
57 |
|
|
58 |
public:
|
|
59 |
|
|
60 |
/**
|
|
61 |
* GetConversationEntryId
|
|
62 |
* Provides the unique identifier of conversation
|
|
63 |
*
|
|
64 |
* @return unique identifier of conversation
|
|
65 |
* entry
|
|
66 |
*/
|
|
67 |
IMPORT_C TCsConversationEntryID GetConversationEntryId() const;
|
|
68 |
|
|
69 |
/**
|
|
70 |
* SetConversationEntryId
|
|
71 |
* Sets the unique identifier of this object
|
|
72 |
*
|
|
73 |
* @param aEnryId The unique identifier
|
|
74 |
*/
|
|
75 |
IMPORT_C void SetConversationEntryId(
|
|
76 |
TCsConversationEntryID aEnryId);
|
|
77 |
|
|
78 |
/**
|
|
79 |
* GetDisplayName
|
|
80 |
* Provides the Conversation display name of this object
|
|
81 |
*
|
|
82 |
* @return Instance of Conversation display name of this object
|
|
83 |
*/
|
|
84 |
IMPORT_C HBufC* GetDisplayName() const;
|
|
85 |
|
|
86 |
/**
|
|
87 |
* SetDisplayNameL
|
|
88 |
* Sets the Conversation display name of this object
|
|
89 |
*
|
|
90 |
* @param aDisplayName Instance of Conversation display name
|
|
91 |
*/
|
|
92 |
IMPORT_C void SetDisplayNameL(
|
|
93 |
const HBufC* aDisplayName);
|
|
94 |
|
|
95 |
/**
|
|
96 |
* GetContactId
|
|
97 |
* Provides the Contact Id for the conversation
|
|
98 |
*
|
|
99 |
* @return Integer type iContactId
|
|
100 |
*/
|
|
101 |
IMPORT_C TInt32 GetContactId() const;
|
|
102 |
|
|
103 |
/**
|
|
104 |
* SetContactId
|
|
105 |
* Sets the phonebook Contact Id of the conversation
|
|
106 |
*
|
|
107 |
* @param aContactId to be set as contact id
|
|
108 |
*/
|
|
109 |
IMPORT_C void SetContactId (const TInt32 aContactId);
|
|
110 |
|
|
111 |
/**
|
|
112 |
* GetConversationEntry
|
|
113 |
* Provides the latest conversation Entry by
|
|
114 |
* timestamp of a conversation identified by
|
|
115 |
* iConversationEntryID of this object.
|
|
116 |
*
|
|
117 |
* @return Instance of Conversation Entry of this object
|
|
118 |
*/
|
|
119 |
IMPORT_C CCsConversationEntry* GetConversationEntry() const;
|
|
120 |
|
|
121 |
/**
|
|
122 |
* SetConversationEntryL
|
|
123 |
* Sets latest conversation Entry by timestamp of a conversation
|
|
124 |
* identified by iConversationEntryID of this object.
|
|
125 |
*
|
|
126 |
* @param aCsConversationEntry Instance of Conversation contact
|
|
127 |
*/
|
|
128 |
IMPORT_C void SetConversationEntryL(
|
|
129 |
const CCsConversationEntry* aCsConversationEntry);
|
|
130 |
|
|
131 |
/**
|
|
132 |
* CloneL
|
|
133 |
* Gets the clone of the object
|
|
134 |
*
|
|
135 |
* @return Pointer to CCsClientConversation object
|
|
136 |
*/
|
|
137 |
IMPORT_C CCsClientConversation* CloneL() const;
|
|
138 |
|
|
139 |
/**
|
|
140 |
* ExternalizeL
|
|
141 |
* Writes 'this' object to the stream
|
|
142 |
*
|
|
143 |
* @param aStream WriteStream with externalized contents
|
|
144 |
*/
|
|
145 |
IMPORT_C virtual void ExternalizeL(
|
|
146 |
RWriteStream& aStream) const;
|
|
147 |
|
|
148 |
/**
|
|
149 |
* InternalizeL
|
|
150 |
* Initializes/Read 'this' object from stream
|
|
151 |
*
|
|
152 |
* @param aStream ReadStream with data contents to be internalized
|
|
153 |
*/
|
|
154 |
IMPORT_C virtual void InternalizeL(
|
|
155 |
RReadStream& aStream);
|
|
156 |
|
|
157 |
/**
|
|
158 |
* CompareByTimeStamp
|
|
159 |
* Compares 2 CCsClientConversation objects based
|
|
160 |
* on the latest event time stamp
|
|
161 |
*
|
|
162 |
* @param obj1 CCsClientConversation object
|
|
163 |
* @param obj2 CCsClientConversation object
|
|
164 |
*
|
|
165 |
* @return -1 if
|
|
166 |
* aFirst.iConversationEntry->iTimeStamp >
|
|
167 |
* aSecond.iConversationEntry->iTimeStamp
|
|
168 |
* 1 if
|
|
169 |
* aFirst.iConversationEntry->iTimeStamp <
|
|
170 |
* aSecond.iConversationEntry->iTimeStamp
|
|
171 |
* 0 if
|
|
172 |
* aFirst.iConversationEntry->iTimeStamp ==
|
|
173 |
* aSecond.iConversationEntry->iTimeStamp
|
|
174 |
*/
|
|
175 |
IMPORT_C static TInt CompareByTimeStamp(
|
|
176 |
const CCsClientConversation& obj1,
|
|
177 |
const CCsClientConversation& obj2);
|
|
178 |
|
|
179 |
/**
|
|
180 |
* CompareByConversationEntryId
|
|
181 |
* Compares 2 CCsClientConversation objects based
|
|
182 |
* on ConversationEntryId.
|
|
183 |
*
|
|
184 |
* @param obj1 CCsClientConversation object
|
|
185 |
* @param obj2 CCsClientConversation object
|
|
186 |
*
|
|
187 |
* @return ETrue if
|
|
188 |
* aFirst.iConversationEntry->iEntryID ==
|
|
189 |
* aSecond.iConversationEntry->iEntryID
|
|
190 |
* EFalse if
|
|
191 |
* aFirst.iConversationEntry->iEntryID !=
|
|
192 |
* aSecond.iConversationEntry->iEntryID
|
|
193 |
*/
|
|
194 |
IMPORT_C static TBool CompareByConversationEntryId(
|
|
195 |
const CCsClientConversation& obj1,
|
|
196 |
const CCsClientConversation& obj2);
|
|
197 |
|
|
198 |
/**
|
|
199 |
* GetUnreadMessageCount
|
|
200 |
* Returns the unread message count in the
|
|
201 |
* conversation
|
|
202 |
*
|
|
203 |
* @return unread Messages count
|
|
204 |
* @attention Range of unread message count is 0 to 65535.
|
|
205 |
*/
|
|
206 |
IMPORT_C TUint16 GetUnreadMessageCount() const;
|
|
207 |
|
|
208 |
/**
|
|
209 |
* GetUnreadMessageCount
|
|
210 |
* Returns the unread message count in the
|
|
211 |
* conversation
|
|
212 |
*
|
|
213 |
* @return unread Messages count
|
|
214 |
* @attention Range of unread message count is 0 to 65535.
|
|
215 |
*/
|
|
216 |
IMPORT_C void SetUnreadMessageCount(TUint16 aCount);
|
|
217 |
|
|
218 |
|
|
219 |
private: // functions
|
|
220 |
|
|
221 |
/**
|
|
222 |
* Default Constructor
|
|
223 |
*/
|
|
224 |
CCsClientConversation();
|
|
225 |
|
|
226 |
/**
|
|
227 |
* Second phase constructor
|
|
228 |
*/
|
|
229 |
void ConstructL();
|
|
230 |
|
|
231 |
private: // data members
|
|
232 |
|
|
233 |
/**
|
|
234 |
* iConversationEntryList
|
|
235 |
* Latest converation entry
|
|
236 |
*/
|
|
237 |
CCsConversationEntry* iConversationEntry;
|
|
238 |
|
|
239 |
/**
|
|
240 |
* iConversationEntryIDList
|
|
241 |
* Unique id or index of the conversation
|
|
242 |
*/
|
|
243 |
TCsConversationEntryID iConversationEntryID;
|
|
244 |
|
|
245 |
/**
|
|
246 |
* iDisplayName
|
|
247 |
* Display name of conversation
|
|
248 |
*/
|
|
249 |
HBufC* iDisplayName;
|
|
250 |
|
|
251 |
/**
|
|
252 |
* iContactId
|
|
253 |
* Contact Id of phonebook contact
|
|
254 |
*/
|
|
255 |
TInt32 iContactId;
|
|
256 |
|
|
257 |
/**
|
|
258 |
* iUnreadMessagesCount
|
|
259 |
* Count of unread messages in a conversation
|
|
260 |
*
|
|
261 |
* @attention Range of unread message count is 0 to 65535.
|
|
262 |
*/
|
|
263 |
TUint16 iUnreadMessagesCount;
|
|
264 |
};
|
|
265 |
|
|
266 |
#endif // __C_CS_CLIENT_CONVERSATION_H__
|
|
267 |
|
|
268 |
// End of File
|
|
269 |
|