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 122 | 6cadd6867c17 |
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: The engine class of MCS plugin. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
#include <gulicon.h> |
|
20 |
#include <gslauncher.h> |
|
21 |
#include <mcsmenufilter.h> |
|
22 |
#include <mcsmenuoperation.h> |
|
23 |
#include <mcsmenuiconutility.h> |
|
24 |
#include <bautils.h> |
|
25 |
#include <StringLoader.h> |
|
26 |
#include <aknnotedialog.h> |
|
27 |
#include <mcspluginres.rsg> |
|
28 |
#include <apgcli.h> |
|
29 |
#include <apacmdln.h> |
|
30 |
#include <gfxtranseffect/gfxtranseffect.h> |
|
31 |
#include <akntranseffect.h> |
|
32 |
#include <schemehandler.h> |
|
33 |
#include <viewcli.h> // For CVwsSessionWrapper |
|
34 |
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
35 |
#include <viewclipartner.h> |
|
36 |
#endif |
|
37 |
#include <aisystemuids.hrh> |
|
38 |
||
39 |
// User includes |
|
40 |
#include "mcspluginengine.h" |
|
41 |
#include "mcsplugin.h" |
|
42 |
#include "mcsplugindata.h" |
|
43 |
#include "mcspluginuids.hrh" |
|
44 |
||
45 |
// Constants |
|
46 |
_LIT( KMyMenuData, "matrixmenudata" ); |
|
47 |
_LIT( KSkin, "skin" ); |
|
48 |
_LIT( KMif, "mif" ); |
|
49 |
_LIT( KResourceDrive, "Z:" ); |
|
50 |
_LIT( KResourceFile, "mcspluginres.rsc" ); |
|
51 |
_LIT( KResPath, "\\resource\\" ); |
|
52 |
_LIT( KMMApplication, "mm://" ); |
|
53 |
_LIT( KSetFocusString, "!setfocus?applicationgroup_name=" ); |
|
54 |
_LIT( KApplicationGroupName, "applicationgroup_name" ); |
|
55 |
_LIT( KIcon, "icon" ); |
|
56 |
_LIT( KMenuAttrUndefUid, "0x99999991" ); |
|
57 |
_LIT( KMenuIconFile, "aimcsplugin.mif" ); |
|
58 |
_LIT( KMenuBookmarkIconId, "16386" ); |
|
59 |
_LIT( KMenuBookmarkMaskId, "16387" ); |
|
60 |
_LIT( KMenuMailboxIconId, "16388" ); |
|
61 |
_LIT( KMenuMailboxMaskId, "16389" ); |
|
62 |
_LIT( KMenuTypeMailbox, "menu:mailbox" ); |
|
63 |
_LIT( KPrefix, "0x" ); |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
64 |
_LIT( KMenuAttrInvokeSettingsUid, "0x99999990" ); |
114 | 65 |
|
66 |
const TUid KHomescreenUid = { AI_UID3_AIFW_COMMON }; |
|
67 |
const TUid KMMUid = { 0x101F4CD2 }; |
|
68 |
const TUid KMCSCmailUidValue = { 0x2001E277 }; |
|
69 |
const TUid KMCSCmailMailboxViewIdValue = { 0x2 }; |
|
70 |
const TUid KBrowserUid = { 0x10008D39 }; |
|
71 |
||
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
72 |
// maximum custom message length |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
73 |
const TInt KMaxCustomMsg = 256; |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
74 |
const TInt KUndefinedIndex = -1; |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
75 |
|
114 | 76 |
// ======== LOCAL FUNCTIONS ======== |
77 |
// ---------------------------------------------------------------------------- |
|
78 |
// NextIdToken |
|
79 |
// ---------------------------------------------------------------------------- |
|
80 |
// |
|
81 |
static TPtrC NextIdToken( TLex& aLexer ) |
|
82 |
{ |
|
83 |
aLexer.SkipSpace(); |
|
84 |
aLexer.Mark(); |
|
85 |
||
86 |
while( !aLexer.Eos() && !aLexer.Peek().IsSpace() && aLexer.Peek() != ')' ) |
|
87 |
{ |
|
88 |
aLexer.Inc(); |
|
89 |
} |
|
90 |
||
91 |
return aLexer.MarkedToken(); |
|
92 |
} |
|
93 |
||
94 |
// ---------------------------------------------------------------------------- |
|
95 |
// Shows note dailog, with the given resource. |
|
96 |
// ---------------------------------------------------------------------------- |
|
97 |
// |
|
98 |
static void ShowNoteDlgL( TInt aResource ) |
|
99 |
{ |
|
100 |
HBufC* temp = StringLoader::LoadLC( aResource ); |
|
101 |
||
102 |
CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog( |
|
103 |
CAknNoteDialog::EConfirmationTone, |
|
104 |
CAknNoteDialog::ENoTimeout ); |
|
105 |
CleanupStack::PushL( dialog ); |
|
106 |
dialog->SetTextL( temp->Des() ); |
|
107 |
dialog->ExecuteDlgLD( R_MCS_DISABLE_OPEN_ITEM_DLG ); |
|
108 |
CleanupStack::Pop( dialog ); |
|
109 |
CleanupStack::PopAndDestroy( temp ); |
|
110 |
} |
|
111 |
||
112 |
// ---------------------------------------------------------------------------- |
|
113 |
// Parses uid in Hexadecimal format from the given string. |
|
114 |
// ---------------------------------------------------------------------------- |
|
115 |
// |
|
116 |
TUid ParseHexUidFromString(const TDesC& aUidString ) |
|
117 |
{ |
|
118 |
TUid uid( KNullUid ); |
|
119 |
const TInt pos( aUidString.FindF( KPrefix ) ); |
|
120 |
||
121 |
if ( pos != KErrNotFound ) |
|
122 |
{ |
|
123 |
TLex lex( aUidString.Mid( pos + KPrefix().Length() ) ); |
|
124 |
||
125 |
// Hex parsing needs unsigned int |
|
126 |
TUint32 value( 0 ); |
|
127 |
const TInt parseResult( lex.Val( value, EHex ) ); |
|
128 |
||
129 |
if ( parseResult == KErrNone ) |
|
130 |
{ |
|
131 |
TInt32 value32( value ); |
|
132 |
uid.iUid = value32; |
|
133 |
} |
|
134 |
} |
|
135 |
return uid; |
|
136 |
} |
|
137 |
||
138 |
// ---------------------------------------------------------------------------- |
|
139 |
// Start transition effect. User has launched the application with the given uid. |
|
140 |
// ---------------------------------------------------------------------------- |
|
141 |
// |
|
142 |
void StartEffect( TUid aUid ) |
|
143 |
{ |
|
144 |
//start a full screen effect |
|
145 |
GfxTransEffect::BeginFullScreen( |
|
146 |
AknTransEffect::EApplicationStart, |
|
147 |
TRect(), |
|
148 |
AknTransEffect::EParameterType, |
|
149 |
AknTransEffect::GfxTransParam( aUid, |
|
150 |
AknTransEffect::TParameter::EActivateExplicitContinue )); |
|
151 |
} |
|
152 |
||
153 |
// ============================ MEMBER FUNCTIONS =============================== |
|
154 |
// ---------------------------------------------------------------------------- |
|
155 |
// CMCSPluginEngine::CMCSPluginEngine |
|
156 |
// |
|
157 |
// ---------------------------------------------------------------------------- |
|
158 |
// |
|
159 |
CMCSPluginEngine::CMCSPluginEngine( CMCSPlugin& aPlugin, |
|
160 |
const TDesC8& aInstanceUid ) |
|
161 |
: iPlugin( aPlugin ), iInstanceUid( aInstanceUid ) |
|
162 |
{ |
|
163 |
} |
|
164 |
||
165 |
// ---------------------------------------------------------------------------- |
|
166 |
// CMCSPluginEngine::NewL |
|
167 |
// |
|
168 |
// ---------------------------------------------------------------------------- |
|
169 |
// |
|
170 |
CMCSPluginEngine* CMCSPluginEngine::NewL( CMCSPlugin& aPlugin, |
|
171 |
const TDesC8& aInstanceUid ) |
|
172 |
{ |
|
173 |
CMCSPluginEngine* self = |
|
174 |
new( ELeave ) CMCSPluginEngine( aPlugin, aInstanceUid ); |
|
175 |
||
176 |
CleanupStack::PushL( self ); |
|
177 |
self->ConstructL(); |
|
178 |
CleanupStack::Pop( self ); |
|
179 |
||
180 |
return self; |
|
181 |
} |
|
182 |
||
183 |
// ---------------------------------------------------------------------------- |
|
184 |
// CMCSPluginEngine::ConstructL |
|
185 |
// |
|
186 |
// ---------------------------------------------------------------------------- |
|
187 |
// |
|
188 |
void CMCSPluginEngine::ConstructL() |
|
189 |
{ |
|
190 |
TFullName resourceFile( KResourceDrive ); |
|
191 |
resourceFile.Append( KResPath ); |
|
192 |
resourceFile.Append( KResourceFile ); |
|
193 |
BaflUtils::NearestLanguageFile( |
|
194 |
CCoeEnv::Static()->FsSession(), |
|
195 |
resourceFile ); |
|
196 |
iResourceOffset = |
|
197 |
CCoeEnv::Static()->AddResourceFileL( resourceFile ); |
|
198 |
InitL(); |
|
199 |
StartObservingL(); |
|
200 |
||
201 |
// Get "Undefined" item |
|
202 |
CMenuFilter* filter = CMenuFilter::NewL(); |
|
203 |
CleanupStack::PushL( filter ); |
|
204 |
filter->HaveAttributeL( KMenuAttrUid, KMenuAttrUndefUid ); |
|
205 |
iUndefinedItemHeader = FindMenuItemL( *filter ); |
|
206 |
CleanupStack::PopAndDestroy( filter ); |
|
207 |
iUndefinedItem = CMenuItem::OpenL( iMenu, iUndefinedItemHeader ); |
|
208 |
} |
|
209 |
||
210 |
// ---------------------------------------------------------------------------- |
|
211 |
// CMCSPluginEngine::~CMCSPluginEngine |
|
212 |
// |
|
213 |
// ---------------------------------------------------------------------------- |
|
214 |
// |
|
215 |
CMCSPluginEngine::~CMCSPluginEngine() |
|
216 |
{ |
|
217 |
StopObserving(); |
|
218 |
||
219 |
delete iPluginData; |
|
220 |
||
221 |
// Notifier close has to be before iMenu close |
|
222 |
iNotifier.Close(); |
|
223 |
iMenu.Close(); |
|
224 |
delete iWatcher; |
|
225 |
delete iNotifyWatcher; |
|
226 |
||
227 |
CCoeEnv::Static()->DeleteResourceFile( iResourceOffset ); |
|
228 |
||
229 |
delete iUndefinedItem; |
|
230 |
} |
|
231 |
||
232 |
// --------------------------------------------------------------------------- |
|
233 |
// CMCSPluginEngine::InitL |
|
234 |
// |
|
235 |
// --------------------------------------------------------------------------- |
|
236 |
// |
|
237 |
void CMCSPluginEngine::InitL() |
|
238 |
{ |
|
239 |
iMenu.OpenL( KMyMenuData ); |
|
240 |
iPluginData = CMCSPluginData::NewL( *this, iInstanceUid ); |
|
241 |
iWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); |
|
242 |
||
243 |
TInt err( iNotifier.Open( iMenu ) ); |
|
244 |
||
245 |
if ( err == KErrNone ) |
|
246 |
{ |
|
247 |
iNotifyWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::ENotify ); |
|
248 |
||
249 |
iNotifier.Notify( 0, |
|
250 |
RMenuNotifier::EItemsAddedRemoved, |
|
251 |
iNotifyWatcher->iStatus ); |
|
252 |
iNotifyWatcher->WatchNotify( this ); |
|
253 |
} |
|
254 |
} |
|
255 |
||
256 |
// --------------------------------------------------------------------------- |
|
257 |
// CMCSPluginEngine::StartObservingL |
|
258 |
// |
|
259 |
// --------------------------------------------------------------------------- |
|
260 |
// |
|
261 |
void CMCSPluginEngine::StartObservingL() |
|
262 |
{ |
|
263 |
// registering to mailbox db. changes observing |
|
264 |
iMsvSession = CMsvSession::OpenAsObserverL( *this ); |
|
265 |
} |
|
266 |
||
267 |
// --------------------------------------------------------------------------- |
|
268 |
// CMCSPluginEngine::StopObserving |
|
269 |
// |
|
270 |
// --------------------------------------------------------------------------- |
|
271 |
// |
|
272 |
void CMCSPluginEngine::StopObserving() |
|
273 |
{ |
|
274 |
delete iMsvSession; |
|
275 |
iMsvSession = NULL; |
|
276 |
} |
|
277 |
||
278 |
// --------------------------------------------------------------------------- |
|
279 |
// CMCSPluginEngine::MenuDataL |
|
280 |
// |
|
281 |
// --------------------------------------------------------------------------- |
|
282 |
// |
|
283 |
CMCSData& CMCSPluginEngine::MenuDataL( const TInt& aIndex ) |
|
284 |
{ |
|
285 |
return iPluginData->DataItemL( aIndex ); |
|
286 |
} |
|
287 |
||
288 |
// --------------------------------------------------------------------------- |
|
289 |
// CMCSPluginEngine::MenuItemCount |
|
290 |
// |
|
291 |
// --------------------------------------------------------------------------- |
|
292 |
// |
|
293 |
TInt CMCSPluginEngine::MenuItemCount() |
|
294 |
{ |
|
295 |
return iPluginData->DataCount(); |
|
296 |
} |
|
297 |
||
298 |
// --------------------------------------------------------------------------- |
|
299 |
// CMCSPluginEngine::FindMenuItemL |
|
300 |
// Returns the menu item header, which matches the given filter. |
|
301 |
// --------------------------------------------------------------------------- |
|
302 |
// |
|
303 |
TMenuItem CMCSPluginEngine::FindMenuItemL( CMenuFilter& aFilter ) |
|
304 |
{ |
|
305 |
TMenuItem item; |
|
306 |
const TInt root( iMenu.RootFolderL() ); |
|
307 |
||
308 |
RArray<TMenuItem> items; |
|
309 |
CleanupClosePushL( items ); |
|
310 |
||
311 |
iMenu.GetItemsL( items, root, &aFilter, ETrue ); |
|
312 |
||
313 |
if ( items.Count() > 0 ) |
|
314 |
{ |
|
315 |
item = items[0]; |
|
316 |
} |
|
317 |
||
318 |
CleanupStack::PopAndDestroy( &items ); |
|
319 |
||
320 |
return item; |
|
321 |
} |
|
322 |
||
323 |
// --------------------------------------------------------------------------- |
|
324 |
// CMCSPluginEngine::FetchMenuItemL |
|
325 |
// Returns the actual menu item for the given header. |
|
326 |
// --------------------------------------------------------------------------- |
|
327 |
// |
|
328 |
CMenuItem* CMCSPluginEngine::FetchMenuItemL( CMCSData& aData ) |
|
329 |
{ |
|
330 |
CMenuItem* item = NULL; |
|
331 |
||
332 |
TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ) ); |
|
333 |
||
334 |
if( item ) |
|
335 |
{ |
|
336 |
return item; |
|
337 |
} |
|
338 |
||
339 |
if( aData.MenuItem().Type() == KMenuTypeUrl ) |
|
340 |
{ |
|
341 |
item = CreateBkmItemL( aData ); |
|
342 |
} |
|
343 |
else if( aData.MenuItem().Type() == KMenuTypeMailbox ) |
|
344 |
{ |
|
345 |
item = CreateMailboxItemL( aData); |
|
346 |
} |
|
347 |
||
348 |
return item; |
|
349 |
} |
|
350 |
||
351 |
// --------------------------------------------------------------------------- |
|
352 |
// |
|
353 |
// --------------------------------------------------------------------------- |
|
354 |
// |
|
355 |
CMenuItem* CMCSPluginEngine::CreateBkmItemL( CMCSData& aData ) |
|
356 |
{ |
|
357 |
CMenuItem* item( NULL ); |
|
358 |
if( aData.MenuItem().Id() != KErrNotFound ) |
|
359 |
{ |
|
360 |
item = CMenuItem::CreateL( iMenu, KMenuTypeUrl, 0, 0 ); |
|
361 |
CleanupStack::PushL( item ); |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
362 |
item->SetAttributeL( KMenuAttrLongName, *aData.Name() ); |
114 | 363 |
item->SetAttributeL( KMenuAttrIconFile, KMenuIconFile ); |
364 |
item->SetAttributeL( KMenuAttrIconId, KMenuBookmarkIconId ); |
|
365 |
item->SetAttributeL( KMenuAttrMaskId, KMenuBookmarkMaskId ); |
|
366 |
CleanupStack::Pop( item ); |
|
367 |
} |
|
368 |
return item; |
|
369 |
} |
|
370 |
||
371 |
// --------------------------------------------------------------------------- |
|
372 |
// |
|
373 |
// --------------------------------------------------------------------------- |
|
374 |
// |
|
375 |
CMenuItem* CMCSPluginEngine::CreateMailboxItemL( CMCSData& aData ) |
|
376 |
{ |
|
377 |
CMenuItem* item( NULL ); |
|
378 |
if( aData.MenuItem().Id() != KErrNotFound ) |
|
379 |
{ |
|
380 |
item = CMenuItem::CreateL( iMenu, KMenuTypeMailbox, 0, 0 ); |
|
381 |
CleanupStack::PushL( item ); |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
382 |
item->SetAttributeL( KMenuAttrLongName, *aData.Name() ); |
114 | 383 |
item->SetAttributeL( KMenuAttrIconFile, KMenuIconFile ); |
384 |
item->SetAttributeL( KMenuAttrIconId, KMenuMailboxIconId ); |
|
385 |
item->SetAttributeL( KMenuAttrMaskId, KMenuMailboxMaskId ); |
|
386 |
CleanupStack::Pop( item ); |
|
387 |
} |
|
388 |
return item; |
|
389 |
} |
|
390 |
||
391 |
// --------------------------------------------------------------------------- |
|
392 |
// CMCSPluginEngine::ItemIconL |
|
393 |
// Returns MCS default icon if attribute is 'icon' else parses the |
|
394 |
// skin definition from attribute and sets attributes to aMenuItem. |
|
395 |
// --------------------------------------------------------------------------- |
|
396 |
// |
|
397 |
CGulIcon* CMCSPluginEngine::ItemIconL( CMenuItem* aMenuItem, |
|
398 |
const TDesC& aAttr ) |
|
399 |
{ |
|
400 |
||
401 |
CMenuItem* menuItem; |
|
402 |
||
403 |
// check if item exists in MCS |
|
404 |
if ( aMenuItem ) |
|
405 |
{ |
|
406 |
TUint32 flags = aMenuItem->Flags(); |
|
407 |
TUint32 isHidden = flags & TMenuItem::EHidden; |
|
408 |
TUint32 isMissing = flags & TMenuItem::EMissing; |
|
409 |
||
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
410 |
TBool attrExists = ETrue; |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
411 |
TPtrC uid = aMenuItem->GetAttributeL(KMenuAttrUid, attrExists); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
412 |
|
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
413 |
// if item is hidden or missing (mmc card removed) |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
414 |
// use "Undefined" icon instead |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
415 |
// for empty item it's own icon is shown |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
416 |
if ( iUndefinedItem && uid.Compare(KMenuAttrInvokeSettingsUid) != 0 && |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
417 |
( isHidden || isMissing ) ) |
114 | 418 |
{ |
419 |
menuItem = iUndefinedItem; |
|
420 |
} |
|
421 |
else |
|
422 |
{ |
|
423 |
menuItem = aMenuItem; |
|
424 |
} |
|
425 |
} |
|
426 |
else |
|
427 |
{ |
|
428 |
// item not found in MCS. Use Undefined Icon |
|
429 |
menuItem = iUndefinedItem; |
|
430 |
} |
|
431 |
||
432 |
CAknIcon* icon( NULL ); |
|
433 |
CGulIcon* gIcon( NULL ); |
|
434 |
TBool exists( ETrue ); |
|
435 |
||
436 |
if ( aAttr != KIcon ) |
|
437 |
{ |
|
438 |
// Resolve secondary icon definition from attribute |
|
439 |
TPtrC iconDef( menuItem->GetAttributeL( aAttr, exists ) ); |
|
440 |
||
441 |
if ( exists ) |
|
442 |
{ |
|
443 |
exists = ConstructMenuItemForIconL( iconDef, *menuItem ); |
|
444 |
} |
|
445 |
} |
|
446 |
||
447 |
if ( exists ) |
|
448 |
{ |
|
449 |
icon = MenuIconUtility::GetItemIconL( *menuItem ); |
|
450 |
||
451 |
if ( icon ) |
|
452 |
{ |
|
453 |
CleanupStack::PushL( icon ); |
|
454 |
||
455 |
gIcon = CGulIcon::NewL( icon->Bitmap(), icon->Mask() ); |
|
456 |
||
457 |
// Detach and delete |
|
458 |
icon->SetBitmap( NULL ); |
|
459 |
icon->SetMask( NULL ); |
|
460 |
||
461 |
CleanupStack::PopAndDestroy( icon ); |
|
462 |
} |
|
463 |
} |
|
464 |
||
465 |
return gIcon; |
|
466 |
} |
|
467 |
||
468 |
// --------------------------------------------------------------------------- |
|
469 |
// CMCSPluginEngine::ItemTextL |
|
470 |
// Returns text string for the given attribute |
|
471 |
// --------------------------------------------------------------------------- |
|
472 |
// |
|
473 |
TPtrC CMCSPluginEngine::ItemTextL( CMenuItem* aMenuItem, const TDesC& aAttr ) |
|
474 |
{ |
|
475 |
||
476 |
CMenuItem* menuItem; |
|
477 |
||
478 |
// check if item exists in MCS |
|
479 |
if ( aMenuItem ) |
|
480 |
{ |
|
481 |
TUint32 flags = aMenuItem->Flags(); |
|
482 |
TUint32 isHidden = flags & TMenuItem::EHidden; |
|
483 |
TUint32 isMissing = flags & TMenuItem::EMissing; |
|
484 |
||
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
485 |
TBool attrExists = ETrue; |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
486 |
TPtrC uid = aMenuItem->GetAttributeL(KMenuAttrUid, attrExists); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
487 |
|
114 | 488 |
// if item is hidden or missing (mmc card removed) |
489 |
// use "Undefined" text instead |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
490 |
// for empty item it's own icon is shown |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
491 |
if ( iUndefinedItem && uid.Compare(KMenuAttrInvokeSettingsUid) != 0 && |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
492 |
( isHidden || isMissing ) ) |
114 | 493 |
{ |
494 |
menuItem = iUndefinedItem; |
|
495 |
} |
|
496 |
else |
|
497 |
{ |
|
498 |
menuItem = aMenuItem; |
|
499 |
} |
|
500 |
} |
|
501 |
else |
|
502 |
{ |
|
503 |
// item not found in MCS. Use "Undefined" text |
|
504 |
menuItem = iUndefinedItem; |
|
505 |
} |
|
506 |
||
507 |
TBool exists( KErrNotFound ); |
|
508 |
||
509 |
TPtrC name( menuItem->GetAttributeL( aAttr, exists ) ); |
|
510 |
||
511 |
if ( exists ) |
|
512 |
{ |
|
513 |
return name; |
|
514 |
} |
|
515 |
||
516 |
return KNullDesC(); |
|
517 |
} |
|
518 |
||
519 |
// --------------------------------------------------------------------------- |
|
520 |
// CMCSPluginEngine::LaunchItemL |
|
521 |
// Calls the open command for the given menu item header |
|
522 |
// --------------------------------------------------------------------------- |
|
523 |
// |
|
524 |
void CMCSPluginEngine::LaunchItemL( const TInt& aIndex ) |
|
525 |
{ |
|
526 |
if ( iBackupRestore ) |
|
527 |
{ |
|
528 |
ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM ); |
|
529 |
return; |
|
530 |
} |
|
531 |
||
532 |
CMCSData& dataItem( iPluginData->DataItemL( aIndex ) ); |
|
533 |
// run item based on its type |
|
534 |
TPtrC type( dataItem.MenuItem().Type()); |
|
535 |
||
536 |
// run folder |
|
537 |
if ( type == KMenuTypeFolder ) |
|
538 |
{ |
|
539 |
LaunchFolderItemL( dataItem ); |
|
540 |
} |
|
541 |
else if( type == KMenuTypeUrl ) |
|
542 |
{ |
|
543 |
LaunchBookmarkItemL( dataItem ); |
|
544 |
} |
|
545 |
else if( type == KMenuTypeMailbox ) |
|
546 |
{ |
|
547 |
LaunchMailboxItemL( dataItem ); |
|
548 |
} |
|
549 |
else |
|
550 |
{ |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
551 |
CMenuItem* item(CMenuItem::OpenL(iMenu, dataItem.MenuItem().Id())); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
552 |
CleanupStack::PushL(item); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
553 |
|
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
554 |
TBool attrExists = ETrue; |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
555 |
|
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
556 |
TPtrC uid = item->GetAttributeL(KMenuAttrUid, attrExists); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
557 |
|
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
558 |
// Show selected shortcut settings |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
559 |
if (uid.Compare(KMenuAttrInvokeSettingsUid) == 0) |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
560 |
{ |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
561 |
TRAP_IGNORE( ShowSettingsL(aIndex + 1) ); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
562 |
} |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
563 |
else |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
564 |
{ |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
565 |
LaunchMCSItemL(dataItem); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
566 |
} |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
567 |
CleanupStack::PopAndDestroy(item); |
114 | 568 |
} |
569 |
} |
|
570 |
||
571 |
// --------------------------------------------------------------------------- |
|
572 |
// |
|
573 |
// --------------------------------------------------------------------------- |
|
574 |
// |
|
575 |
void CMCSPluginEngine::LaunchFolderItemL( CMCSData& aData ) |
|
576 |
{ |
|
577 |
CMenuItem* item = NULL; |
|
578 |
TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ) ); |
|
579 |
||
580 |
// item does not exist at all in MCS |
|
581 |
if ( item == NULL ) |
|
582 |
{ |
|
583 |
ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING ); |
|
584 |
return; |
|
585 |
} |
|
586 |
||
587 |
CleanupStack::PushL( item ); |
|
588 |
||
589 |
StartEffect( KMMUid ); |
|
590 |
||
591 |
// message for MM application |
|
592 |
HBufC8* message; |
|
593 |
||
594 |
// prepare message for launching folder |
|
595 |
TBool hasApplicationGroupName( EFalse ); |
|
596 |
||
597 |
TPtrC applicationGroupName( item->GetAttributeL( |
|
598 |
KApplicationGroupName, hasApplicationGroupName ) ); |
|
599 |
||
600 |
if ( !hasApplicationGroupName ) |
|
601 |
{ |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
602 |
CleanupStack::PopAndDestroy( item ); |
114 | 603 |
return; |
604 |
} |
|
605 |
||
606 |
message = HBufC8::NewLC( KMMApplication().Length() + |
|
607 |
KSetFocusString().Length() + |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
608 |
applicationGroupName.Length() ); |
114 | 609 |
|
610 |
message->Des().Copy( KMMApplication ); |
|
611 |
message->Des().Append( KSetFocusString ); |
|
612 |
message->Des().Append( applicationGroupName ); |
|
613 |
||
614 |
// find MM application |
|
615 |
TApaTaskList taskList( CCoeEnv::Static()->WsSession() ); |
|
616 |
TApaTask task( taskList.FindApp( KMMUid ) ); |
|
617 |
||
618 |
if ( task.Exists() ) |
|
619 |
{ |
|
620 |
// MM is already running in background - send APA Message |
|
621 |
task.SendMessage( |
|
622 |
TUid::Uid( KUidApaMessageSwitchOpenFileValue ), *message ); |
|
623 |
} |
|
624 |
else |
|
625 |
{ |
|
626 |
// MM not running yet - use Command Line Tail |
|
627 |
RApaLsSession appArcSession; |
|
628 |
CleanupClosePushL( appArcSession ); |
|
629 |
||
630 |
User::LeaveIfError( appArcSession.Connect() ); |
|
631 |
||
632 |
TApaAppInfo appInfo; |
|
633 |
TInt err( appArcSession.GetAppInfo( appInfo, KMMUid ) ); |
|
634 |
||
635 |
if ( err == KErrNone ) |
|
636 |
{ |
|
637 |
CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); |
|
638 |
cmdLine->SetExecutableNameL( appInfo.iFullName ); |
|
639 |
cmdLine->SetCommandL( EApaCommandRun ); |
|
640 |
cmdLine->SetTailEndL( *message ); |
|
641 |
appArcSession.StartApp( *cmdLine ); |
|
642 |
CleanupStack::PopAndDestroy( cmdLine ); |
|
643 |
} |
|
644 |
CleanupStack::PopAndDestroy( &appArcSession ); |
|
645 |
} |
|
646 |
CleanupStack::PopAndDestroy( message ); |
|
647 |
CleanupStack::PopAndDestroy( item ); |
|
648 |
} |
|
649 |
||
650 |
// --------------------------------------------------------------------------- |
|
651 |
// |
|
652 |
// --------------------------------------------------------------------------- |
|
653 |
// |
|
654 |
void CMCSPluginEngine::LaunchBookmarkItemL( CMCSData& aData ) |
|
655 |
{ |
|
656 |
StartEffect( KBrowserUid ); |
|
657 |
||
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
658 |
CSchemeHandler* urlHandler = CSchemeHandler::NewL( *aData.Value()); |
114 | 659 |
CleanupStack::PushL( urlHandler ); |
660 |
urlHandler->HandleUrlStandaloneL(); |
|
661 |
CleanupStack::PopAndDestroy( urlHandler ); |
|
662 |
} |
|
663 |
||
664 |
// --------------------------------------------------------------------------- |
|
665 |
// |
|
666 |
// --------------------------------------------------------------------------- |
|
667 |
// |
|
668 |
void CMCSPluginEngine::LaunchMailboxItemL( CMCSData& aData ) |
|
669 |
{ |
|
670 |
TInt id( aData.MenuItem().Id()); |
|
671 |
if ( id == KErrNotFound ) |
|
672 |
{ |
|
673 |
ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING ); |
|
674 |
return; |
|
675 |
} |
|
676 |
||
677 |
StartEffect( KMCSCmailUidValue ); |
|
678 |
||
679 |
TUid uId = TUid::Uid( id ); |
|
680 |
const TVwsViewId viewId( KMCSCmailUidValue, KMCSCmailMailboxViewIdValue ); |
|
681 |
CVwsSessionWrapper* vwsSession = CVwsSessionWrapper::NewL(); |
|
682 |
vwsSession->CreateActivateViewEvent( viewId, uId, KNullDesC8() ); |
|
683 |
delete vwsSession; |
|
684 |
} |
|
685 |
||
686 |
// --------------------------------------------------------------------------- |
|
687 |
// |
|
688 |
// --------------------------------------------------------------------------- |
|
689 |
// |
|
690 |
void CMCSPluginEngine::LaunchMCSItemL( CMCSData& aData ) |
|
691 |
{ |
|
692 |
if( iWatcher->IsActive()) |
|
693 |
{ |
|
694 |
return; |
|
695 |
} |
|
696 |
CMenuItem* item = NULL; |
|
697 |
TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ) ); |
|
698 |
||
699 |
// item does not exist at all in MCS |
|
700 |
if ( item == NULL ) |
|
701 |
{ |
|
702 |
ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING ); |
|
703 |
return; |
|
704 |
} |
|
705 |
||
706 |
CleanupStack::PushL( item ); |
|
707 |
||
708 |
TBool attrExists = ETrue; |
|
709 |
TPtrC uid = item->GetAttributeL( KMenuAttrUid, attrExists ); |
|
710 |
||
711 |
// trying to run hidden or missing application (e.g. unistalled app |
|
712 |
// or app on MMC which was removed ) |
|
713 |
// -> We display a note for a user that this is not possible¨ |
|
714 |
TUint32 isHidden = item->Flags() & TMenuItem::EHidden; |
|
715 |
TUint32 isMissing = item->Flags() & TMenuItem::EMissing; |
|
716 |
||
717 |
if ( ( attrExists && uid == KMenuAttrUndefUid ) || isHidden || isMissing ) |
|
718 |
{ |
|
719 |
CleanupStack::PopAndDestroy( item ); |
|
720 |
ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING ); |
|
721 |
return; |
|
722 |
} |
|
723 |
||
724 |
if ( attrExists ) |
|
725 |
{ |
|
726 |
StartEffect( ParseHexUidFromString( uid )); |
|
727 |
} |
|
728 |
||
729 |
// run application/shortcut |
|
730 |
CMenuOperation* operation( item->HandleCommandL( |
|
731 |
KMenuCmdOpen, KNullDesC8, iWatcher->iStatus ) ); |
|
732 |
iWatcher->Watch( operation ); |
|
733 |
CleanupStack::PopAndDestroy( item ); |
|
734 |
} |
|
735 |
||
736 |
// --------------------------------------------------------------------------- |
|
737 |
// CMCSPluginEngine::HandleNotifyL |
|
738 |
// Handle the change in Menu Content |
|
739 |
// --------------------------------------------------------------------------- |
|
740 |
// |
|
741 |
void CMCSPluginEngine::HandleNotifyL() |
|
742 |
{ |
|
743 |
TInt count( iPluginData->DataCount() ); |
|
744 |
||
745 |
for ( TInt i = 0; i < count; i++ ) |
|
746 |
{ |
|
747 |
CMCSData& data( iPluginData->DataItemL( i ) ); |
|
748 |
data.SetDirty( ETrue ); |
|
749 |
} |
|
750 |
||
751 |
iPlugin.PublishL(); |
|
752 |
||
753 |
// Notification must be activated again |
|
754 |
iNotifyWatcher->Cancel(); |
|
755 |
iNotifier.Notify( 0, |
|
756 |
RMenuNotifier::EItemsAddedRemoved, |
|
757 |
iNotifyWatcher->iStatus ); |
|
758 |
||
759 |
iNotifyWatcher->WatchNotify( this ); |
|
760 |
} |
|
761 |
||
762 |
// --------------------------------------------------------------------------- |
|
763 |
// CMCSPluginEngine::HandleSessionEventL |
|
764 |
// Handles an event from the message server. |
|
765 |
// --------------------------------------------------------------------------- |
|
766 |
// |
|
767 |
void CMCSPluginEngine::HandleSessionEventL( TMsvSessionEvent aEvent, |
|
768 |
TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/) |
|
769 |
{ |
|
770 |
switch ( aEvent ) |
|
771 |
{ |
|
772 |
case EMsvEntriesDeleted: |
|
773 |
{ |
|
774 |
CMsvEntrySelection* sel = static_cast<CMsvEntrySelection*>( aArg1 ); |
|
775 |
TInt count( sel->Count()); |
|
776 |
for( TInt i = 0; i < count; i++ ) |
|
777 |
{ |
|
778 |
iPluginData->RemoveDataL( sel->At( i ) ); |
|
779 |
} |
|
780 |
} |
|
781 |
break; |
|
782 |
default: |
|
783 |
break; |
|
784 |
} |
|
785 |
} |
|
786 |
||
787 |
// --------------------------------------------------------------------------- |
|
788 |
// CMCSPluginEngine::SetBackupRestore |
|
789 |
// |
|
790 |
// --------------------------------------------------------------------------- |
|
791 |
// |
|
792 |
void CMCSPluginEngine::SetBackupRestore( TBool aBackupRestore ) |
|
793 |
{ |
|
794 |
iBackupRestore = aBackupRestore; |
|
795 |
} |
|
796 |
||
797 |
// --------------------------------------------------------------------------- |
|
798 |
// CMCSPluginEngine::ShowSettingsL |
|
799 |
// Launch General Settings plugin |
|
800 |
// --------------------------------------------------------------------------- |
|
801 |
// |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
802 |
void CMCSPluginEngine::ShowSettingsL( const TInt aEditIdx ) |
114 | 803 |
{ |
804 |
TUid uid = {AI_UID_ECOM_IMPLEMENTATION_SETTINGS_MCSPLUGIN}; |
|
805 |
||
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
806 |
// format the custom message |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
807 |
// iInstanceUid/aEditIdx is the format |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
808 |
TBuf8<KMaxCustomMsg> msg; |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
809 |
msg.Append(iInstanceUid); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
810 |
if( aEditIdx != KUndefinedIndex ) |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
811 |
{ |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
812 |
msg.Append('//'); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
813 |
msg.AppendFormat(_L8("%d"), aEditIdx); |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
814 |
} |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
815 |
|
114 | 816 |
CGSLauncher* launcher = CGSLauncher::NewLC(); |
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
817 |
launcher->LaunchGSViewL ( uid, KHomescreenUid, msg ); |
114 | 818 |
CleanupStack::PopAndDestroy( launcher ); |
819 |
} |
|
820 |
||
821 |
// --------------------------------------------------------------------------- |
|
822 |
// CMCSPluginEngine::ConstructMenuItemForIconL |
|
823 |
// Syntax: skin(major minor):mif(filename bimapId maskId) |
|
824 |
// --------------------------------------------------------------------------- |
|
825 |
// |
|
826 |
TBool CMCSPluginEngine::ConstructMenuItemForIconL( const TDesC& aPath, |
|
827 |
CMenuItem& aMenuItem ) |
|
828 |
{ |
|
829 |
TInt pos( aPath.Locate( ':' ) ); |
|
830 |
if ( pos == KErrNotFound ) |
|
831 |
{ |
|
832 |
pos = aPath.Length(); |
|
833 |
} |
|
834 |
TPtrC skin( aPath.Left( pos ) ); |
|
835 |
TInt sf( skin.FindF( KSkin ) ); |
|
836 |
||
837 |
if ( sf == KErrNotFound ) |
|
838 |
{ |
|
839 |
return EFalse; |
|
840 |
} |
|
841 |
||
842 |
TPtrC temp( skin.Mid( sf + KSkin().Length() ) ); |
|
843 |
TLex input( temp ); |
|
844 |
input.SkipSpace(); |
|
845 |
||
846 |
if ( !input.Eos() && input.Peek() == '(' ) |
|
847 |
{ |
|
848 |
input.Inc(); |
|
849 |
} |
|
850 |
TPtrC majorId( NextIdToken( input ) ); |
|
851 |
TPtrC minorId( NextIdToken( input ) ); |
|
852 |
||
853 |
aMenuItem.SetAttributeL( KMenuAttrIconSkinMajorId, majorId ); |
|
854 |
aMenuItem.SetAttributeL( KMenuAttrIconSkinMinorId, minorId ); |
|
855 |
||
856 |
if ( aPath.Length() > pos && |
|
857 |
( aPath.Mid( pos + 1 ).FindF( KMif ) != KErrNotFound ) ) |
|
858 |
{ |
|
859 |
TPtrC mif( aPath.Mid( pos + 1 ) ); |
|
860 |
TInt mf( mif.FindF( KMif ) ); |
|
861 |
||
862 |
TLex input1( mif.Mid( mf + KMif().Length() ) ); |
|
863 |
input1.SkipSpace(); |
|
864 |
||
865 |
if ( !input1.Eos() && input1.Peek() == '(' ) |
|
866 |
{ |
|
867 |
input1.Inc(); |
|
868 |
} |
|
869 |
||
870 |
TPtrC file( NextIdToken( input1 ) ); |
|
871 |
TPtrC bitmapId( NextIdToken( input1 ) ); |
|
872 |
TPtrC maskId( NextIdToken( input1 ) ); |
|
873 |
||
874 |
aMenuItem.SetAttributeL( KMenuAttrIconFile, file ); |
|
875 |
aMenuItem.SetAttributeL( KMenuAttrIconId, bitmapId ); |
|
876 |
aMenuItem.SetAttributeL( KMenuAttrMaskId, maskId ); |
|
877 |
} |
|
878 |
||
879 |
return ETrue; |
|
880 |
} |
|
881 |
||
882 |
// End of file |