commsconfig/cscengine/inc/cscenguiextensionpluginhandler.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2007-2007 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:  For CSC needed AIW handling for ui extension plug-ins
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CSCENGUIEXTENSIONPLUGINHANDLER_H
       
    21 #define C_CSCENGUIEXTENSIONPLUGINHANDLER_H
       
    22 
       
    23 #include <AiwCommon.h>
       
    24 
       
    25 const TUint KMaxUiExtensionNameLength = 128;
       
    26 
       
    27 class CEikonEnv;
       
    28 class MAiwNotifyCallback;
       
    29 class CAiwServiceHandler;
       
    30 class CAiwGenericParamList;
       
    31 class CCSCEngStartupHandler;
       
    32 class MCSCEngUiExtensionObserver;
       
    33 
       
    34 
       
    35 /**
       
    36 *   iUiExtensionName  = UI Extension name
       
    37 *   iPluginsUid       = Service plug-in UID
       
    38 *   iPlace            = Place parameter
       
    39 */
       
    40 NONSHARABLE_CLASS( TUiExtensionPluginInfo )
       
    41     {
       
    42     public:
       
    43     
       
    44         TUiExtensionPluginInfo()
       
    45             : iUiExtensionName( KNullDesC ),
       
    46               iPluginsUid( KNullUid ),
       
    47               iPlace( 0 )
       
    48             {}
       
    49 
       
    50     public:
       
    51         
       
    52         /*
       
    53         * UI Extension name
       
    54         */       
       
    55         TBuf<KMaxUiExtensionNameLength> iUiExtensionName;
       
    56         
       
    57         /*
       
    58         * UI Extension plug-in UID
       
    59         */
       
    60         TUid iPluginsUid;
       
    61         
       
    62         /*
       
    63         * UI Extension placing information
       
    64         * 0 = listbox
       
    65         * 1 = options menu
       
    66         */
       
    67         TInt iPlace;
       
    68     };
       
    69 
       
    70 
       
    71 
       
    72 /**
       
    73  *  An instance of CSCUiExtensionPluginHandler
       
    74  *  Handles Application Interworking (AIW).
       
    75  *
       
    76  *  @lib
       
    77  *  @since S60 v3.2
       
    78  */
       
    79 NONSHARABLE_CLASS( CCSCEngUiExtensionPluginHandler ) : public CBase,
       
    80                                                        public MAiwNotifyCallback
       
    81     {
       
    82     public: 
       
    83 
       
    84         /**
       
    85          * State of the plugin.
       
    86          */
       
    87         enum TPluginState
       
    88             {
       
    89             EPluginInitialize = 1,
       
    90             EPluginOpenExtensionView,
       
    91             EPluginOpenExtensionViewFromAI
       
    92             };
       
    93         
       
    94         
       
    95         // UI extension plug-in callback events.
       
    96         enum TUiExtensionPluginResponse
       
    97             {
       
    98             EPluginInitialized = KAiwEventStarted,
       
    99             EPluginExited = KAiwEventStopped,
       
   100             EPluginError = KAiwEventError
       
   101             };
       
   102         
       
   103         /**
       
   104          * Two-phased constructor.
       
   105          */
       
   106         IMPORT_C static CCSCEngUiExtensionPluginHandler* NewL( 
       
   107             CEikonEnv& aEikEnv, 
       
   108             MCSCEngUiExtensionObserver& aObserver,
       
   109             CCSCEngStartupHandler& aStartupHandler );
       
   110 
       
   111 
       
   112         /**
       
   113          * Two-phased constructor.
       
   114          */
       
   115         IMPORT_C static CCSCEngUiExtensionPluginHandler* NewLC(
       
   116             CEikonEnv& aEikEnv, 
       
   117             MCSCEngUiExtensionObserver& aObserver,
       
   118             CCSCEngStartupHandler& aStartupHandler );
       
   119 
       
   120 
       
   121         /**
       
   122          * Destructor.
       
   123          */
       
   124         virtual ~CCSCEngUiExtensionPluginHandler();
       
   125  
       
   126         
       
   127         /**
       
   128          * Initializes CSC supported UI Extension plugins.
       
   129          *
       
   130          * @since S60 v3.2
       
   131          */
       
   132         IMPORT_C void InitializePluginsL();
       
   133     
       
   134         
       
   135         /**
       
   136          * Launches UI Extension plugin view
       
   137          *
       
   138          * @since S60 v3.2
       
   139          * @param aPluginUid contains plugins Uid
       
   140          * @param aViewUid contains view Uid to be returned
       
   141          * @param aLaunchedFromAI ETrue if launched from active idle
       
   142          */
       
   143         IMPORT_C void LaunchUiExtensionL( 
       
   144             const TUid& aPluginUid, const TUid& aViewUid,
       
   145             TBool aLaunchedFromAI = EFalse );
       
   146         
       
   147         
       
   148         /**
       
   149          * Returns item from UI Extension plug-in array
       
   150          *
       
   151          * @since S60 v3.2
       
   152          * @param aIndex array index
       
   153          */
       
   154         IMPORT_C TUiExtensionPluginInfo ItemFromPluginInfoArray( TInt aIndex );
       
   155         
       
   156         
       
   157         /**
       
   158          * Returns count of CSC supported ui extension plugins in array.
       
   159          * 
       
   160          * @since S60 v3.2
       
   161          * @param aType for items to be returned
       
   162          * @return count of profiles 
       
   163          */
       
   164         IMPORT_C TInt PluginCount() const;
       
   165    
       
   166    
       
   167         // from base class MAiwNotifyCallBack
       
   168  
       
   169         /**
       
   170          * From MAiwNotifyCallBack.
       
   171          * Handles received callbacks from AIW plugin.
       
   172          *
       
   173          * @since S60 v3.0
       
   174          * @param aCmdId for cmd id
       
   175          * @param aEventId for event id
       
   176          * @param aEventParamList for event param list
       
   177          * @param aInParamList for in param list
       
   178          */
       
   179         TInt HandleNotifyL( TInt aCmdId,
       
   180                             TInt aEventId,
       
   181                             CAiwGenericParamList& aEventParamList,
       
   182                             const CAiwGenericParamList& aInParamList );
       
   183      
       
   184             
       
   185     private:
       
   186 
       
   187 
       
   188         CCSCEngUiExtensionPluginHandler( 
       
   189             CEikonEnv& aEikEnv,
       
   190             MCSCEngUiExtensionObserver& aObserver, 
       
   191             CCSCEngStartupHandler& aStartupHandler );
       
   192 
       
   193    
       
   194         void ConstructL();
       
   195         
       
   196         
       
   197         /**
       
   198          * Gets plug-in index in plug-in info array and plug-ins uid
       
   199          *
       
   200          * @since S60 v3.2
       
   201          * @param aInParamList for params received from plugin
       
   202          * @param aIndex for plug-in info array index
       
   203          * @param aPluginUid for plug-in uid
       
   204          */ 
       
   205         void GetPluginIndexAndUid( 
       
   206             const CAiwGenericParamList& aInParamList,
       
   207             TInt aIndex, 
       
   208             TUid aPluginUid );
       
   209         
       
   210         /**
       
   211          * Set information of plug-ins to plug-in info array
       
   212          *
       
   213          * @since S60 v3.2
       
   214          * @param aInParamList for params received from plugin
       
   215          */        
       
   216         void SetPluginInitInfo( 
       
   217             const CAiwGenericParamList& aInParamList );
       
   218         
       
   219         
       
   220     private: // data
       
   221         
       
   222         /**
       
   223          * Reference to Eikon environment.
       
   224          */
       
   225         CEikonEnv& iEikEnv;
       
   226         
       
   227         /**
       
   228          * Observer for AIW commands
       
   229          */  
       
   230         MCSCEngUiExtensionObserver& iObserver;
       
   231         
       
   232         /**
       
   233          *  Reference to CCSCEngStartupHandler
       
   234          */         
       
   235         CCSCEngStartupHandler& iStartupHandler;
       
   236                  
       
   237         /**
       
   238          * For AIW Plugin services
       
   239          * Own.
       
   240          */
       
   241         CAiwServiceHandler* iServiceHandler;
       
   242         
       
   243         /**
       
   244          * CSC supported UI Extension plug-in information array
       
   245          */ 
       
   246         RArray<TUiExtensionPluginInfo> iUiExtensionPluginInfoArray;
       
   247         
       
   248         /**
       
   249          * Resource file offset.
       
   250          */
       
   251         TInt iResourceOffset;  
       
   252         
       
   253 #ifdef _DEBUG
       
   254     friend class UT_CSCEngUiExtensionPluginHandler;
       
   255 #endif    
       
   256     };
       
   257 
       
   258 #endif // C_CSCENGUIEXTENSIONPLUGINHANDLER_H