homescreensrv_plat/idlefw_api/inc/aiuicontroller.h
changeset 0 79c6a41cd166
child 8 d0529222e3f0
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2005-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:  UI controller API
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_AIUICONTROLLER_H
       
    20 #define C_AIUICONTROLLER_H
       
    21 
       
    22 #include <ecom/ecom.h>
       
    23 #include "aicontentmodel.h"
       
    24 #include "aifwdefs.h"
       
    25 #include "aiuicontrolleruid.hrh"
       
    26 #include "aipluginsettings.h"
       
    27 
       
    28 class MAiContentObserver;
       
    29 class MAiFwEventHandler;
       
    30 class MAiUiFrameworkObserver;
       
    31 class CCoeEnv;
       
    32 class CAiContentPublisher;
       
    33 class MAiMainUiController;
       
    34 class MAiSecondaryUiController;
       
    35 
       
    36 /**
       
    37  * ECom interface UID for CAiUiContoller
       
    38  */
       
    39 const TUid KInterfaceUidUiController = { AI_UID_ECOM_INTERFACE_UICONTROLLER };
       
    40 
       
    41 /**
       
    42  * UI Controller ECom interface for Active Idle.
       
    43  *
       
    44  * @since Series 60 3.2
       
    45  */
       
    46 class CAiUiController : public CBase
       
    47     {
       
    48 public:
       
    49 
       
    50 // Constructors and destructor
       
    51 
       
    52     /**
       
    53      * Static factory method.
       
    54      *
       
    55      * @since Series 60 3.2
       
    56      * @param ECom implementatoin uid
       
    57      * @return class instance
       
    58      */
       
    59     inline static CAiUiController* NewL(TUid aImpUid);
       
    60 
       
    61     /**
       
    62      * Static factory method.
       
    63      *
       
    64      * @since Series 60 3.2
       
    65      * @param mimetype
       
    66      * @return class instance
       
    67      */
       
    68     inline static CAiUiController* NewL(const TDesC8& aMime);
       
    69 
       
    70     /**
       
    71      * Destructor.
       
    72      */
       
    73     inline virtual ~CAiUiController();
       
    74 
       
    75 // New functions
       
    76 
       
    77     /**
       
    78      * Instructs this UI controller to load its UI definition.
       
    79      *
       
    80      * @since Series 60 3.2
       
    81      */
       
    82     virtual void LoadUIDefinitionL() = 0;
       
    83 
       
    84     /**
       
    85      * Retrieves the Content Publisher Plug-in list defined in this UI 
       
    86      * controller's UI model.
       
    87      *
       
    88      * @since Series 60 3.2
       
    89      */
       
    90     virtual void GetPluginsL(RAiPublisherInfoArray& aPlugins) = 0;
       
    91 
       
    92     /**
       
    93      * Retrieves plug-in settings specified in this UI controller's UI definition.
       
    94      *
       
    95      * @param aPubInfo      Publisher info of the plug-in for which to 
       
    96      *                      retrieve settings for.
       
    97      * @param aSettings array to get settings items to.
       
    98      */
       
    99     virtual void GetSettingsL(const TAiPublisherInfo& aPubInfo, 
       
   100     							RAiSettingsItemArray& aSettings) = 0;
       
   101 
       
   102     /**
       
   103      * Activate UI managed by this UI controller.
       
   104      *
       
   105      * @since Series 60 3.2
       
   106      */
       
   107     virtual void ActivateUI() = 0;
       
   108 
       
   109     /**
       
   110      * Returns content observer interface implemented by this UI controller.
       
   111      *
       
   112      * @since Series 60 3.2
       
   113      * @return reference to content observer implementation.
       
   114      */
       
   115     virtual MAiContentObserver& GetContentObserver() = 0;
       
   116 
       
   117     /**
       
   118      * Sets the Active Idle Framework event handler for this UI Controller.
       
   119      *
       
   120      * @since Series 60 3.2
       
   121      * @param aEventHandler Framework event handler for this UI controller. 
       
   122      *                      Set to NULL to disable event callbacks from this
       
   123      *                      UI Controller.
       
   124      */
       
   125     virtual void SetEventHandler(MAiFwEventHandler& aEventHandler) = 0;
       
   126     
       
   127     /**
       
   128      * Remove specified plugin from the UI.
       
   129      *
       
   130      * @param aPlugin plugin that is removed.
       
   131      */     
       
   132     virtual void RemovePluginFromUI( MAiPropertyExtension& aPlugin ) = 0;
       
   133 
       
   134     /**
       
   135      * Returns the main UI Controller interface, or NULL if this is not the 
       
   136      * main UI controller.
       
   137      */
       
   138     virtual MAiMainUiController* MainInterface() = 0;
       
   139 
       
   140     /**
       
   141      * Returns the secondary UI Controller interface, or NULL if this is not
       
   142      * a secondary UI controller.
       
   143      */
       
   144     virtual MAiSecondaryUiController* SecondaryInterface() = 0;   
       
   145     
       
   146 private:     // Data
       
   147 
       
   148     TUid iDestructKey; // An identifier used during destruction
       
   149 
       
   150     };
       
   151 
       
   152 inline CAiUiController* CAiUiController::NewL(TUid aImplUid)
       
   153     {
       
   154     TAny* ptr = REComSession::CreateImplementationL(aImplUid,
       
   155         _FOFF(CAiUiController, iDestructKey));
       
   156 
       
   157     return reinterpret_cast<CAiUiController*> (ptr);
       
   158     }
       
   159 
       
   160 inline CAiUiController* CAiUiController::NewL(const TDesC8& aMime)
       
   161     {
       
   162     TEComResolverParams params;
       
   163     params.SetDataType(aMime);
       
   164     TAny* ptr = REComSession::CreateImplementationL(KInterfaceUidUiController,
       
   165         _FOFF(CAiUiController, iDestructKey), params);
       
   166     return reinterpret_cast<CAiUiController*> (ptr);
       
   167     }
       
   168 
       
   169 inline CAiUiController::~CAiUiController()
       
   170     {
       
   171     REComSession::DestroyedImplementation(iDestructKey);
       
   172     }
       
   173 
       
   174 
       
   175 /**
       
   176  * Main UI Controller interface for Active Idle.
       
   177  *
       
   178  * @see CAiUiController
       
   179  * @since S60 3.2
       
   180  */
       
   181 class MAiMainUiController
       
   182     {
       
   183 public:
       
   184     /**
       
   185      * Starts application framework and application event loop.
       
   186      * This function returns only when the application is shut down.
       
   187      *
       
   188      * @exception Any of the system-wide error codes in case application
       
   189      *            creation or execution fails with an error.
       
   190      */
       
   191     virtual void RunApplicationL() = 0;
       
   192     
       
   193     /**
       
   194      * Returns the CONE environment object this main UI controller uses.
       
   195      */
       
   196     virtual CCoeEnv& CoeEnv() = 0;
       
   197     
       
   198     /**
       
   199      * Sets UI framework observer for this main UI controller.
       
   200      */
       
   201     virtual void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver ) = 0; 
       
   202     
       
   203     /**
       
   204     * Exits the main ui controller
       
   205     **/
       
   206     virtual void Exit() = 0;
       
   207     
       
   208     /**
       
   209      * Only main ui controller might know if menu is open.
       
   210      */
       
   211     virtual TBool IsMenuOpen() = 0;
       
   212     };
       
   213 
       
   214 /**
       
   215  * Secondary UI Controller interface for Active Idle.
       
   216  *
       
   217  * @see CAiUiController
       
   218  * @since S60 3.2
       
   219  */
       
   220 class MAiSecondaryUiController
       
   221     {
       
   222 public:
       
   223     /**
       
   224      * Sets the CONE environment object for this secondary UI controller to use.
       
   225      *
       
   226      * @param aCoeEnv the CONE environment object to use.
       
   227      */
       
   228     virtual void SetCoeEnv( CCoeEnv& aCoeEnv ) = 0;
       
   229     
       
   230     /**
       
   231      * Returns the UI framework observer of this secondary UI controller.
       
   232      *
       
   233      * @return The UI framework observer, or NULL if observer is not supported.
       
   234      */
       
   235     virtual MAiUiFrameworkObserver* UiFrameworkObserver() = 0; 
       
   236     };
       
   237 
       
   238 #endif // C_AIUICONTROLLER_H
       
   239 
       
   240 // End of File.