phonebookui/Phonebook2/UIExtensionManager/inc/CPbk2ThinUIExtensionLoader.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Loads thin UI extensions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CPBK2THINUIEXTENSIONLOADER_H
       
    21 #define CPBK2THINUIEXTENSIONLOADER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CPbk2UIExtensionThinPlugin;
       
    28 class CImplementationInformation;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  Loads thin UI extensions
       
    34 *
       
    35 */
       
    36 NONSHARABLE_CLASS(CPbk2ThinUIExtensionLoader) : 
       
    37         public CBase
       
    38     {
       
    39     public:  // Constructors and destructor
       
    40         /**
       
    41         * Two-phased constructor.
       
    42         * Loads all menu plugins
       
    43         * @return a new instance of this class
       
    44         */
       
    45         static CPbk2ThinUIExtensionLoader* NewL();
       
    46         
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50         ~CPbk2ThinUIExtensionLoader();
       
    51 
       
    52     public: // New functions
       
    53         /**
       
    54         * Returns the number of loaded plugins
       
    55         * @return the number of loaded plugins
       
    56         */
       
    57         inline TInt PluginCount() const;
       
    58         
       
    59         /**
       
    60         * Returns the plugin in give position
       
    61         * @param aIndex the index of the plugin
       
    62         */
       
    63         inline CPbk2UIExtensionThinPlugin& PluginAt(TInt aIndex) const;
       
    64     
       
    65     private:    // Construction
       
    66         CPbk2ThinUIExtensionLoader();
       
    67         void ConstructL();
       
    68 
       
    69     private:    // New functions
       
    70         void LoadImplementationsL(CImplementationInformation& aImplInfo);
       
    71         CPbk2UIExtensionThinPlugin* FindImplementation(TUid& aUid);
       
    72         
       
    73     private:    // Data
       
    74         /// An array of menu plugin implementions
       
    75         RPointerArray<CPbk2UIExtensionThinPlugin> iPlugins;
       
    76     };
       
    77 
       
    78 // INLINE FUNCTIONS
       
    79 // -----------------------------------------------------------------------------
       
    80 // CPbk2ThinUIExtensionLoader::PluginCount
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 inline TInt CPbk2ThinUIExtensionLoader::PluginCount() const
       
    84     {
       
    85     return iPlugins.Count();
       
    86     }
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CPbk2ThinUIExtensionLoader::PluginAt
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 inline CPbk2UIExtensionThinPlugin& CPbk2ThinUIExtensionLoader::PluginAt(
       
    93         TInt aIndex) const
       
    94     {
       
    95     return *iPlugins[aIndex];
       
    96     }
       
    97 
       
    98 #endif      // CPBK2THINUIEXTENSIONLOADER_H
       
    99             
       
   100 // End of File