author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:32:06 +0100 | |
branch | GCC_SURGE |
changeset 47 | 5b14749788d7 |
parent 25 | 84d9eb65b26f |
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 |
||
18 |
||
19 |
#ifndef CONVERSATIONS_ENGINE_PRIVATE_H |
|
20 |
#define CONVERSATIONS_ENGINE_PRIVATE_H |
|
21 |
||
22 |
// SYSTEM INCLUDES |
|
23 |
#include <ccsrequesthandler.h> |
|
24 |
#include <mcsresultsobserver.h> |
|
25 |
#include <msvstd.h> |
|
26 |
// USER INCLUDES |
|
27 |
||
28 |
// FORWARD DECLARATIONS |
|
29 |
class CCsClientConversation; |
|
30 |
class ConversationsSummaryModel; |
|
31 |
class ConversationsModel; |
|
32 |
class ConversationMsgStoreHandler; |
|
33 |
class ConversationsChangeHandler; |
|
34 |
class ConversationsListChangeHandler; |
|
35 |
||
36 |
/** |
|
37 |
* This Class reads the initial conversation list and conversations. |
|
38 |
* |
|
39 |
* @code |
|
40 |
* |
|
41 |
* @endcode |
|
42 |
* @since S60 v10.1 |
|
43 |
*/ |
|
44 |
class ConversationsEnginePrivate :public MCsResultsObserver |
|
45 |
{ |
|
46 |
||
47 |
public: |
|
48 |
||
49 |
/** |
|
50 |
* Default constructor. |
|
51 |
*/ |
|
52 |
explicit ConversationsEnginePrivate( |
|
53 |
ConversationMsgStoreHandler* conversationMsgStoreHandler, |
|
54 |
ConversationsSummaryModel* conversationsSummaryModel, |
|
55 |
ConversationsModel* conversationsModel |
|
56 |
); |
|
57 |
||
58 |
/** |
|
59 |
* Destructor. |
|
60 |
*/ |
|
61 |
virtual ~ConversationsEnginePrivate(); |
|
62 |
||
63 |
/** |
|
64 |
* Adds ConversationListChange Observer |
|
65 |
*/ |
|
66 |
void registerForConversationListUpdatesL(); |
|
67 |
||
68 |
/** |
|
69 |
* getConversationsL |
|
70 |
* Initiates a call to conversation server to get all the |
|
71 |
* conversations for a conversation entry. |
|
72 |
* |
|
73 |
* @param aConversationId |
|
74 |
*/ |
|
75 |
void getConversationsL( TInt aConversationId); |
|
76 |
||
77 |
/** |
|
78 |
* Delete all conversations. |
|
79 |
* @param conversationId, conversationId |
|
80 |
*/ |
|
81 |
void deleteConversationL(TInt aConversationId); |
|
82 |
||
83 |
/** |
|
84 |
* Delete all messages. |
|
85 |
* @param msgIdList, message list. |
|
86 |
*/ |
|
87 |
void deleteMessages(RArray<TInt>& aIdArray); |
|
88 |
||
89 |
/** |
|
90 |
* Delete all draft messages. |
|
91 |
*/ |
|
92 |
void deleteAllDraftMessagesL(); |
|
93 |
||
94 |
/** |
|
95 |
* Marks the unread conversations as read |
|
96 |
* @param conversationId, conversationId |
|
97 |
*/ |
|
98 |
void markConversationReadL(TInt aConversationId); |
|
99 |
||
100 |
/** |
|
101 |
* Mark messages as read. |
|
102 |
* @param msgIdList, message list. |
|
103 |
*/ |
|
104 |
void markMessagesReadL(RArray<TInt>& aIdArray); |
|
105 |
||
106 |
/** |
|
107 |
* Get current conversation id. |
|
108 |
*/ |
|
109 |
TInt getConversationCurrentId(); |
|
110 |
||
111 |
/** |
|
112 |
* Clear all conversations |
|
113 |
*/ |
|
114 |
void clearConversationsL(); |
|
115 |
||
116 |
/** |
|
117 |
* Adds ConversationChange Observer |
|
118 |
*/ |
|
119 |
void registerForConversationUpdatesL(); |
|
120 |
||
121 |
/** |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
122 |
* Remove the CV notifs temporary for some time |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
123 |
* does not destroy the model as such |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
124 |
*/ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
125 |
void deRegisterCVUpdatesTemporary(); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
126 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
127 |
/** |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
128 |
* Register again after temporary de-register |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
129 |
* just need to set the new conversation id |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
130 |
*/ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
131 |
void registerAgainForConversationUpdatesL(int newConversationId); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
132 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
133 |
/** |
31 | 134 |
* Fetch ConversationId from contactId |
135 |
* @param contactId , contactId |
|
136 |
* @return conversationId |
|
137 |
*/ |
|
138 |
TInt getConversationIdFromContactIdL(TInt contactId); |
|
139 |
||
140 |
/** |
|
141 |
* Fetch ConversationId from contact address |
|
142 |
* @param contactAddress , contact Address |
|
143 |
* @return conversationId |
|
144 |
*/ |
|
145 |
TInt getConversationIdFromAddressL(TDesC& contactAddress); |
|
146 |
||
147 |
/** |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
148 |
* Get the latest conversation from the conversation cache by Id |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
149 |
* @param aConversationId for conversation is required |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
150 |
*/ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
151 |
CCsClientConversation* getConversationFromConversationIdL(TInt aConversationId); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
152 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
153 |
/** |
31 | 154 |
* Starts fetching remaing conversations |
155 |
*/ |
|
156 |
void fetchMoreConversations(); |
|
157 |
||
158 |
||
159 |
/** |
|
160 |
* Resend a failed message |
|
161 |
* @param messageId TMsvId The msv id of the entry to resend |
|
162 |
* @return bool true if success |
|
163 |
*/ |
|
164 |
bool resendMessage(TMsvId messageId); |
|
165 |
||
166 |
/** |
|
167 |
* Download a specified message |
|
168 |
* @param aId TMsvId of the message |
|
169 |
* @return KErrNone if Download request is successful, |
|
170 |
* KErrNotFound if settings are not available, |
|
171 |
* KErrGeneral for other cases |
|
172 |
*/ |
|
173 |
TInt downloadMessage(TMsvId messageId); |
|
174 |
||
175 |
/** |
|
176 |
* Query if the download operation be performed for |
|
177 |
* a message notification entry |
|
178 |
* @param aId, message notification id |
|
179 |
* @return true if download operation is possible |
|
180 |
*/ |
|
181 |
bool downloadOperationSupported(TMsvId messageId); |
|
182 |
||
183 |
public: // From MCsResultsObserver |
|
184 |
||
185 |
/** |
|
186 |
* ConversationList |
|
187 |
* This is for handling GetEntryList results asynchronusly |
|
188 |
* from the server. |
|
189 |
* |
|
190 |
* @param aClientConversationList List of client conversations |
|
191 |
* returned by server. |
|
192 |
*/ |
|
193 |
void ConversationList( |
|
194 |
RPointerArray<CCsClientConversation>& aClientConversationList); |
|
195 |
/** |
|
196 |
* Conversations |
|
197 |
* This is for handling GetConversation results asynchronusly |
|
198 |
* from the server. |
|
199 |
* |
|
200 |
* @param aConversationEntryList List of conversation entries |
|
201 |
* returned by server. |
|
202 |
*/ |
|
203 |
||
204 |
void Conversations( |
|
205 |
RPointerArray<CCsConversationEntry>& aConversationEntryList); |
|
206 |
||
207 |
private: |
|
208 |
||
209 |
/** |
|
210 |
* Initializes the ConversationReader class. |
|
211 |
*/ |
|
212 |
void initL(); |
|
213 |
||
214 |
||
215 |
private: // data |
|
216 |
||
217 |
/** |
|
218 |
* mServer |
|
219 |
* Ptr to conversation server. |
|
220 |
*/ |
|
221 |
CCSRequestHandler* mServer; |
|
222 |
||
223 |
/** |
|
224 |
* mClientConv |
|
225 |
* Current Client Conversation selected. |
|
226 |
* Own. |
|
227 |
*/ |
|
228 |
CCsClientConversation* mClientConv; |
|
229 |
||
230 |
/** |
|
231 |
* MsgStore Handler |
|
232 |
* Not Owned |
|
233 |
*/ |
|
234 |
ConversationMsgStoreHandler* mConversationMsgStoreHandler; |
|
235 |
||
236 |
/** |
|
237 |
* Conversations Summary Model |
|
238 |
* Not Owned |
|
239 |
*/ |
|
240 |
ConversationsSummaryModel *mConversationsSummaryModel; |
|
241 |
||
242 |
/** |
|
243 |
* Conversations Model |
|
244 |
* Not Owned |
|
245 |
*/ |
|
246 |
ConversationsModel *mConversationsModel; |
|
247 |
||
248 |
/** |
|
249 |
* Conversations Change Handler |
|
250 |
* Owned |
|
251 |
*/ |
|
252 |
ConversationsChangeHandler *mConvChangeHandler; |
|
253 |
||
254 |
/** |
|
255 |
* Conversations List Change Handler |
|
256 |
* Owned |
|
257 |
*/ |
|
258 |
ConversationsListChangeHandler *mConvListChangeHandler; |
|
259 |
||
260 |
}; |
|
261 |
||
262 |
#endif // CONVERSATIONS_ENGINE_PRIVATE_H |
|
263 |
||
264 |
//EOF |
|
265 |