author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:55:16 +0300 | |
branch | RCL_3 |
changeset 118 | 8baec10861af |
parent 114 | a5a39a295112 |
child 130 | 67f2ed48ad91 |
permissions | -rw-r--r-- |
114 | 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: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef CMCSPLUGINENGINE_H |
|
20 |
#define CMCSPLUGINENGINE_H |
|
21 |
||
22 |
// System includes |
|
23 |
#include <e32base.h> |
|
24 |
#include <mcsmenu.h> |
|
25 |
#include <mcsmenuitem.h> |
|
26 |
#include <mcsmenunotifier.h> |
|
27 |
#include <msvapi.h> |
|
28 |
||
29 |
// User includes |
|
30 |
#include "mcspluginwatcher.h" |
|
31 |
||
32 |
// Forward declarations |
|
33 |
class CGulIcon; |
|
34 |
class CMCSPluginData; |
|
35 |
class CMCSData; |
|
36 |
class CMCSPlugin; |
|
37 |
||
38 |
||
39 |
/** |
|
40 |
* @ingroup group_mcsplugin |
|
41 |
* |
|
42 |
* MCSPluginEngine class |
|
43 |
* |
|
44 |
* @since S60 5.2 |
|
45 |
*/ |
|
46 |
NONSHARABLE_CLASS( CMCSPluginEngine ) : public CBase, |
|
47 |
public MMCSPluginWatcherObserver, |
|
48 |
public MMsvSessionObserver |
|
49 |
{ |
|
50 |
public: |
|
51 |
// constructor and destructor |
|
52 |
||
53 |
/** |
|
54 |
* Part of the two phased constuction |
|
55 |
* |
|
56 |
* @param aPlugin |
|
57 |
* @param aInstanceUid |
|
58 |
* @return Pointer to the created CMCSPluginEngine object |
|
59 |
*/ |
|
60 |
static CMCSPluginEngine* NewL( CMCSPlugin& aPlugin, |
|
61 |
const TDesC8& aInstanceUid ); |
|
62 |
||
63 |
/** |
|
64 |
* Destructor |
|
65 |
* |
|
66 |
* @param none |
|
67 |
* @return none |
|
68 |
*/ |
|
69 |
~CMCSPluginEngine(); |
|
70 |
||
71 |
private: |
|
72 |
// constructors |
|
73 |
||
74 |
/** |
|
75 |
* C++ default constructor |
|
76 |
*/ |
|
77 |
CMCSPluginEngine( CMCSPlugin& aPlugin, const TDesC8& aInstanceUid ); |
|
78 |
||
79 |
/* |
|
80 |
* 2nd phase constructor |
|
81 |
*/ |
|
82 |
void ConstructL(); |
|
83 |
||
84 |
public: |
|
85 |
// new functions |
|
86 |
||
87 |
/** |
|
88 |
* Gets the menu data. |
|
89 |
* |
|
90 |
* @param aIndex |
|
91 |
* @return TMCSData& |
|
92 |
*/ |
|
93 |
CMCSData& MenuDataL( const TInt& aIndex ); |
|
94 |
||
95 |
/** Gets the menu item count |
|
96 |
* |
|
97 |
* @return TInt |
|
98 |
*/ |
|
99 |
TInt MenuItemCount(); |
|
100 |
||
101 |
/** |
|
102 |
* Finds the menu item header for given filter. |
|
103 |
* |
|
104 |
* @param aFilter |
|
105 |
* @return TMenuItem |
|
106 |
*/ |
|
107 |
TMenuItem FindMenuItemL( CMenuFilter& aFilter ); |
|
108 |
||
109 |
/** |
|
110 |
* Retrieves the menu item object from MCS. |
|
111 |
* |
|
112 |
* @param aMenuItem |
|
113 |
* @return CMenuItem* |
|
114 |
*/ |
|
115 |
CMenuItem* FetchMenuItemL( CMCSData& aData); |
|
116 |
||
117 |
/** |
|
118 |
* Returns icon for given menu item and given attribute |
|
119 |
* |
|
120 |
* @param aMenuItem |
|
121 |
* @param aAttr |
|
122 |
* @return CGulIcon* |
|
123 |
*/ |
|
124 |
CGulIcon* ItemIconL( CMenuItem* aMenuItem, const TDesC& aAttr ); |
|
125 |
||
126 |
/** |
|
127 |
* Returns text for given menu item and given attribute |
|
128 |
* |
|
129 |
* @param aMenuItem |
|
130 |
* @param aAttr |
|
131 |
*/ |
|
132 |
TPtrC ItemTextL( CMenuItem* aMenuItem, const TDesC& aAttr ); |
|
133 |
||
134 |
/** |
|
135 |
* Launches menu item |
|
136 |
* |
|
137 |
* @param aIndex |
|
138 |
*/ |
|
139 |
void LaunchItemL( const TInt& aIndex ); |
|
140 |
||
141 |
/** |
|
142 |
* Set backup/restore state |
|
143 |
* |
|
144 |
* @param aBackupRestore ETrue if backup/restore is ongoing |
|
145 |
* @return void |
|
146 |
*/ |
|
147 |
void SetBackupRestore( TBool aBackupRestore ); |
|
148 |
||
149 |
/** |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
150 |
* Shows shortcut settings |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
151 |
* |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
152 |
* @param aEditIdx Change specified shortcut |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
153 |
* @return void |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
154 |
*/ |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
155 |
void ShowSettingsL( const TInt aEditIdx ); |
114 | 156 |
|
157 |
private: |
|
158 |
// from MMCSPluginWatcherObserver |
|
159 |
||
160 |
/** |
|
161 |
* @see MMCSPluginWatcherObserver |
|
162 |
*/ |
|
163 |
void HandleNotifyL(); |
|
164 |
||
165 |
private: |
|
166 |
// from MMsvSessionObserver |
|
167 |
||
168 |
/** |
|
169 |
* @see MMsvSessionObserver |
|
170 |
*/ |
|
171 |
void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, |
|
172 |
TAny* aArg2, TAny* aArg3 ); |
|
173 |
||
174 |
private: |
|
175 |
// new functions |
|
176 |
||
177 |
/** |
|
178 |
* InitL |
|
179 |
*/ |
|
180 |
void InitL(); |
|
181 |
||
182 |
/** |
|
183 |
* Tells the settings container to start observing |
|
184 |
* for changes in mailbox db and changes in MCS. |
|
185 |
*/ |
|
186 |
void StartObservingL(); |
|
187 |
||
188 |
/** |
|
189 |
* Tells the settings container to stop observing |
|
190 |
* for changes in mailbox db. |
|
191 |
*/ |
|
192 |
void StopObserving(); |
|
193 |
||
194 |
/** |
|
195 |
* ConstructMenuItemForIconL |
|
196 |
* |
|
197 |
* @param aPath |
|
198 |
* @param aMenuItem |
|
199 |
* @return TBool |
|
200 |
*/ |
|
201 |
TBool ConstructMenuItemForIconL( |
|
202 |
const TDesC& aPath, CMenuItem& aMenuItem ); |
|
203 |
||
204 |
/** |
|
205 |
* Creates bookmark specific MCS menu item. |
|
206 |
*/ |
|
207 |
CMenuItem* CreateBkmItemL( CMCSData& aData ); |
|
208 |
||
209 |
/** |
|
210 |
* Creates mailbox specific MCS menu item. |
|
211 |
*/ |
|
212 |
CMenuItem* CreateMailboxItemL( CMCSData& aData ); |
|
213 |
||
214 |
void LaunchFolderItemL( CMCSData& aData ); |
|
215 |
||
216 |
void LaunchBookmarkItemL( CMCSData& aData ); |
|
217 |
||
218 |
void LaunchMailboxItemL( CMCSData& aData ); |
|
219 |
||
220 |
void LaunchMCSItemL( CMCSData& aData ); |
|
221 |
||
222 |
private: |
|
223 |
// data |
|
224 |
||
225 |
/** Plugin data, owned */ |
|
226 |
CMCSPluginData* iPluginData; |
|
227 |
/** MCS resource handle, owned */ |
|
228 |
RMenu iMenu; |
|
229 |
/** MCS change notifier handle, owned */ |
|
230 |
RMenuNotifier iNotifier; |
|
231 |
/** MCS asynchronous operation watcher, owned */ |
|
232 |
CMCSPluginWatcher* iWatcher; |
|
233 |
/** MCS change notifier watcher, owned */ |
|
234 |
CMCSPluginWatcher* iNotifyWatcher; |
|
235 |
/** MCS plugin, not owned */ |
|
236 |
CMCSPlugin& iPlugin; |
|
237 |
/** Reference to plugin owned instanceUid */ |
|
238 |
const TDesC8& iInstanceUid; |
|
239 |
/** Flag Indicating that backup/restore is in progress */ |
|
240 |
TBool iBackupRestore; |
|
241 |
/** Offset of resource file */ |
|
242 |
TInt iResourceOffset; |
|
243 |
/** Message server session, owned */ |
|
244 |
CMsvSession* iMsvSession; |
|
245 |
/** "Undefined" menu item, owned */ |
|
246 |
CMenuItem* iUndefinedItem; |
|
247 |
/** "Undefined" menu item header */ |
|
248 |
TMenuItem iUndefinedItemHeader; |
|
249 |
}; |
|
250 |
||
251 |
#endif // CMCSPLUGINENGINE_H |
|
252 |
||
253 |
// End of file |