contacts_plat/phonebook_2_ui_extension_plugin_api/inc/CPbk2UIExtensionPlugin.h
branchRCL_3
changeset 20 f4a778e096c2
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Phonebook 2 UI extension ECom plug-in interface.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2UIEXTENSIONPLUGIN_H
       
    20 #define CPBK2UIEXTENSIONPLUGIN_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <e32base.h>
       
    24 #include <ecom/ecom.h>
       
    25 #include <MPbk2UIExtensionFactory.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CPbk2UIExtensionView;
       
    29 class MPbk2UIExtensionView;
       
    30 class CEikMenuPane;
       
    31 class MPbk2ContactUiControl;
       
    32 class CPbk2StorePropertyArray;
       
    33 class TCoeHelpContext;
       
    34 class CPbk2AppViewBase;
       
    35 class CPbk2ViewGraph;
       
    36 class CPbk2UIExtensionInformation;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41  * Phonebook 2 UI extension ECom plug-in interface.
       
    42  * 
       
    43  * This class is responsible for defining the extension plug-in interface
       
    44  * and creating extension plug-in implementations.
       
    45  */
       
    46 class CPbk2UIExtensionPlugin : public CBase,
       
    47                                public MPbk2UIExtensionFactory
       
    48     {
       
    49     public: // Construction and destruction
       
    50 
       
    51         /**
       
    52          * Creates a new instance of this class.
       
    53          *
       
    54          * @param aUid      Extension implementation UID.
       
    55          * @return  A new instance of this class.
       
    56          */
       
    57         static CPbk2UIExtensionPlugin* NewL(
       
    58                 TUid aUid );
       
    59 
       
    60         /**
       
    61          * Destructor.
       
    62          */
       
    63         ~CPbk2UIExtensionPlugin();
       
    64 
       
    65     public: // Interface
       
    66 
       
    67         /**
       
    68          * Called for creating a view from the extension.
       
    69          *
       
    70          * @param aViewId       The id of the view to be created. Check the
       
    71          *                      id and return a view if the extension
       
    72          *                      implements it.
       
    73          * @param aView         The view that owns the extension view.
       
    74          *                      Derived from CAknView.
       
    75          * @return  Created extension view or NULL.
       
    76          */
       
    77         virtual MPbk2UIExtensionView* CreateExtensionViewL(
       
    78                 TUid aViewId,
       
    79                 CPbk2UIExtensionView& aView ) = 0;
       
    80 
       
    81         /**
       
    82          * Called before a menu is launched. If the
       
    83          * extension is loaded on demand this won't be called
       
    84          * until the first command has caused the loading of the
       
    85          * extension.
       
    86          *
       
    87          * Use CEikMenuPane::MenuItemExists(TInt aCommandId,
       
    88          * TInt& aPosition) before setting an item dimmed.
       
    89          *
       
    90          * @param aResourceId       The id of the menu pane.
       
    91          * @param aMenuPane         A reference to the menu pane.
       
    92          * @param aControl          The current UI control.
       
    93          */
       
    94         virtual void DynInitMenuPaneL(
       
    95                 TInt aResourceId,
       
    96                 CEikMenuPane* aMenuPane,
       
    97                 MPbk2ContactUiControl& aControl ) = 0;
       
    98 
       
    99         /**
       
   100          * Called in an application start-up and when the store
       
   101          * configuration changes. The extension can update the store
       
   102          * property array by adding or removing properties.
       
   103          *
       
   104          * @param aPropertyArray    Phonebook 2 store property array.
       
   105         */
       
   106         virtual void UpdateStorePropertiesL(
       
   107                 CPbk2StorePropertyArray& aPropertyArray ) = 0;
       
   108 
       
   109         /**
       
   110          * Gets the help context from the extension.
       
   111          *
       
   112          * @param aContext          Help context, if found.
       
   113          * @param aView             Reference to the current view.
       
   114          * @param aUiControl        Reference to the current control.
       
   115          * @return  ETrue if help context was found.
       
   116          */
       
   117         virtual TBool GetHelpContextL(
       
   118                 TCoeHelpContext& aContext,
       
   119                 const CPbk2AppViewBase& aView,
       
   120                 MPbk2ContactUiControl& aUiControl ) = 0;
       
   121 
       
   122         /**
       
   123          * Allows extensions to modify the view graph dynamically during
       
   124          * the application initialisation.
       
   125          *
       
   126          * The UI extension's start-up policy must be KPbk2LoadInStartup.
       
   127          *
       
   128          * @param aViewGraph    Phonebook 2 view graph.
       
   129          */
       
   130         virtual void ApplyDynamicViewGraphChangesL(
       
   131                 CPbk2ViewGraph& aViewGraph ) = 0;
       
   132 
       
   133         /**
       
   134          * Allows extensions to add plugin information dynamically
       
   135          * during the application initialisation.
       
   136          *
       
   137          * The UI extension's start-up policy must be KPbk2LoadInStartup.
       
   138          */
       
   139         virtual void ApplyDynamicPluginInformationDataL(
       
   140                 CPbk2UIExtensionInformation& aUiExtensionInformation ) = 0;
       
   141 
       
   142         /**
       
   143          * Returns an extension point for this interface or NULL.
       
   144          *
       
   145          * @param aExtensionUid     Extension UID.
       
   146          * @return  Extension point.
       
   147          */
       
   148         virtual TAny* UIExtensionPluginExtension(
       
   149                 TUid /*aExtensionUid*/ )
       
   150             {
       
   151             return NULL;
       
   152             }
       
   153 
       
   154     public: // Internal interface for the extension manager
       
   155 
       
   156         /**
       
   157          * Returns the implementation UID.
       
   158          *
       
   159          * @return  Implementation UID.
       
   160          */
       
   161         TUid ImplementationUid() const;
       
   162 
       
   163     private: // Data
       
   164         /// Own: Destructor key
       
   165         TUid iDtorIDKey;
       
   166         /// Own: Implementation UID
       
   167         TUid iImplementationUid;
       
   168     };
       
   169 
       
   170 // --------------------------------------------------------------------------
       
   171 // CPbk2UIExtensionPlugin::~CPbk2UIExtensionPlugin
       
   172 // --------------------------------------------------------------------------
       
   173 //
       
   174 inline CPbk2UIExtensionPlugin::~CPbk2UIExtensionPlugin()
       
   175     {
       
   176     REComSession::DestroyedImplementation( iDtorIDKey );
       
   177     }
       
   178 
       
   179 // --------------------------------------------------------------------------
       
   180 // CPbk2UIExtensionPlugin::NewL
       
   181 // --------------------------------------------------------------------------
       
   182 //
       
   183 inline CPbk2UIExtensionPlugin* CPbk2UIExtensionPlugin::NewL( TUid aUid )
       
   184     {
       
   185     TAny* ptr = NULL;
       
   186     ptr = REComSession::CreateImplementationL( aUid,
       
   187         _FOFF( CPbk2UIExtensionPlugin, iDtorIDKey ) );
       
   188 
       
   189     CPbk2UIExtensionPlugin* self =
       
   190         reinterpret_cast<CPbk2UIExtensionPlugin*>( ptr );
       
   191     if ( self )
       
   192         {
       
   193         self->iImplementationUid = aUid;
       
   194         }
       
   195     return self;
       
   196     }
       
   197 
       
   198 // --------------------------------------------------------------------------
       
   199 // CPbk2UIExtensionPlugin::ImplementationUid
       
   200 // --------------------------------------------------------------------------
       
   201 //
       
   202 inline TUid CPbk2UIExtensionPlugin::ImplementationUid() const
       
   203     {
       
   204     return iImplementationUid;
       
   205     }
       
   206 
       
   207 #endif // CPBK2UIEXTENSIONPLUGIN_H
       
   208 
       
   209 // End of File