author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:55:16 +0300 | |
branch | RCL_3 |
changeset 31 | 8baec10861af |
parent 30 | a5a39a295112 |
permissions | -rw-r--r-- |
30 | 1 |
/* |
2 |
* Copyright (c) 2009 - 2010 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: MCS settings plug-in container. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef CMCSPLUGINSETTINGSCONTAINER_H |
|
20 |
#define CMCSPLUGINSETTINGSCONTAINER_H |
|
21 |
||
22 |
// External includes |
|
23 |
#include <gsbasecontainer.h> |
|
24 |
#include <mcsmenu.h> |
|
25 |
#include <mcsmenunotifier.h> |
|
26 |
#include <favouritesdbobserver.h> // For MFavouritesDbObserver |
|
27 |
#include <favouritesdb.h> // For RFavouritesDb |
|
28 |
#include <msvapi.h> // For MMsvSessionObserver |
|
29 |
||
30 |
// Internal includes |
|
31 |
#include "mcspluginwatcher.h" |
|
32 |
||
33 |
// Forward declaration |
|
34 |
class CAknRadioButtonSettingPage; |
|
35 |
class CMCSPluginSettingsModel; |
|
36 |
class CActiveFavouritesDbNotifier; |
|
37 |
class CMCSPluginWatcher; |
|
38 |
||
39 |
/** |
|
40 |
* @ingroup group_mcsplugin |
|
41 |
* |
|
42 |
* Shortcut settings plug-in container |
|
43 |
* |
|
44 |
* @lib mcspluginsettings.lib |
|
45 |
* @since S60 v3.2 |
|
46 |
*/ |
|
47 |
class CMCSPluginSettingsContainer : public CGSBaseContainer, |
|
48 |
public MFavouritesDbObserver, public MMsvSessionObserver, |
|
49 |
public MMCSPluginWatcherObserver |
|
50 |
{ |
|
51 |
||
52 |
public: |
|
53 |
/** |
|
54 |
* Public constructor |
|
55 |
*/ |
|
56 |
CMCSPluginSettingsContainer(); |
|
57 |
||
58 |
/* |
|
59 |
* Descructor |
|
60 |
*/ |
|
61 |
virtual ~CMCSPluginSettingsContainer(); |
|
62 |
||
63 |
/** |
|
64 |
* Sets pointer to settings plug-in model. |
|
65 |
* |
|
66 |
* @since S60 v3.2 |
|
67 |
* @param aModel Pointer to settings plug-in model |
|
68 |
*/ |
|
69 |
void SetModel(CMCSPluginSettingsModel* aModel); |
|
70 |
||
71 |
/** |
|
72 |
* Handles a setting change command |
|
73 |
* |
|
74 |
* @since S60 v3.2 |
|
75 |
*/ |
|
76 |
void HandleChangeCommandL(); |
|
77 |
||
78 |
/** |
|
79 |
* Handles a help command |
|
80 |
* |
|
81 |
* @since S60 v9.1 |
|
82 |
*/ |
|
83 |
void HandleHelpCommandL(); |
|
84 |
||
85 |
/** |
|
86 |
* Close change dialog |
|
87 |
* |
|
88 |
* @since S60 v3.2 |
|
89 |
*/ |
|
90 |
void CloseChangeDialog(); |
|
91 |
||
92 |
/** |
|
93 |
* Reset current list |
|
94 |
* |
|
95 |
* @since S60 v3.2 |
|
96 |
*/ |
|
97 |
void ResetCurrentListL(TInt aIndex); |
|
98 |
||
99 |
// from base class MMsvSessionObserver |
|
100 |
||
101 |
/** |
|
102 |
* Handles an event from the message server. |
|
103 |
* Not used, but must be defined to be able to use the messaging server. |
|
104 |
* |
|
105 |
* @since S60 v3.2 |
|
106 |
* @param aEvent Indicates the event type. |
|
107 |
* @param aArg1 Event type-specific argument value |
|
108 |
* @param aArg2 Event type-specific argument value |
|
109 |
* @param aArg3 Event type-specific argument value |
|
110 |
*/ |
|
111 |
void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, |
|
112 |
TAny* aArg2, TAny* aArg3 ); |
|
113 |
||
114 |
// from base class MMCSPluginWatcherObserver |
|
115 |
||
116 |
/** |
|
117 |
* Hanle notify |
|
118 |
*/ |
|
119 |
void HandleNotifyL(); |
|
31
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
120 |
|
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
121 |
/** |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
122 |
* Sets currently selected index |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
123 |
*/ |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
124 |
void SetCurrentItemIndex(TInt aIdx); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
125 |
|
30 | 126 |
private: |
127 |
||
128 |
/* |
|
129 |
* Leaving constructor |
|
130 |
* |
|
131 |
* @param aRect |
|
132 |
*/ |
|
133 |
void ConstructL(const TRect& aRect); |
|
134 |
||
135 |
/** |
|
136 |
* Tells the settings container to start observing for changes in favorites |
|
137 |
* database and mailbox db. |
|
138 |
* |
|
139 |
*/ |
|
140 |
void StartObservingL(); |
|
141 |
||
142 |
/** |
|
143 |
* Tells the settings container to stop observing for changes in favorites |
|
144 |
* database and mailbox db. |
|
145 |
* |
|
146 |
*/ |
|
147 |
void StopObserving(); |
|
148 |
||
149 |
// from base class CGSBaseContainer |
|
150 |
||
151 |
/** |
|
152 |
* From CGSBaseContainer |
|
153 |
* Constructs the settings listbox |
|
154 |
* |
|
155 |
* @since S60 v3.2 |
|
156 |
* @param aResLbxId Listbox resource id |
|
157 |
*/ |
|
158 |
void ConstructListBoxL(TInt aResLbxId); |
|
159 |
||
160 |
/** |
|
161 |
* Chandles a setting change command to select application from a list |
|
162 |
* |
|
163 |
* @since S60 v3.2 |
|
164 |
* @param aItem Applist item to modify |
|
165 |
* @param aNew ETrue if selecting an application for first time, |
|
166 |
* EFalse if not |
|
167 |
* @return ETrue if shortcut was changed. EFalse if not |
|
168 |
*/ |
|
169 |
TBool HandleAppListChangeCommandL( const TInt& aIndex, |
|
170 |
const TInt& aSettingIndex ); |
|
171 |
||
172 |
/** |
|
173 |
* Chandles a setting change command to select bookmark from a list |
|
174 |
* |
|
175 |
* @since S60 v3.2 |
|
176 |
* @param aItem Applist item to modify |
|
177 |
* @param aNew ETrue if selecting an application for first time, |
|
178 |
* EFalse if not |
|
179 |
* @return ETrue if shortcut was changed. EFalse if not |
|
180 |
*/ |
|
181 |
TBool HandleBookmarkChangeCommandL( const TInt& aIndex, |
|
182 |
const TInt& aSettingIndex ); |
|
183 |
||
184 |
/** |
|
185 |
* Creates Help Context for launching Shortcuts Help page. |
|
186 |
*/ |
|
187 |
TCoeHelpContext GetHelpContext() const; |
|
188 |
||
189 |
/** |
|
190 |
* Offer key event |
|
191 |
* |
|
192 |
* @param aKeyEvent |
|
193 |
* @param aType |
|
194 |
*/ |
|
195 |
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
196 |
||
197 |
/** |
|
198 |
* Checks if there is a need to update the middle softkey label. |
|
199 |
*/ |
|
200 |
void CheckMiddleSoftkeyLabel(); |
|
201 |
||
202 |
// From MFavouritesDbObserver |
|
203 |
/** |
|
204 |
* Handles database event. |
|
205 |
* @param aEvent Database event. |
|
206 |
*/ |
|
207 |
void HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent); |
|
208 |
||
209 |
private: // data |
|
210 |
||
211 |
/** |
|
212 |
* Settings plug-in model. |
|
213 |
* Not own. |
|
214 |
*/ |
|
215 |
CMCSPluginSettingsModel* iModel; |
|
216 |
||
217 |
/** |
|
218 |
* Application selection list page. |
|
219 |
* Own. |
|
220 |
*/ |
|
221 |
CAknRadioButtonSettingPage* iAppListDialog; |
|
222 |
||
223 |
/** |
|
224 |
* Bookmark selection list page. |
|
225 |
* Own. |
|
226 |
*/ |
|
227 |
CAknRadioButtonSettingPage* iBkmListDialog; |
|
228 |
||
229 |
/** |
|
230 |
* Bookmark database change observer. |
|
231 |
* Own. |
|
232 |
*/ |
|
233 |
CActiveFavouritesDbNotifier* iBookmarkDbObserver; |
|
234 |
||
235 |
/** |
|
236 |
* Bookmark database. |
|
237 |
*/ |
|
238 |
RFavouritesDb iBookmarkDb; |
|
239 |
||
240 |
/** |
|
241 |
* Bookmark database session. |
|
242 |
*/ |
|
243 |
RFavouritesSession iBookmarkSession; |
|
244 |
||
245 |
/** |
|
246 |
* Message server session |
|
247 |
* Own. |
|
248 |
*/ |
|
249 |
CMsvSession* iMsvSession; |
|
250 |
||
251 |
// MCS resource |
|
252 |
RMenu iMenu; |
|
253 |
||
254 |
// MCS change notifier |
|
255 |
RMenuNotifier iNotifier; |
|
256 |
||
257 |
/* MCS change notifier watcher |
|
258 |
* Own |
|
259 |
*/ |
|
260 |
CMCSPluginWatcher* iNotifyWatcher; |
|
261 |
}; |
|
262 |
||
263 |
#endif // CMCSPLUGINSETTINGSCONTAINER_H |
|
264 |
||
265 |
// End of File. |