idlefw/inc/framework/aiuicontrollermanager.h
branchRCL_3
changeset 114 a5a39a295112
equal deleted inserted replaced
113:0efa10d348c0 114:a5a39a295112
       
     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:  UI controller manager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _AIUICONTROLLERMANAGER_H
       
    20 #define _AIUICONTROLLERMANAGER_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 
       
    25 // User includes
       
    26 
       
    27 // Forward declarations
       
    28 class CAiUiController;
       
    29 class MAiMainUiController;
       
    30 class CRepository;
       
    31 class CCoeEnv;
       
    32 class CAiFw;
       
    33 class MAiFwStateHandler;
       
    34 
       
    35 // Class declaration
       
    36 /**
       
    37  * @ingroup group_aifw
       
    38  * 
       
    39  *  Active Idle UI Controller manager.
       
    40  *
       
    41  *  @since S60 5.2
       
    42  */
       
    43 NONSHARABLE_CLASS( CAiUiControllerManager ) : public CBase                             
       
    44 	{
       
    45 public: 		
       
    46     // Constructors and destructor
       
    47     
       
    48     /**
       
    49      * Two-phased constructor.
       
    50      */ 
       
    51     static CAiUiControllerManager* NewL( CAiFw* aAiFw );
       
    52     
       
    53     /**
       
    54      * Destructor
       
    55      */        
       
    56     ~CAiUiControllerManager();
       
    57     
       
    58 public: 
       
    59     // new functions
       
    60     
       
    61     /**
       
    62      * Gets UI controllers
       
    63      * 
       
    64      * @since S60 5.2
       
    65      * @return Array of UI controllers
       
    66      */
       
    67     RPointerArray< CAiUiController >& UiControllers() const;
       
    68     
       
    69     /**
       
    70      * Actives UI by calling ActivateUI() for each UI controller 
       
    71      * 
       
    72      * @since S60 5.2
       
    73      */
       
    74     void ActivateUI();
       
    75     
       
    76     /**
       
    77      * Gets the main UI controller
       
    78      * 
       
    79      * @since S60 5.2
       
    80      * @return Main UI controller
       
    81      */
       
    82     MAiMainUiController& MainUiController() const;
       
    83     
       
    84     /**
       
    85      * Queries whether aUiController is the main UI controller
       
    86      * 
       
    87      * @since S60 5.2
       
    88      * @return ETrue if main UI controller, EFalse otherwise
       
    89      */
       
    90     TBool IsMainUiController( CAiUiController& aUiController ) const;
       
    91             
       
    92     /**
       
    93      * Calls RunApplicationL for the main UI controller.
       
    94      * 
       
    95      * @since S60 5.2
       
    96      */
       
    97     void RunApplicationL();
       
    98     
       
    99     /**
       
   100      * Calls LoadUIDefinitionL for each UI controller.
       
   101      * 
       
   102      * @since S60 5.2
       
   103      */
       
   104     void LoadUIDefinition();
       
   105     
       
   106     /**
       
   107      * Returns the main UI Controller's CONE environment object.
       
   108      * 
       
   109      * @since S60 5.2
       
   110      * @return Control Environment
       
   111      */
       
   112     CCoeEnv& CoeEnv() const;
       
   113     
       
   114     /**
       
   115      * Destroys all UI controllers except the main controller.
       
   116      * 
       
   117      * @since S60 5.2
       
   118      */
       
   119     void DestroySecondaryUiControllers();
       
   120         
       
   121     /**
       
   122      * Exits main UI controller
       
   123      * 
       
   124      * @since S60 5.2
       
   125      */		
       
   126     void ExitMainController();
       
   127     
       
   128     /** 
       
   129      * Sets Fw state handler for each UI conttroller
       
   130      * 
       
   131      * @since S60 5.2
       
   132      * @param aHandler State handler to set
       
   133      */
       
   134     void SetStateHandler( MAiFwStateHandler& aHandler );    
       
   135                     
       
   136 private: 
       
   137     // private constructors
       
   138 
       
   139     /**
       
   140      * Leaving constructor
       
   141      */    
       
   142     void ConstructL( CAiFw* aAiFw );
       
   143     
       
   144     /**
       
   145      * C++ default constructor
       
   146      */     
       
   147     CAiUiControllerManager();
       
   148     
       
   149 private: 
       
   150     // new functions
       
   151     
       
   152     void LoadMainControllerL( CRepository& aRepository );
       
   153     void LoadSecondaryControllersL( CRepository& aRepository );
       
   154     
       
   155 private: 
       
   156     // data
       
   157     
       
   158     /** UI controllers, Owned */
       
   159     mutable RPointerArray< CAiUiController > iUiControllerArray;    
       
   160     /** Main UI controller, Owned by the above array */
       
   161     MAiMainUiController* iMainUiController;        
       
   162     /** List of created UI controllers */
       
   163     RArray< TInt > iCreatedUICList;
       
   164     
       
   165 private:
       
   166     // friend class
       
   167     
       
   168 #ifdef _AIFW_UNIT_TEST
       
   169     friend class UT_AiUiControllerManager;
       
   170 #endif
       
   171 	};
       
   172 
       
   173 #endif // _AIUICONTROLLERMANAGER_H
       
   174