meetingrequest/mrbcplugin/src/cmrbcplugin.cpp
branchRCL_3
changeset 16 b5fbb9b25d57
parent 12 4ce476e64c59
equal deleted inserted replaced
14:b13141f05c3d 16:b5fbb9b25d57
    27 #include <calendar.rsg>
    27 #include <calendar.rsg>
    28 #include <calenservices.h>
    28 #include <calenservices.h>
    29 #include <eikmenup.h>
    29 #include <eikmenup.h>
    30 #include <bautils.h>
    30 #include <bautils.h>
    31 #include <ecom/ecom.h>
    31 #include <ecom/ecom.h>
    32 #include <meetingrequestuids.hrh>
    32 #include <MeetingRequestUids.hrh>
    33 #include <ct/rcpointerarray.h>
    33 #include <ct/rcpointerarray.h>
    34 #include <data_caging_path_literals.hrh>
    34 #include <data_caging_path_literals.hrh>
    35 #include <caleninterimutils2.h>
    35 #include <CalenInterimUtils2.h>
    36 #include <calencommands.hrh>
    36 #include <calencommands.hrh>
    37 #include <featdiscovery.h>
    37 #include <featdiscovery.h>
    38 #include <bldvariant.hrh>
    38 #include <bldvariant.hrh>
    39 
    39 
    40 #include "emailtrace.h"
    40 #include "emailtrace.h"
   148                 {
   148                 {
   149                 enabled = EFalse;
   149                 enabled = EFalse;
   150                 }
   150                 }
   151             break;
   151             break;
   152             }
   152             }
   153             
   153 
   154         default:
   154         default:
   155             {
   155             {
   156             enabled = EFalse;
   156             enabled = EFalse;
   157             break;
   157             break;
   158             }
   158             }
   480     //This situation command ECalenOpenMeetingView will be received.
   480     //This situation command ECalenOpenMeetingView will be received.
   481     if( EMRLaunchMeetingViewer == aCommand )
   481     if( EMRLaunchMeetingViewer == aCommand )
   482         {
   482         {
   483         CMRBCEventPlugin* eventPlugin = PluginByUidL(
   483         CMRBCEventPlugin* eventPlugin = PluginByUidL(
   484                 TUid::Uid( KMRBCMREventPluginImplementationUID ) );
   484                 TUid::Uid( KMRBCMREventPluginImplementationUID ) );
   485         
   485 
   486         if ( eventPlugin )
   486         if ( eventPlugin )
   487             {
   487             {
   488             cmdHandler = eventPlugin->CommandHandler();
   488             cmdHandler = eventPlugin->CommandHandler();
   489             }
   489             }
   490         }
   490         }
   492         {
   492         {
   493         TInt pluginCount( iPluginResources.Count() );
   493         TInt pluginCount( iPluginResources.Count() );
   494         for ( TInt i(0); i < pluginCount && !cmdHandler; ++i )
   494         for ( TInt i(0); i < pluginCount && !cmdHandler; ++i )
   495             {
   495             {
   496             TMRBCPluginCommand pluginCommand;
   496             TMRBCPluginCommand pluginCommand;
   497     
   497 
   498             TInt err = iPluginResources[i]->Command( aCommand, pluginCommand );
   498             TInt err = iPluginResources[i]->Command( aCommand, pluginCommand );
   499             if ( KErrNone == err )
   499             if ( KErrNone == err )
   500                 {
   500                 {
   501                 // Command was found from the plugin
   501                 // Command was found from the plugin
   502                 if ( pluginCommand.CheckEntryType() )
   502                 if ( pluginCommand.CheckEntryType() )
   503                     {
   503                     {
   504                     iEntryLoader->UpdateEntryFromDatabaseL();
   504                     iEntryLoader->UpdateEntryFromDatabaseL();
   505     
   505 
   506                     TBCPluginEventType eventType(
   506                     TBCPluginEventType eventType(
   507                             EventTypeL( *iServices, iEntryLoader->Entry() ) );
   507                             EventTypeL( *iServices, iEntryLoader->Entry() ) );
   508     
   508 
   509                     if ( iPluginResources[i]->SupportsType( eventType)
   509                     if ( iPluginResources[i]->SupportsType( eventType)
   510                          && IsCommandSupportedForEntryTypeL( aCommand, eventType ) )
   510                          && IsCommandSupportedForEntryTypeL( aCommand, eventType ) )
   511                         {
   511                         {
   512                         cmdHandler = iPluginResources[i]->PluginL().CommandHandler();
   512                         cmdHandler = iPluginResources[i]->PluginL().CommandHandler();
   513                         }
   513                         }
   527 // -----------------------------------------------------------------------------
   527 // -----------------------------------------------------------------------------
   528 //
   528 //
   529 CMRBCEventPlugin* CMRBCPlugin::PluginByUidL( TUid aUid )
   529 CMRBCEventPlugin* CMRBCPlugin::PluginByUidL( TUid aUid )
   530     {
   530     {
   531     CMRBCEventPlugin* plugin = NULL;
   531     CMRBCEventPlugin* plugin = NULL;
   532     
   532 
   533     for ( TInt i = 0; i < iPluginResources.Count() && !plugin; ++i )
   533     for ( TInt i = 0; i < iPluginResources.Count() && !plugin; ++i )
   534         {
   534         {
   535         if ( iPluginResources[ i ]->PluginImplUid() == aUid )
   535         if ( iPluginResources[ i ]->PluginImplUid() == aUid )
   536             {
   536             {
   537             plugin = &( iPluginResources[ i ]->PluginL() );
   537             plugin = &( iPluginResources[ i ]->PluginL() );
   538             }
   538             }
   539         }
   539         }
   540     
   540 
   541     return plugin;
   541     return plugin;
   542     }
   542     }
   543 
   543 
   544 // End of file
   544 // End of file