idlehomescreen/xmluicontroller/inc/xmluicontroller.h
changeset 0 f72a12da539e
child 9 f966699dea19
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     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 
       
    19 #ifndef C_XMLUICONTROLLER_H
       
    20 #define C_XMLUICONTROLLER_H
       
    21 
       
    22 #include <aisystemuids.hrh>
       
    23 #include "aiuicontroller.h"
       
    24 #include "aiuieventhandler.h"
       
    25 
       
    26 
       
    27 const TInt KImplementationUidXmlUiController = AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML;
       
    28 const TUid KUidXmlUiController = { KImplementationUidXmlUiController };
       
    29 
       
    30 
       
    31 class CApaApplication;
       
    32 class TXnUiEngineAppIf;
       
    33 class CXnNodeAppIf;
       
    34 class CRepository;
       
    35 
       
    36 namespace AiXmlUiController
       
    37 {
       
    38 
       
    39 class CAppUi;
       
    40 class CAIXuikonEventHandler;
       
    41 class CXmlNodeIdGenerator;
       
    42 class CContentRenderer;
       
    43 class CContentPublisher;
       
    44 
       
    45 
       
    46 /**
       
    47  *  @ingroup group_xmluicontroller
       
    48  * 
       
    49  *  Active Idle XML UI Controller.
       
    50  */
       
    51 class CXmlUiController : public CAiUiController,
       
    52                          public MAiMainUiController,
       
    53                          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 observer
       
   108      *
       
   109      * @since S60 5.0
       
   110      * @return UiFw observer     
       
   111      */
       
   112     MAiUiFrameworkObserver* UiFrameworkObserver() const;
       
   113 
       
   114     /**
       
   115      * Gets UiFw event handler 
       
   116      *
       
   117      * @since S60 5.0
       
   118      * @return UiFw event handler     
       
   119      */    
       
   120     MAiFwEventHandler* FwEventHandler() 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 native ui publishers
       
   140      * 
       
   141      * @since S60 5.0
       
   142      * @param aPlugins Array where plugins are appended.
       
   143      */
       
   144     void PublisherInfoL( RAiPublisherInfoArray& aPlugins );
       
   145 
       
   146     /**
       
   147      * Gets xml ui publishers
       
   148      * 
       
   149      * @since S60 5.0
       
   150      * @param aSource Xml node which defineds the publisher
       
   151      * @param aInfo Publisher info filled based aSource information
       
   152      */    
       
   153     void PublisherInfoL( CXnNodeAppIf& aSource,
       
   154                          TAiPublisherInfo& aInfo );
       
   155 
       
   156 public: 
       
   157     // from CAiUiController
       
   158 
       
   159     void LoadUIDefinitionL();
       
   160     
       
   161     void GetPluginsL( RAiPublisherInfoArray& aPlugins );
       
   162                                              
       
   163     void GetSettingsL( const TAiPublisherInfo& aPubInfo, 
       
   164         RAiSettingsItemArray& aSettings );
       
   165     
       
   166     void ActivateUI();
       
   167     
       
   168     MAiContentObserver& GetContentObserver();
       
   169     
       
   170     void SetEventHandler( MAiFwEventHandler& aFwEventHandler );
       
   171     
       
   172     void RemovePluginFromUI( MAiPropertyExtension& aPlugin );
       
   173             
       
   174     MAiMainUiController* MainInterface();
       
   175     
       
   176     MAiSecondaryUiController* SecondaryInterface();
       
   177         
       
   178 private: 
       
   179     // from MAiMainUiController
       
   180 
       
   181     void RunApplicationL();
       
   182     
       
   183     CCoeEnv& CoeEnv();
       
   184     
       
   185     void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver );
       
   186         
       
   187     void Exit();
       
   188     
       
   189     TBool IsMenuOpen();
       
   190     
       
   191 private: 
       
   192     // from MAiUiEventHandler
       
   193 
       
   194     TBool HandleUiEvent(TAny* aEvent, const TDesC8& aParam);
       
   195               
       
   196 private: 
       
   197     // Constructors
       
   198 
       
   199     CXmlUiController();
       
   200     
       
   201     void ConstructL();
       
   202 
       
   203 private: 
       
   204     // New methods    
       
   205     static CApaApplication* NewApplication();
       
   206     
       
   207     void HandleFocusGainedL( const TDesC8& aUiElement1, const TDesC8& aUiElement2, CXnNodeAppIf& aOrigin );
       
   208     
       
   209     void HandleSetElementSizeL( const TDesC8& aElementName, CXnNodeAppIf& aOrigin );
       
   210     
       
   211     static TInt ExitTimerCallBack(TAny *aSelf);
       
   212 
       
   213     void GetSettingsFromCRL( const TAiPublisherInfo& aPubInfo, RAiSettingsItemArray &aPluginSettings );
       
   214     
       
   215     void GetContentItemL(  CXnNodeAppIf& aNode, RAiSettingsItemArray& aSettings, HBufC*& aItemName );
       
   216     
       
   217     void GetConfigurationsL( CXnNodeAppIf& aNode, RAiSettingsItemArray& aSettings, const TDesC& aConfOwner );
       
   218     
       
   219     void GetContentModelL(const TAiPublisherInfo& aPubInfo, RAiSettingsItemArray& aSettings);
       
   220                 
       
   221 private: // data
       
   222         
       
   223     /**
       
   224      * Ai content observer. Not own.
       
   225      */
       
   226     MAiContentObserver* iObserver;
       
   227     
       
   228     /**
       
   229      * Ui framework observer. Not own.
       
   230      */
       
   231     MAiUiFrameworkObserver* iUiFrameworkObserver;
       
   232     
       
   233     /**
       
   234      * Event handler. Not own.
       
   235      */
       
   236     MAiFwEventHandler* iFwEventHandler;
       
   237     
       
   238     /**
       
   239      * Node id generator. Own.
       
   240      */
       
   241     CXmlNodeIdGenerator* iNodeIdGenerator;
       
   242     
       
   243     /**
       
   244      * App UI. Not own.
       
   245      */
       
   246     CAppUi* iAppUi;
       
   247     
       
   248     /**
       
   249      * Timer to call AppUi's exit. Own.
       
   250     **/
       
   251     CPeriodic *iExitTimer; 
       
   252     
       
   253     /**
       
   254      * Cenrep. Own.
       
   255      */
       
   256     CRepository *iAISettingsRepository;
       
   257 
       
   258     /**
       
   259      * CPS publisher. Own.
       
   260      */
       
   261     CContentPublisher* iCPSpublisher;
       
   262     
       
   263     /**
       
   264      * Flag to indicate whether running as main UI controller
       
   265      */
       
   266     TBool iRunningAsMain;
       
   267     };    
       
   268 }  // namespace AiXmlUiController
       
   269 
       
   270 #endif  // C_XMLUICONTROLLER_H