idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp
branchRCL_3
changeset 122 6cadd6867c17
parent 118 8baec10861af
child 130 67f2ed48ad91
equal deleted inserted replaced
118:8baec10861af 122:6cadd6867c17
    48 _LIT( KMif,          "mif" );
    48 _LIT( KMif,          "mif" );
    49 _LIT( KResourceDrive, "Z:" );
    49 _LIT( KResourceDrive, "Z:" );
    50 _LIT( KResourceFile, "mcspluginres.rsc" );
    50 _LIT( KResourceFile, "mcspluginres.rsc" );
    51 _LIT( KResPath, "\\resource\\" );
    51 _LIT( KResPath, "\\resource\\" );
    52 _LIT( KMMApplication, "mm://" );
    52 _LIT( KMMApplication, "mm://" );
    53 _LIT( KSetFocusString, "!setfocus?applicationgroup_name=" );
    53 _LIT( KSetOpenItemString, "!openitem?id="  );
    54 _LIT( KApplicationGroupName, "applicationgroup_name" );
       
    55 _LIT( KIcon, "icon" );
    54 _LIT( KIcon, "icon" );
    56 _LIT( KMenuAttrUndefUid, "0x99999991" );
    55 _LIT( KMenuAttrUndefUid, "0x99999991" );
    57 _LIT( KMenuIconFile, "aimcsplugin.mif" );
    56 _LIT( KMenuIconFile, "aimcsplugin.mif" );
    58 _LIT( KMenuBookmarkIconId, "16386" );
    57 _LIT( KMenuBookmarkIconId, "16386" );
    59 _LIT( KMenuBookmarkMaskId, "16387" );
    58 _LIT( KMenuBookmarkMaskId, "16387" );
    70 const TUid KBrowserUid = { 0x10008D39 };
    69 const TUid KBrowserUid = { 0x10008D39 };
    71 
    70 
    72 // maximum custom message length
    71 // maximum custom message length
    73 const TInt KMaxCustomMsg = 256;
    72 const TInt KMaxCustomMsg = 256;
    74 const TInt KUndefinedIndex = -1;
    73 const TInt KUndefinedIndex = -1;
       
    74 
       
    75 // maximun integer character length
       
    76 const TInt  KMaxLength = 12;
    75 
    77 
    76 // ======== LOCAL FUNCTIONS ========
    78 // ======== LOCAL FUNCTIONS ========
    77 // ----------------------------------------------------------------------------
    79 // ----------------------------------------------------------------------------
    78 // NextIdToken
    80 // NextIdToken
    79 // ----------------------------------------------------------------------------
    81 // ----------------------------------------------------------------------------
   590     
   592     
   591     // message for MM application
   593     // message for MM application
   592     HBufC8* message; 
   594     HBufC8* message; 
   593 
   595 
   594     // prepare message for launching folder
   596     // prepare message for launching folder
   595     TBool hasApplicationGroupName( EFalse );
   597     TBuf<KMaxLength>  itemId;
   596     
   598     itemId.Num( item->Id() );
   597     TPtrC applicationGroupName( item->GetAttributeL(
   599     
   598         KApplicationGroupName, hasApplicationGroupName ) );
   600     message = HBufC8::NewLC( KMMApplication().Length()
   599                                                       
   601                             + KSetOpenItemString().Length()
   600     if ( !hasApplicationGroupName )
   602                             + itemId.Length() );
   601         {
       
   602         CleanupStack::PopAndDestroy( item );
       
   603         return;
       
   604         }
       
   605     
       
   606     message = HBufC8::NewLC( KMMApplication().Length() + 
       
   607                              KSetFocusString().Length() +
       
   608                              applicationGroupName.Length() );
       
   609 
       
   610     message->Des().Copy( KMMApplication );
   603     message->Des().Copy( KMMApplication );
   611     message->Des().Append( KSetFocusString );
   604     message->Des().Append( KSetOpenItemString );
   612     message->Des().Append( applicationGroupName );
   605     message->Des().Append( itemId );
   613 
   606 
   614     // find MM application
   607     // find MM application
   615     TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
   608     TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
   616     TApaTask task( taskList.FindApp( KMMUid ) );
   609     TApaTask task( taskList.FindApp( KMMUid ) );
   617 
   610