47 #include <data_caging_path_literals.hrh> |
47 #include <data_caging_path_literals.hrh> |
48 |
48 |
49 // CONSTANTS |
49 // CONSTANTS |
50 _LIT( KResourceFileName, "\\resource\\wrtharvester.rsc" ); |
50 _LIT( KResourceFileName, "\\resource\\wrtharvester.rsc" ); |
51 _LIT( KResourceDir, "Z:wrtharvester.rsc" ); |
51 _LIT( KResourceDir, "Z:wrtharvester.rsc" ); |
|
52 _LIT( KUid, "uid"); |
|
53 _LIT( K0x, "0x"); |
|
54 _LIT( KOpenPar, "("); |
|
55 _LIT( KClosePar, ")"); |
|
56 _LIT8( KWidgetIcon, "widget_icon"); |
52 |
57 |
53 /** |
58 /** |
54 * Utility class to show the prompt for platform security access. |
59 * Utility class to show the prompt for platform security access. |
55 * |
60 * |
56 * The class exists only to provide platform security access prompt |
61 * The class exists only to provide platform security access prompt |
517 TBool networkAccess = CheckNetworkAccessL( wrtInfo.iUid ); |
522 TBool networkAccess = CheckNetworkAccessL( wrtInfo.iUid ); |
518 |
523 |
519 __UHEAP_MARK; |
524 __UHEAP_MARK; |
520 TInt id( KErrNotFound ); |
525 TInt id( KErrNotFound ); |
521 if( iCPSInterface ) |
526 if( iCPSInterface ) |
522 { |
527 { |
|
528 TBuf<10> uid(wrtInfo.iUid.Name()); // [12345678] |
|
529 uid.Delete(0,1); // 12345678] |
|
530 uid.Delete( uid.Length()-1, 1); // 12345678 |
|
531 TBuf<50> wrtuid; |
|
532 wrtuid.Append(KUid); // uid |
|
533 wrtuid.Append(KOpenPar); // uid( |
|
534 wrtuid.Append(K0x); // uid(0x |
|
535 wrtuid.Append(uid ); // uid(0x12345678 |
|
536 wrtuid.Append(KClosePar); // uid(0x12345678) |
|
537 |
523 CLiwGenericParamList* inparam( CLiwGenericParamList::NewLC() ); |
538 CLiwGenericParamList* inparam( CLiwGenericParamList::NewLC() ); |
524 CLiwGenericParamList* outparam( CLiwGenericParamList::NewLC() ); |
539 CLiwGenericParamList* outparam( CLiwGenericParamList::NewLC() ); |
525 |
540 |
526 TLiwGenericParam type( KType, TLiwVariant( KPubData )); |
541 TLiwGenericParam type( KType, TLiwVariant( KPubData )); |
527 inparam->AppendL( type ); |
542 inparam->AppendL( type ); |
531 |
546 |
532 // Create the data map for publisher registry |
547 // Create the data map for publisher registry |
533 cpdatamap->InsertL( KPublisherId, TLiwVariant( KWRTPublisher )); |
548 cpdatamap->InsertL( KPublisherId, TLiwVariant( KWRTPublisher )); |
534 cpdatamap->InsertL( KContentType, TLiwVariant( KTemplatedWidget )); |
549 cpdatamap->InsertL( KContentType, TLiwVariant( KTemplatedWidget )); |
535 cpdatamap->InsertL( KContentId, TLiwVariant( wrtInfo.iBundleId )); |
550 cpdatamap->InsertL( KContentId, TLiwVariant( wrtInfo.iBundleId )); |
|
551 |
536 // Widget info map |
552 // Widget info map |
537 CLiwDefaultMap* widgetInfo = CLiwDefaultMap::NewLC(); |
553 CLiwDefaultMap* widgetInfo = CLiwDefaultMap::NewLC(); |
538 widgetInfo->InsertL( KTemplateType, TLiwVariant( KTemplateName )); |
554 widgetInfo->InsertL( KTemplateType, TLiwVariant( KTemplateName )); |
539 widgetInfo->InsertL( KWidgetName, TLiwVariant( wrtInfo.iDisplayName )); |
555 widgetInfo->InsertL( KWidgetName, TLiwVariant( wrtInfo.iDisplayName )); |
540 datamap->InsertL( KWidgetInfo , TLiwVariant( widgetInfo )); |
556 widgetInfo->InsertL( KWidgetIcon, TLiwVariant( wrtuid)); // uid(0x12345678) This is the expected format |
541 CleanupStack::PopAndDestroy( widgetInfo ); |
557 |
542 |
558 datamap->InsertL( KWidgetInfo , TLiwVariant( widgetInfo )); |
543 // Take dynamic menu items into use |
559 CleanupStack::PopAndDestroy( widgetInfo ); |
544 if (networkAccess) |
560 |
545 { |
561 // Take dynamic menu items into use |
546 CLiwDefaultMap* mapMenu = CLiwDefaultMap::NewLC(); |
562 if (networkAccess) |
547 mapMenu->InsertL( KItemOnlineOffline, TLiwVariant( KMyActionName )); |
563 { |
548 datamap->InsertL( KMenuItems, TLiwVariant( mapMenu )); |
564 CLiwDefaultMap* mapMenu = CLiwDefaultMap::NewLC(); |
549 CleanupStack::PopAndDestroy(mapMenu); |
565 mapMenu->InsertL( KItemOnlineOffline, TLiwVariant( KMyActionName )); |
550 } |
566 datamap->InsertL( KMenuItems, TLiwVariant( mapMenu )); |
|
567 CleanupStack::PopAndDestroy(mapMenu); |
|
568 } |
551 |
569 |
552 cpdatamap->InsertL( KDataMap, TLiwVariant(datamap) ); |
570 cpdatamap->InsertL( KDataMap, TLiwVariant(datamap) ); |
553 |
571 |
554 // Create the action map for publisher registry |
572 // Create the action map for publisher registry |
555 actionmap = CLiwDefaultMap::NewLC(); |
573 actionmap = CLiwDefaultMap::NewLC(); |