mmuifw_plat/alf_widgetmodel_api/inc/alf/alfwidgetenvextension.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 2008 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:  Utilities to create and access widget model extensions to AlfEnv
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ALFWIDGETENVEXTENSION_H
       
    20 #define ALFWIDGETENVEXTENSION_H
       
    21 
       
    22 #include <osn/osndefines.h>
       
    23 
       
    24 class CAlfEnv;
       
    25 
       
    26 namespace Alf
       
    27     {
       
    28     class ResourcePool;
       
    29     class IAlfWidgetFactory;
       
    30     class AlfThemeManagerUtil;
       
    31     }
       
    32 namespace Alf
       
    33     {
       
    34 
       
    35 /** 
       
    36  *  @class AlfWidgetEnvExtension alfwidgetenvextension.h "alf/alfwidgetenvextension.h"
       
    37  *  class with methods to access extensions in AlfEnv
       
    38  *  @lib alfwidgetmodel.lib
       
    39  *  @since S60 ?S60_version
       
    40  *  @status Draft
       
    41  */
       
    42 class AlfWidgetEnvExtension
       
    43     {
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Initialize the singleton objects that are required for the widget model
       
    48      *
       
    49      * @exception osncore::AlfWidgetException Thrown with the error code
       
    50      *                osncore::ECommonError when the resource pool extension
       
    51      *                can not be hooked to Alf environment.
       
    52      * @exception osncore::AlfWidgetException Thrown with the error code 
       
    53      *                osncore::ECommonError when the factory extension can
       
    54      *                not be hooked to Alf environment.
       
    55      * @exception osncore::AlfWidgetException Thrown with the error code
       
    56      *                osncore::ECommonError when the widget factory cannot
       
    57      *                be created. 
       
    58      * 
       
    59      * @param aEnv   Alf environment object.
       
    60      */
       
    61     OSN_IMPORT static void initializeEnvironment(CAlfEnv& aEnv);
       
    62     
       
    63     /**
       
    64      * Initialize the singleton object for the resource pool required for the
       
    65      * widget model 
       
    66      *
       
    67      * @param aEnv   Alf environment object
       
    68      */
       
    69     static void initializeEnvironmentForResourcePool(CAlfEnv& aEnv);
       
    70     
       
    71     /**
       
    72     * Initializes environment with Theme Manager extension
       
    73     * 
       
    74     * @param aEnv   Alf environment object
       
    75     */    
       
    76     static void AlfWidgetEnvExtension::initializeEnvironmentForTheme(CAlfEnv& aEnv);
       
    77     
       
    78     /**
       
    79      * Initialize the singleton object for the widget factory required for 
       
    80      * the widget model
       
    81      * 
       
    82      * @param aEnv   Alf environment object
       
    83      */
       
    84     static void initializeEnvironmentForFactory(CAlfEnv& aEnv);
       
    85 
       
    86     /**
       
    87      * Access to the application-level resource pool
       
    88      * It also initializes the environment with resource pool extension,
       
    89      * if it was not initialized earlier
       
    90      *
       
    91      * @exception osncore::AlfWidgetException Thrown with the error code
       
    92      *                osncore::ECommonError when the extension can not be 
       
    93      *                hooked to Alf environment.
       
    94      * @param aEnv  The Alf environment object in which to find the pool
       
    95      * @return ref to the application-level resource pool
       
    96      */
       
    97     OSN_IMPORT static ResourcePool& resourcePool(CAlfEnv& aEnv);
       
    98     
       
    99     
       
   100     /**
       
   101      * Access to the widget factory
       
   102      * It also initializes the environment with widget factory extension,
       
   103      * if it was not initialized earlier
       
   104      *
       
   105      * @exception osncore::AlfWidgetException Thrown with the error code 
       
   106      *                osncore::ECommonError when the extension can not be 
       
   107      *                hooked to Alf environment.
       
   108      * @exception osncore::AlfWidgetException Thrown with the error code
       
   109      *                osncore::ECommonError when the widget factory cannot
       
   110      *                be created.
       
   111      * @param aEnv  The Alf environment object in which to find the 
       
   112      *              widget factory
       
   113      * @return ref to the widget factory
       
   114      */
       
   115     OSN_IMPORT static IAlfWidgetFactory& widgetFactory( CAlfEnv& aEnv);
       
   116 	/**
       
   117      * Access to the application-level Thememanager.
       
   118      * 
       
   119      * @param aEnv  The Alf environment object in which to find the thememanager.
       
   120      * @return ref to the application-level ThemeManager.
       
   121      */
       
   122     OSN_IMPORT static AlfThemeManagerUtil& themeManagerUtil(CAlfEnv& aEnv);
       
   123 
       
   124     };
       
   125 
       
   126     }
       
   127 #endif // ALFWIDGETENVEXTENSION_H