idlefw/inc/framework/aiuicontrollermanager.h
changeset 0 79c6a41cd166
child 8 d0529222e3f0
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     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 C_AIUICONTROLLERMANAGER_H
       
    20 #define C_AIUICONTROLLERMANAGER_H
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 #include "aiuiframeworkobserver.h"
       
    25 #include "aicontentmodel.h"
       
    26 #include "aifwdefs.h"
       
    27 
       
    28 class CAiUiController;
       
    29 class CAiContentPublisher;
       
    30 class MAiMainUiController;
       
    31 class MAiFwEventHandler;
       
    32 class CRepository;
       
    33 class CCoeEnv;
       
    34 
       
    35 /**
       
    36  * @ingroup group_aifw
       
    37  * 
       
    38  *  Active Idle UI Controller manager.
       
    39  *
       
    40  *  @since S60 3.2
       
    41  */
       
    42 NONSHARABLE_CLASS( CAiUiControllerManager ) : public CBase,
       
    43                                               public MAiUiFrameworkObserver
       
    44 	{
       
    45 	public: // Constructors and destructor		
       
    46 
       
    47 		static CAiUiControllerManager* NewL();
       
    48 		~CAiUiControllerManager();
       
    49 		
       
    50 	public: // New functions
       
    51 		
       
    52         /**
       
    53          * Returns all UI controllers in an array.
       
    54          */
       
    55 		RPointerArray< CAiUiController >& UiControllers() const;
       
    56 		
       
    57 		/**
       
    58 		 * Calls ActivateUI() for all UI controllers.
       
    59 		 */
       
    60 		void ActivateUI();
       
    61 		
       
    62         /**
       
    63          * Returns the main ui controller object.
       
    64          */
       
    65 		MAiMainUiController& MainUiController() const;
       
    66 		
       
    67         /**
       
    68          * Returns true if aUiController is the main UI controller.
       
    69          */
       
    70 		TBool IsMainUiController(CAiUiController& aUiController) const;
       
    71 		    
       
    72         /**
       
    73          * Sets framework event handler for all UI controllers.
       
    74          */
       
    75 		void SetEventHandler(MAiFwEventHandler& aEventHandler);
       
    76 		
       
    77         /**
       
    78          * Calls RunApplicationL for the main UI controller.
       
    79          */
       
    80 		void RunApplicationL();
       
    81 		
       
    82         /**
       
    83          * Calls LoadUIDefinitionL for all UI controllers.
       
    84          */
       
    85 		void LoadUIDefinition();
       
    86 		
       
    87 		/**
       
    88 		 * Returns the main UI Controller's CONE environment object.
       
    89 		 */
       
    90 		CCoeEnv& CoeEnv() const;
       
    91 		
       
    92         /**
       
    93          * Destroys all UI controllers except the main controller.
       
    94          */
       
    95 		void DestroySecondaryUiControllers();
       
    96 		
       
    97 		/**
       
    98 		 * Adds an UI Framework observer. No duplicates are allowed.
       
    99 		 */
       
   100 		void AddObserverL( MAiUiFrameworkObserver& aUiFwObserver );
       
   101 
       
   102 		/**
       
   103 		 * Removes an UI Framework observer.
       
   104 		 */
       
   105 		void RemoveObserver( MAiUiFrameworkObserver& aUiFwObserver );
       
   106 		
       
   107 		/**
       
   108 		 * Removes plugin from UI.
       
   109 		 */
       
   110 		void RemovePluginFromUI( CAiContentPublisher& aPlugin );
       
   111 
       
   112         /**
       
   113          * Exits main UI controller
       
   114          */		
       
   115         void ExitMainController();
       
   116         
       
   117     private:  // From MAiUiFrameworkObserver
       
   118     
       
   119         void HandleResourceChange( TInt aType );
       
   120         void HandleForegroundEvent( TBool aForeground );
       
   121                  	
       
   122     private: // Constructors
       
   123 
       
   124 		CAiUiControllerManager();
       
   125 		void ConstructL();
       
   126         
       
   127     private: // new functions
       
   128         
       
   129 		void LoadMainControllerL(CRepository& aCenRepConfig);
       
   130         void LoadSecondaryControllersL(CRepository& aCenRepConfig);
       
   131 		
       
   132 	private: // data
       
   133     	/**
       
   134 		 * UI controller array.
       
   135 		 * Own.
       
   136 		 */
       
   137 		mutable RPointerArray<CAiUiController> iUiControllerArray;
       
   138 		
       
   139     	/**
       
   140 		 * Main UI controller for app session. Owned in above array.
       
   141 		 */
       
   142 		MAiMainUiController*  iMainUiController;
       
   143 		
       
   144 		/**
       
   145 		 * List of UI framework observers to delegate events
       
   146 		 */
       
   147 		RPointerArray<MAiUiFrameworkObserver> iUiFrameworkObservers;
       
   148 		
       
   149 		/**
       
   150 		 * List to check for duplicated creations.
       
   151 		 */
       
   152 		RArray<TInt> iCreatedUICList;
       
   153 	};
       
   154 
       
   155 #endif // C_AIUICONTROLLERMANAGER_H
       
   156