|
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: This Class handles Add, Delete & Modify conversation list client events. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CONVERSATIONSLIST_CHANGEHANDLER_H |
|
19 #define CONVERSATIONSLIST_CHANGEHANDLER_H |
|
20 |
|
21 // SYSTEM INCLUDE |
|
22 #include <mcsconversationlistchangeobserver.h> |
|
23 |
|
24 // USER INCLUDE |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class ConversationsSummaryModel; |
|
28 class ConversationsEnginePrivate; |
|
29 |
|
30 /** |
|
31 * This Class handles Add, Delete & Modify conversation list client events. |
|
32 * |
|
33 * @code |
|
34 * @endcode |
|
35 * |
|
36 * @since S60 v10.1 |
|
37 */ |
|
38 class ConversationsListChangeHandler : public CActive, |
|
39 public MCsConversationListChangeObserver |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Default constructor. |
|
46 */ |
|
47 explicit ConversationsListChangeHandler( |
|
48 ConversationsEnginePrivate* convEnginePrivate, |
|
49 ConversationsSummaryModel* conversationsSummaryModel); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 ~ConversationsListChangeHandler(); |
|
55 |
|
56 public: |
|
57 // CActive callbacks |
|
58 |
|
59 /** |
|
60 * RunL. |
|
61 */ |
|
62 void RunL(); |
|
63 |
|
64 /** |
|
65 * DoCancel. |
|
66 */ |
|
67 void DoCancel(); |
|
68 |
|
69 /** |
|
70 * ConversationList |
|
71 * This is for handling GetEntryList results asynchronusly |
|
72 * from the server. |
|
73 * |
|
74 * @param aClientConversationList List of client conversations |
|
75 * returned by server. |
|
76 */ |
|
77 void ConversationListL( |
|
78 RPointerArray<CCsClientConversation>& aClientConversationList); |
|
79 |
|
80 public: |
|
81 |
|
82 // -------------From MCsConversationListChangeObserver----------------------- |
|
83 |
|
84 /** |
|
85 * AddConversationList |
|
86 * This is for handling new conversation event |
|
87 * asynchronusly from the server |
|
88 * |
|
89 * @param aClientConversation client conversation |
|
90 */ |
|
91 void AddConversationList(const CCsClientConversation& aClientConversation); |
|
92 |
|
93 /** |
|
94 * DeleteConversationList |
|
95 * This is for handling delete conversation event |
|
96 * asynchronusly from the server |
|
97 * |
|
98 * @param aClientConversation client conversation |
|
99 */ |
|
100 void DeleteConversationList( |
|
101 const CCsClientConversation& aClientConversation); |
|
102 |
|
103 /** |
|
104 * ModifyConversationList |
|
105 * This is for handling modify conversation asynchronusly |
|
106 * from the server |
|
107 * |
|
108 * @param aClientConversation client conversation |
|
109 */ |
|
110 |
|
111 void ModifyConversationList( |
|
112 const CCsClientConversation& aClientConversation); |
|
113 |
|
114 /** |
|
115 * RefreshConversationList |
|
116 * This is for handling refresh asynchronusly from the server. |
|
117 */ |
|
118 void RefreshConversationList(); |
|
119 |
|
120 private: |
|
121 |
|
122 /** |
|
123 * IssueRequest |
|
124 * Make the active object alive |
|
125 */ |
|
126 void IssueRequest(); |
|
127 |
|
128 /** |
|
129 * Handles Conversation List received from server and updates into model |
|
130 */ |
|
131 void HandleConversationListL(); |
|
132 |
|
133 private: |
|
134 // data |
|
135 |
|
136 enum ConvListChangeHandlerStates |
|
137 { |
|
138 EInit = 200, |
|
139 EInitialCache, |
|
140 EListenToEvents |
|
141 }; |
|
142 |
|
143 /** |
|
144 * mCurrentState |
|
145 * Holds Current state |
|
146 */ |
|
147 ConvListChangeHandlerStates mCurrentState; |
|
148 |
|
149 /** |
|
150 * First list of conversation List entires updated |
|
151 * Own. |
|
152 */ |
|
153 TBool mFirstWindowCached; |
|
154 |
|
155 /** |
|
156 * Current entry being processed |
|
157 * Own. |
|
158 */ |
|
159 TInt mCurrentIndex; |
|
160 |
|
161 /** |
|
162 * ConversationsSummaryModel object |
|
163 * Not Own. |
|
164 */ |
|
165 ConversationsSummaryModel* mConvSummaryModel; |
|
166 |
|
167 /** |
|
168 * ConversationsEnginePrivate object |
|
169 * Not Own. |
|
170 */ |
|
171 ConversationsEnginePrivate* mConvEnginePrivate; |
|
172 |
|
173 /** |
|
174 * List of CCsClientConversation entries |
|
175 * Own. |
|
176 */ |
|
177 RPointerArray<CCsClientConversation> mClientConversationList; |
|
178 |
|
179 }; |
|
180 |
|
181 #endif // CONVERSATIONSLIST_CHANGEHANDLER_H |
|
182 // EOF |