author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 09:45:25 +0300 | |
changeset 52 | 12db4185673b |
parent 44 | 36f374c67aa8 |
permissions | -rw-r--r-- |
31 | 1 |
/* |
2 |
* Copyright (c) 2008 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: |
|
15 |
* |
|
16 |
*/ |
|
17 |
#include "conversationsengine_p.h" |
|
18 |
||
19 |
//SYSTEM INCLUDES |
|
20 |
#include <ccsconversationentry.h> |
|
21 |
#include <ccsclientconversation.h> |
|
22 |
//USER INCLUDES |
|
23 |
#include "conversationsenginedefines.h" |
|
24 |
#include "conversationmsgstorehandler.h" |
|
25 |
#include "conversationssummarymodel.h" |
|
26 |
#include "conversationsmodel.h" |
|
27 |
#include "conversationchangehandler.h" |
|
28 |
#include "conversationlistchangehandler.h" |
|
29 |
#include "debugtraces.h" |
|
30 |
||
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
31 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
32 |
//CONSTANTS |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
33 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
34 |
*Max number of conversation that can be exchanged in IPC call |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
35 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
36 |
const TInt KMaxConversationIPCLimit = 250; |
31 | 37 |
//--------------------------------------------------------------- |
38 |
// ConversationsEnginePrivate::ConversationsEnginePrivate |
|
39 |
// @see header |
|
40 |
//--------------------------------------------------------------- |
|
41 |
ConversationsEnginePrivate::ConversationsEnginePrivate( |
|
42 |
ConversationMsgStoreHandler* conversationMsgStoreHandler, |
|
43 |
ConversationsSummaryModel *conversationsSummaryModel, |
|
44 |
ConversationsModel *conversationsModel |
|
45 |
):mServer(NULL), |
|
46 |
mClientConv(NULL), |
|
47 |
mConversationMsgStoreHandler(conversationMsgStoreHandler), |
|
48 |
mConversationsSummaryModel(conversationsSummaryModel), |
|
49 |
mConversationsModel(conversationsModel) |
|
50 |
{ |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
51 |
initL(); |
31 | 52 |
} |
53 |
||
54 |
//--------------------------------------------------------------- |
|
55 |
// ConversationsEnginePrivate::~ConversationsEnginePrivate |
|
56 |
// @see header |
|
57 |
//--------------------------------------------------------------- |
|
58 |
ConversationsEnginePrivate::~ConversationsEnginePrivate() |
|
59 |
{ |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
60 |
|
31 | 61 |
if( mClientConv ) |
62 |
{ |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
63 |
if(mServer && mConvChangeHandler) |
31 | 64 |
{ |
65 |
TRAP_IGNORE(mServer->RemoveConversationChangeEventL( |
|
66 |
mConvChangeHandler,mClientConv)); |
|
67 |
} |
|
68 |
delete mClientConv; |
|
69 |
mClientConv = NULL; |
|
70 |
} |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
71 |
if(mServer && mConvListChangeHandler) |
31 | 72 |
{ |
73 |
TRAP_IGNORE(mServer->RemoveConversationListChangeEventL( |
|
74 |
mConvListChangeHandler)); |
|
75 |
TRAP_IGNORE(mServer->RemoveResultsEventL ( this )); |
|
76 |
mServer->Cancel(); |
|
77 |
delete mServer; |
|
78 |
mServer = NULL; |
|
79 |
} |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
80 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
81 |
delete mConvChangeHandler; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
82 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
83 |
delete mConvListChangeHandler; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
84 |
|
31 | 85 |
} |
86 |
||
87 |
//--------------------------------------------------------------- |
|
88 |
// ConversationsEnginePrivate::initL |
|
89 |
// @see header |
|
90 |
//--------------------------------------------------------------- |
|
91 |
void ConversationsEnginePrivate::initL() |
|
92 |
{ |
|
93 |
mServer = CCSRequestHandler::NewL(); |
|
94 |
||
95 |
//Add results observer to the server |
|
96 |
mServer->RequestResultsEventL(this); |
|
97 |
||
98 |
//Fetch the conversation list from server |
|
99 |
mServer->GetConversationListL(); |
|
100 |
||
101 |
mConvChangeHandler = new ConversationsChangeHandler(this, |
|
102 |
mConversationsModel); |
|
103 |
||
104 |
mConvListChangeHandler = new ConversationsListChangeHandler(this, |
|
105 |
mConversationsSummaryModel); |
|
106 |
} |
|
107 |
||
108 |
//--------------------------------------------------------------- |
|
109 |
// ConversationsEnginePrivate::registerForConversationListUpdatesL |
|
110 |
// @see header |
|
111 |
//--------------------------------------------------------------- |
|
112 |
void ConversationsEnginePrivate::registerForConversationListUpdatesL() |
|
113 |
{ |
|
114 |
//Add ConversationListChange Observer |
|
115 |
mServer->RequestConversationListChangeEventL (mConvListChangeHandler); |
|
116 |
} |
|
117 |
||
118 |
//--------------------------------------------------------------- |
|
119 |
// ConversationsEnginePrivate::getConversationsL |
|
120 |
// @see header |
|
121 |
//--------------------------------------------------------------- |
|
122 |
void ConversationsEnginePrivate::getConversationsL( TInt aConversationId) |
|
123 |
{ |
|
124 |
if(!mClientConv) |
|
125 |
{ |
|
126 |
QCRITICAL_WRITE("ConversationsEnginePrivate::getConversationsL start."); |
|
127 |
//Clear the model before issueing fetch |
|
128 |
mConversationsModel->clear(); |
|
129 |
//create a client conversation |
|
130 |
mClientConv = CCsClientConversation::NewL(); |
|
131 |
mClientConv->SetConversationEntryId(aConversationId); |
|
132 |
//set dummy entry |
|
133 |
CCsConversationEntry *entry = CCsConversationEntry::NewL(); |
|
134 |
CleanupStack::PushL(entry); |
|
135 |
mClientConv->SetConversationEntryL(entry); |
|
136 |
CleanupStack::PopAndDestroy(entry); |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
137 |
// Reset the values in change handler before initiating a request |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
138 |
mConvChangeHandler->ResetValuesForNewConversation(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
139 |
|
31 | 140 |
//Get the conversations for new conversationId |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
141 |
mServer->GetConversationsL(mClientConv,0,KMaxConversationIPCLimit); |
31 | 142 |
|
143 |
QCRITICAL_WRITE("ConversationsEnginePrivate::getConversationsL end."); |
|
144 |
} |
|
145 |
||
146 |
} |
|
147 |
||
148 |
//--------------------------------------------------------------- |
|
149 |
// ConversationsEnginePrivate::deleteConversationL |
|
150 |
// @see header |
|
151 |
//--------------------------------------------------------------- |
|
152 |
void ConversationsEnginePrivate::deleteConversationL(TInt aConversationId) |
|
153 |
{ |
|
154 |
mServer->DeleteConversationL(aConversationId); |
|
155 |
} |
|
156 |
||
157 |
//--------------------------------------------------------------- |
|
158 |
// ConversationsEnginePrivate::deleteMessages |
|
159 |
// @see header |
|
160 |
//--------------------------------------------------------------- |
|
161 |
void ConversationsEnginePrivate::deleteMessages(RArray<TInt>& aIdArray) |
|
162 |
{ |
|
163 |
mConversationMsgStoreHandler->DeleteMessages(aIdArray); |
|
164 |
} |
|
165 |
||
166 |
//--------------------------------------------------------------- |
|
167 |
// ConversationsEnginePrivate::deleteallDraftMessages |
|
168 |
// @see header |
|
169 |
//--------------------------------------------------------------- |
|
170 |
void ConversationsEnginePrivate::deleteAllDraftMessagesL() |
|
171 |
{ |
|
172 |
mConversationMsgStoreHandler->DeleteAllDraftMessagesL(); |
|
173 |
} |
|
174 |
||
175 |
//--------------------------------------------------------------- |
|
176 |
// ConversationsEnginePrivate::markConversationReadL |
|
177 |
// @see header |
|
178 |
//--------------------------------------------------------------- |
|
179 |
void ConversationsEnginePrivate::markConversationReadL(TInt aConversationId) |
|
180 |
{ |
|
181 |
mServer->MarkConversationReadL(aConversationId); |
|
182 |
} |
|
183 |
||
184 |
//--------------------------------------------------------------- |
|
185 |
// ConversationsEnginePrivate::markMessagesReadL |
|
186 |
// @see header |
|
187 |
//--------------------------------------------------------------- |
|
188 |
void ConversationsEnginePrivate::markMessagesReadL(RArray<TInt>& aIdArray) |
|
189 |
{ |
|
190 |
mConversationMsgStoreHandler->MarkMessagesReadL(aIdArray); |
|
191 |
} |
|
192 |
||
193 |
//--------------------------------------------------------------- |
|
194 |
// ConversationsEnginePrivate::getConversationCurrentId |
|
195 |
// @see header |
|
196 |
//--------------------------------------------------------------- |
|
197 |
TInt ConversationsEnginePrivate::getConversationCurrentId() |
|
198 |
{ |
|
199 |
TInt convId = -1; |
|
200 |
if(mClientConv) |
|
201 |
{ |
|
202 |
convId = mClientConv->GetConversationEntryId(); |
|
203 |
} |
|
204 |
return convId; |
|
205 |
} |
|
206 |
||
207 |
//--------------------------------------------------------------- |
|
208 |
// ConversationsEnginePrivate::getConversationIdFromContactId |
|
209 |
// @see header |
|
210 |
//--------------------------------------------------------------- |
|
211 |
TInt ConversationsEnginePrivate::getConversationIdFromContactIdL(TInt contactId) |
|
212 |
{ |
|
213 |
TInt convId = -1; |
|
214 |
||
215 |
convId = mServer->GetConversationIdL(contactId); |
|
216 |
||
217 |
return convId; |
|
218 |
} |
|
219 |
||
220 |
//--------------------------------------------------------------- |
|
221 |
// ConversationsEnginePrivate::getConversationIdFromAddress |
|
222 |
// @see header |
|
223 |
//--------------------------------------------------------------- |
|
224 |
TInt ConversationsEnginePrivate::getConversationIdFromAddressL(TDesC& contactAddress) |
|
225 |
{ |
|
226 |
TInt convId = -1; |
|
227 |
||
228 |
convId = mServer->GetConversationIdFromAddressL(contactAddress); |
|
229 |
||
230 |
return convId; |
|
231 |
} |
|
232 |
||
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
233 |
//--------------------------------------------------------------- |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
234 |
// ConversationsEnginePrivate::getConversationFromConversationId |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
235 |
// @see header |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
236 |
//--------------------------------------------------------------- |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
237 |
CCsClientConversation* ConversationsEnginePrivate::getConversationFromConversationIdL(TInt aConversationId) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
238 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
239 |
return mServer->GetConversationFromConversationIdL(aConversationId); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
240 |
} |
31 | 241 |
|
242 |
//--------------------------------------------------------------- |
|
243 |
// ConversationsEnginePrivate::clearConversationsL |
|
244 |
// @see header |
|
245 |
//--------------------------------------------------------------- |
|
246 |
void ConversationsEnginePrivate::clearConversationsL() |
|
247 |
{ |
|
248 |
QCRITICAL_WRITE("ConversationsEnginePrivate::clearConversationsL start."); |
|
249 |
||
250 |
mConvChangeHandler->Cancel(); |
|
251 |
//Clear conversations model before populating with new data |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
252 |
mConversationsModel->clearModel(); |
31 | 253 |
|
254 |
// Delete old CCsClientConversation object |
|
255 |
// Remove the old Conversation change observer |
|
256 |
if(mClientConv) |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
257 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
258 |
int error = KErrNone; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
259 |
TRAP(error, mServer->RemoveConversationChangeEventL (mConvChangeHandler ,mClientConv)); |
31 | 260 |
delete mClientConv; |
261 |
mClientConv = NULL; |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
262 |
User::LeaveIfError(error); |
31 | 263 |
} |
264 |
||
265 |
QCRITICAL_WRITE("ConversationsEnginePrivate::clearConversationsL end."); |
|
266 |
} |
|
267 |
||
268 |
//--------------------------------------------------------------- |
|
269 |
// ConversationsEnginePrivate::registerForConversationUpdatesL |
|
270 |
// @see header |
|
271 |
//--------------------------------------------------------------- |
|
272 |
void ConversationsEnginePrivate::registerForConversationUpdatesL() |
|
273 |
{ |
|
274 |
//Add the Conversation Change for new conversationId |
|
275 |
if(mClientConv) |
|
276 |
{ |
|
277 |
mServer->RequestConversationChangeEventL (mConvChangeHandler ,mClientConv); |
|
278 |
} |
|
279 |
} |
|
280 |
||
281 |
//--------------------------------------------------------------- |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
282 |
// ConversationsEnginePrivate::deRegisterCVUpdatesTemporary |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
283 |
// @see header |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
284 |
//--------------------------------------------------------------- |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
285 |
void ConversationsEnginePrivate::deRegisterCVUpdatesTemporary() |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
286 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
287 |
mServer->RemoveConversationChangeEventL (mConvChangeHandler ,mClientConv); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
288 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
289 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
290 |
//--------------------------------------------------------------- |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
291 |
// ConversationsEnginePrivate::registerAgainForConversationUpdatesL |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
292 |
// @see header |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
293 |
//--------------------------------------------------------------- |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
294 |
void ConversationsEnginePrivate::registerAgainForConversationUpdatesL( |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
295 |
int newConversationId) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
296 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
297 |
//Add the Conversation Change for new conversationId |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
298 |
if(mClientConv) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
299 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
300 |
mClientConv->SetConversationEntryId(newConversationId); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
301 |
mServer->RequestConversationChangeEventL (mConvChangeHandler ,mClientConv); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
302 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
303 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
304 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
305 |
//--------------------------------------------------------------- |
31 | 306 |
// ConversationsEnginePrivate::ConversationList |
307 |
// @see header |
|
308 |
//--------------------------------------------------------------- |
|
309 |
void ConversationsEnginePrivate::ConversationList( |
|
310 |
RPointerArray<CCsClientConversation>& aClientConversationList) |
|
311 |
{ |
|
312 |
int error; |
|
313 |
TRAP(error, |
|
314 |
mConvListChangeHandler->ConversationListL(aClientConversationList)); |
|
315 |
} |
|
316 |
||
317 |
//--------------------------------------------------------------- |
|
318 |
// ConversationsEnginePrivate::Conversations |
|
319 |
// @see header |
|
320 |
//--------------------------------------------------------------- |
|
321 |
void ConversationsEnginePrivate::Conversations( |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
322 |
RPointerArray<CCsConversationEntry>& aConversationEntryList, |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
323 |
TInt& aTotalCount) |
31 | 324 |
{ |
325 |
int error; |
|
326 |
if (mClientConv) |
|
327 |
{ |
|
328 |
QCRITICAL_WRITE("ConversationsEnginePrivate::Conversations start."); |
|
329 |
||
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
330 |
TRAP(error,mConvChangeHandler->ConversationsL(aConversationEntryList,aTotalCount)); |
31 | 331 |
|
332 |
QCRITICAL_WRITE("ConversationsEnginePrivate::Conversations end."); |
|
333 |
} |
|
334 |
} |
|
335 |
||
336 |
||
337 |
//--------------------------------------------------------------- |
|
338 |
// ConversationsEngine::fetchMoreConversations |
|
339 |
// @see header |
|
340 |
//--------------------------------------------------------------- |
|
341 |
void ConversationsEnginePrivate::fetchMoreConversations() |
|
342 |
{ |
|
343 |
if (mClientConv) |
|
344 |
{ |
|
345 |
mConvChangeHandler->restartHandleConversations(); |
|
346 |
} |
|
347 |
} |
|
348 |
||
349 |
//--------------------------------------------------------------- |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
350 |
// ConversationsEngine::fetchRemainingConversations |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
351 |
// @see header |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
352 |
//--------------------------------------------------------------- |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
353 |
void ConversationsEnginePrivate::fetchRemainingConversations(TInt& aCount) |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
354 |
{ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
355 |
if ( mServer && mClientConv ) |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
356 |
{ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
357 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
358 |
// Get conversations from server |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
359 |
mServer->GetConversationsL(mClientConv, |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
360 |
(aCount - 1), |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
361 |
KMaxConversationIPCLimit); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
362 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
363 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
364 |
//--------------------------------------------------------------- |
31 | 365 |
// ConversationsEnginePrivate::resendMessage() |
366 |
// @see header |
|
367 |
//--------------------------------------------------------------- |
|
368 |
bool ConversationsEnginePrivate::resendMessage(TMsvId messageId) |
|
369 |
{ |
|
370 |
TInt err = KErrNone; |
|
371 |
bool retval = true; |
|
372 |
TRAP(err, retval = mConversationMsgStoreHandler->ResendMessageL(messageId)); |
|
373 |
return ((err == KErrNone) && (retval == true))?true:false; |
|
374 |
} |
|
375 |
||
376 |
//--------------------------------------------------------------- |
|
377 |
// ConversationsEnginePrivate::downloadMessage |
|
378 |
// @see header |
|
379 |
//--------------------------------------------------------------- |
|
380 |
TInt ConversationsEnginePrivate::downloadMessage(TMsvId messageId) |
|
381 |
{ |
|
382 |
TInt err = KErrNone; |
|
383 |
TInt retval = KErrNone; |
|
384 |
TRAP(err, retval = |
|
385 |
mConversationMsgStoreHandler->DownloadMessageL(messageId)); |
|
386 |
||
387 |
if( err!=KErrNone) |
|
388 |
{ |
|
389 |
retval = KErrGeneral; |
|
390 |
} |
|
391 |
||
392 |
return retval; |
|
393 |
} |
|
394 |
||
395 |
//--------------------------------------------------------------- |
|
396 |
// ConversationsEnginePrivate::downloadOperationSupported() |
|
397 |
// @see header |
|
398 |
//--------------------------------------------------------------- |
|
399 |
bool ConversationsEnginePrivate::downloadOperationSupported(TMsvId messageId) |
|
400 |
{ |
|
401 |
return mConversationMsgStoreHandler->DownloadOperationSupported(messageId); |
|
402 |
} |
|
403 |
//EOF |
|
404 |