idlehomescreen/xmluicontroller/inc/xmluicontroller.h
branchRCL_3
changeset 34 5456b4e8b3a8
equal deleted inserted replaced
33:5f0182e07bfb 34:5456b4e8b3a8
       
     1 /*
       
     2 * Copyright (c) 2005-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:  XML UI Controller main class
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef _XMLUICONTROLLER_H
       
    19 #define _XMLUICONTROLLER_H
       
    20 
       
    21 // System includes
       
    22 
       
    23 // User includes
       
    24 #include <aisystemuids.hrh>
       
    25 #include "aiuicontroller.h"
       
    26 #include "aiuieventhandler.h"
       
    27 
       
    28 // Constants
       
    29 const TInt KImplementationUidXmlUiController = AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML;
       
    30 const TUid KUidXmlUiController = { KImplementationUidXmlUiController };
       
    31 
       
    32 // Forward declarations
       
    33 class CApaApplication;
       
    34 class TXnUiEngineAppIf;
       
    35 class CXnNodeAppIf;
       
    36 class CRepository;
       
    37 class THsPublisherInfo;
       
    38 
       
    39 namespace AiXmlUiController
       
    40 {
       
    41 class CAppUi;
       
    42 class CAIXuikonEventHandler;
       
    43 class CXmlNodeIdGenerator;
       
    44 class CContentRenderer;
       
    45 class CContentPublisher;
       
    46 
       
    47 /**
       
    48  *  @ingroup group_xmluicontroller
       
    49  * 
       
    50  *  Active Idle XML UI Controller.
       
    51  */
       
    52 NONSHARABLE_CLASS( CXmlUiController ) : public CAiUiController,
       
    53     public MAiMainUiController, public MAiUiEventHandler                         
       
    54     {
       
    55 public:   
       
    56     // Constructors and destructor
       
    57 
       
    58     static CXmlUiController* NewL();
       
    59     
       
    60     ~CXmlUiController();
       
    61 
       
    62 public: 
       
    63     // New functions
       
    64     
       
    65     /**
       
    66      * Sets content observer.
       
    67      * 
       
    68      * @since S60 5.0
       
    69      * @param aObserver Conten observer 
       
    70      */
       
    71     void SetObserver( MAiContentObserver& aObserver );
       
    72 
       
    73     /**
       
    74      * Set the app ui when created.
       
    75      * 
       
    76      * @since S60 5.0
       
    77      * @param aAppUi AppUi
       
    78      */
       
    79     void SetAppUi( CAppUi& aAppUi );
       
    80     
       
    81     /**
       
    82      * Get app ui.
       
    83      * 
       
    84      * @since S60 5.0
       
    85      * @return AppUi
       
    86      */
       
    87     CAppUi* AppUi() const;
       
    88 
       
    89     /**
       
    90      * Creates and returns Xuikon event handler.
       
    91      * 
       
    92      * @since S60 5.0
       
    93      * @param aContentRender Content renderer
       
    94      * @return Xuikon event handler
       
    95      */
       
    96     CAIXuikonEventHandler* CreateXuikonEventHandlerL(
       
    97         CContentRenderer& aRenderer );
       
    98     
       
    99     /**
       
   100      * Call from App Ui ConstructL to notify AI FW that the App env is ready.
       
   101      * 
       
   102      * @since S60 5.0
       
   103      */
       
   104     void NotifyAppEnvReadyL();
       
   105 
       
   106     /**
       
   107      * Gets UiFw event handler 
       
   108      *
       
   109      * @since S60 5.0
       
   110      * @return UiFw event handler     
       
   111      */    
       
   112     MAiFwEventHandler* FwEventHandler() const;
       
   113 
       
   114     /**
       
   115      * Gets UiFw state handler 
       
   116      *
       
   117      * @since S60 5.2
       
   118      * @return UiFw state handler     
       
   119      */    
       
   120     MAiFwStateHandler* FwStateHandler() const;
       
   121     
       
   122     /**
       
   123      * Gets UiEngine.
       
   124      *
       
   125      * @since S60 5.0
       
   126      * @return UiEngine     
       
   127      */        
       
   128     TXnUiEngineAppIf* UiEngineL() const;
       
   129     
       
   130 	/**
       
   131 	 * Get settings repository.
       
   132 	 * 
       
   133 	 * @since S60 5.0
       
   134 	 * @return Settings repository
       
   135 	 */
       
   136     CRepository& SettingsRepository() const;
       
   137 
       
   138     /**
       
   139      * Gets xml ui publishers
       
   140      * 
       
   141      * @since S60 5.2
       
   142      * @param aSource Xml node which defineds the publisher
       
   143      * @param aPublisherInfo Publisher info filled based aSource information
       
   144      */    
       
   145     void PublisherInfoL( CXnNodeAppIf& aSource,
       
   146         THsPublisherInfo& aPublisherInfo );
       
   147 
       
   148 public: 
       
   149     // from CAiUiController
       
   150 
       
   151     /**
       
   152      * @see CAiUiController
       
   153      */
       
   154     void LoadUIDefinitionL();
       
   155        
       
   156     /**
       
   157      * @see CAiUiController
       
   158      */    
       
   159     void GetSettingsL( const THsPublisherInfo& aPublisherInfo, 
       
   160         RAiSettingsItemArray& aSettings );
       
   161     
       
   162     /**
       
   163      * @see CAiUiController
       
   164      */    
       
   165     void ActivateUI();
       
   166     
       
   167     /**
       
   168      * @see CAiUiController
       
   169      */    
       
   170     MAiContentObserver& GetContentObserver();
       
   171     
       
   172     /**
       
   173      * @see CAiUiController
       
   174      */    
       
   175     void SetEventHandler( MAiFwEventHandler& aFwEventHandler );
       
   176     
       
   177     /**
       
   178      * @see CAiUiController
       
   179      */    
       
   180     void SetStateHandler( MAiFwStateHandler& aFwStateHandler );
       
   181        
       
   182     /**
       
   183      * @see CAiUiController
       
   184      */    
       
   185     MAiMainUiController* MainInterface();
       
   186     
       
   187     /**
       
   188      * @see CAiUiController
       
   189      */    
       
   190     MAiSecondaryUiController* SecondaryInterface();
       
   191         
       
   192 private: 
       
   193     // from MAiMainUiController
       
   194 
       
   195     /**
       
   196      * @see MAiMainUiController
       
   197      */
       
   198     void RunApplicationL();
       
   199     
       
   200     /**
       
   201      * @see MAiMainUiController
       
   202      */    
       
   203     CCoeEnv& CoeEnv();
       
   204             
       
   205     /**
       
   206      * @see MAiMainUiController
       
   207      */    
       
   208     void Exit();
       
   209 
       
   210     /**
       
   211      * @see MAiMainUiController
       
   212      */        
       
   213     TBool IsMenuOpen();
       
   214     
       
   215 private: 
       
   216     // from MAiUiEventHandler
       
   217 
       
   218     /**
       
   219      * @see MAiUiEventHandler
       
   220      */        
       
   221     TBool HandleUiEvent(TAny* aEvent, const TDesC8& aParam);
       
   222               
       
   223 private: 
       
   224     // Constructors
       
   225 
       
   226     /**
       
   227      * C++ default constructor
       
   228      */
       
   229     CXmlUiController();
       
   230     
       
   231     /**
       
   232      * 2nd phase constructor
       
   233      */
       
   234     void ConstructL();
       
   235 
       
   236 private: 
       
   237     // New functions
       
   238     
       
   239     static CApaApplication* NewApplication();
       
   240     
       
   241     void HandleFocusGainedL( const TDesC8& aUiElement1, 
       
   242         const TDesC8& aUiElement2, CXnNodeAppIf& aOrigin );
       
   243     
       
   244     void HandleSetElementSizeL( const TDesC8& aElementName, 
       
   245         CXnNodeAppIf& aOrigin );
       
   246     
       
   247     static TInt ExitTimerCallBack( TAny *aSelf );
       
   248        
       
   249     void GetConfigurationsL( CXnNodeAppIf& aNode, 
       
   250         RAiSettingsItemArray& aSettings, const TDesC& aConfOwner );
       
   251     
       
   252     void GetContentModelL( const THsPublisherInfo& aPubInfo, 
       
   253         RAiSettingsItemArray& aSettings );
       
   254                 
       
   255 private: 
       
   256     // data
       
   257         
       
   258     /** Ai content observer, Not owned */
       
   259     MAiContentObserver* iObserver;        
       
   260     /** AiFw Event handler, Not owned */
       
   261     MAiFwEventHandler* iFwEventHandler;
       
   262     /** AiFw State handler, Not owned */
       
   263     MAiFwStateHandler* iFwStateHandler;    
       
   264     /** * Node id generator, Owned */
       
   265     CXmlNodeIdGenerator* iNodeIdGenerator;    
       
   266     /** AppUi, Not owned */
       
   267     CAppUi* iAppUi;    
       
   268     /** Timer to call AppUi's exit, Owned */
       
   269     CPeriodic *iExitTimer; 
       
   270     /** Cenrep, Owned */
       
   271     CRepository *iAISettingsRepository;
       
   272     /** CPS publisher, Owned */
       
   273     CContentPublisher* iCPSpublisher;    
       
   274     /** Flag to indicate whether running as main UI controller */
       
   275     TBool iRunningAsMain;
       
   276     };    
       
   277 }  // namespace AiXmlUiController
       
   278 
       
   279 #endif  // _XMLUICONTROLLER_H
       
   280 
       
   281 // End of file