classicui_plat/personalisation_plugin_api/inc/PslnFWPluginInterface.h
changeset 37 89c890c70182
parent 34 6b5204869ed5
child 45 667edd0b8678
equal deleted inserted replaced
34:6b5204869ed5 37:89c890c70182
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Defines interface for application skinning framework's ECOM
       
    15 *                plugin.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef C_PSLNFWPLUGININTERFACE_H
       
    21 #ifndef C_PSLNFWPLUGININTERFACENOBASEVIEW_H
       
    22 #define C_PSLNFWPLUGININTERFACE_H
       
    23 
       
    24 #include <aknview.h>
       
    25 #include <gulicon.h>
       
    26 #include <AknsUtils.h>
       
    27 #include <aknViewAppUi.h>
       
    28 #include <data_caging_path_literals.hrh>
       
    29 
       
    30 // Constants used in ECOM implementation
       
    31 const TUid KPslnFWPluginInterfaceUid    = { 0x102750A9 };
       
    32 
       
    33 /**
       
    34 * Interface class for Psln plugin. All Psln plugins will implement this class.
       
    35 *
       
    36 * The main functionality Psln framework will use from CAknView is:
       
    37 * -DoActivate()
       
    38 * -DoDeactivate()
       
    39 * -Id()
       
    40 * functions.
       
    41 *
       
    42 * Id() function must return the value of the plugin implementation UID. This
       
    43 * means that the main view of the plugin will have the same UID as the plugin
       
    44 * implementation. This will prevent multiple plugins from having same view
       
    45 * UIDs as their main view. If plugin has more views, it is plugin's
       
    46 * responsibility to ensure that the UIDs of the other views are unique.
       
    47 *
       
    48 * This class is mutually exclusive with CPslnFWPluginInterface as defined in the
       
    49 * PslnPluginInterfaceNoBaseView.h.
       
    50 *
       
    51 * @lib PslnFramework.lib
       
    52 * @since S60 v3.1
       
    53 */
       
    54 class CPslnFWPluginInterface: public CAknView
       
    55     {
       
    56 public:
       
    57 
       
    58     /**
       
    59     * Specifies the location of the plugin in the Personalization application.
       
    60     * By default the plugins are appended to the end of the main view.
       
    61     */
       
    62     enum TPslnFWLocationType
       
    63         {
       
    64         // Personalization application decides plugins location (recommended)
       
    65         EPslnFWNotSpecified = 0,
       
    66         // Location is specified in aIndex parameter. Note that if the location 
       
    67         // is already taken by some other plugin (or static view), then plugin
       
    68         // view is appended to the end, just like it had EPslnFWNotSpecified set.
       
    69         EPslnFWSpecified
       
    70         };
       
    71 
       
    72     /**
       
    73     * Creates new Psln plugin having the given UID.
       
    74     * Uses Leave code KErrNotFound if implementation is not found.
       
    75     *
       
    76     * @param aImplementationUid Implementation UID of the plugin to be
       
    77     *        created.
       
    78     * @param aAppUi Pointer to the Psln application UI that can be used to
       
    79     *               switch to another view.
       
    80     */
       
    81     static CPslnFWPluginInterface* NewL(
       
    82         const TUid aImplementationUid,
       
    83         CAknViewAppUi* aAppUi );
       
    84 
       
    85     /**
       
    86     * Destructor
       
    87     */
       
    88     inline ~CPslnFWPluginInterface();
       
    89 
       
    90     /**
       
    91     * Method for getting caption of this plugin. This should be the
       
    92     * localized name of the plugin view to be shown in main view.
       
    93     *
       
    94     * @param aCaption pointer to Caption variable
       
    95     */
       
    96     virtual void GetCaptionL( TDes& aCaption ) const = 0;
       
    97 
       
    98     /**
       
    99     * Method for getting tab text for this plugin. This should be the
       
   100     * localized name of the plugin view to be shown in tab group.
       
   101     *
       
   102     * @param aCaption pointer to Caption variable
       
   103     */
       
   104     virtual void GetTabTextL( TDes& aCaption ) const = 0;
       
   105 
       
   106     /**
       
   107     * Creates a new icon. This icon is shown in Personalization app's main view. 
       
   108     * Ownership of the created icon is transferred to the caller.
       
   109     *
       
   110     * @return Pointer of the icon. 
       
   111     * NOTE: Ownership of this icon is transferred to the caller.
       
   112     */
       
   113     virtual CGulIcon* CreateIconL() = 0;
       
   114 
       
   115     /**
       
   116     * Method for getting the plugin view's location within Psln application.
       
   117     * Do not override, unless plugin view should be in certain location.
       
   118     * By default the plugins are appended to the end of the main view.
       
   119     * @param aType type of location: specified / not specified
       
   120     * @param aIndex proposed location of plugin.
       
   121     */
       
   122     virtual inline void GetLocationTypeAndIndex( 
       
   123         TPslnFWLocationType& aType, 
       
   124         TInt& aIndex ) const;
       
   125 
       
   126     /**
       
   127     * Reserved for future use/plugin's custom functionality. This can be
       
   128     * overwritten if plugin needs to have custom functionality which cannot
       
   129     * be fulfilled otherwise.
       
   130     */
       
   131     virtual inline TAny* CustomOperationL( TAny* aParam1, TAny* aParam2 );
       
   132 
       
   133 protected: // data
       
   134 
       
   135     /**
       
   136     * Pointer to application UI. This is protected, so that classes 
       
   137     * implementing the interface inherit pointer to AppUi.
       
   138     * Not own.
       
   139     */
       
   140     CAknViewAppUi* iAppUi;
       
   141 
       
   142 
       
   143 private: // data
       
   144 
       
   145     /**
       
   146      * ECOM plugin instance UID.
       
   147      */
       
   148      TUid iDtor_ID_Key;
       
   149 
       
   150     };
       
   151 
       
   152 #include "pslnfwplugininterface.inl"
       
   153 
       
   154 
       
   155 #endif // C_PSLNFWPLUGININTERFACENOBASEVIEW_H
       
   156 #endif // C_PSLNFWPLUGININTERFACE_H
       
   157 
       
   158 //End of file