widgets/widgetapp/inc/WidgetUiAppUi.h
changeset 0 dd21522fd290
child 16 a359256acfc6
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 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 the License "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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef WIDGETUIAPPUI_H_
       
    20 #define WIDGETUIAPPUI_H_
       
    21 
       
    22 //  INCLUDES
       
    23 
       
    24 #include <eikapp.h>
       
    25 #include <eikdoc.h>
       
    26 #include <coeccntx.h>
       
    27 #include <AknViewAppUi.h>
       
    28 #include "ApiProvider.h"
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 // MACROS
       
    33 
       
    34 // DATA TYPES
       
    35 
       
    36 // FUNCTION PROTOTYPES
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 
       
    40 class CAknView;
       
    41 class CWidgetUiWindowManager;
       
    42 class CWidgetUiAsyncExit;
       
    43 class CIdle;
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 /**
       
    48 *  CWidgetUiAppUi
       
    49 *  @lib
       
    50 *  @since 3.1
       
    51 */
       
    52 class CWidgetUiAppUi : public CAknViewAppUi, MApiProvider
       
    53     {
       
    54     public: // // Constructors and destructor
       
    55 
       
    56         /**
       
    57         * Default constructor.
       
    58         * @since 3.1
       
    59         */
       
    60         CWidgetUiAppUi();
       
    61   
       
    62 
       
    63         /**
       
    64         * ~CWidgetUiAppUi
       
    65         * Destructor
       
    66         * @since 3.1
       
    67         * @param none
       
    68         * @return none
       
    69         */
       
    70         virtual ~CWidgetUiAppUi();
       
    71 
       
    72         /**
       
    73         * ProcessCommandParametersL
       
    74         * @since 3.1
       
    75         * @param CApaCommandLine
       
    76         * @return none
       
    77         */
       
    78         TBool ProcessCommandParametersL(CApaCommandLine &aCommandLine);
       
    79 
       
    80         /**
       
    81         * HandleCommandL
       
    82         * @since 3.1
       
    83         * @param aCommand id
       
    84         * @return void
       
    85         */
       
    86         void HandleCommandL( TInt aCommand );
       
    87 
       
    88         /**
       
    89         * HandleResourceChangeL
       
    90         * Handles screen resolution changes
       
    91         * @since 3.1
       
    92         * @param aType
       
    93         * @return void
       
    94         */
       
    95         void HandleResourceChangeL( TInt aType );
       
    96         
       
    97         /**
       
    98         * SendAppToBackground
       
    99         * Send widget ui to background
       
   100         * @since 3.1
       
   101         * @return void
       
   102         */
       
   103         void SendAppToBackground();
       
   104         
       
   105         /**
       
   106         * SetDisplayLandscapeL
       
   107         * Called to change the display orientation to landscape
       
   108         * @since 3.1
       
   109         */
       
   110         void SetDisplayLandscapeL( );
       
   111 
       
   112         /**
       
   113         * SetDisplayPortraitL
       
   114         * Called to change the display orientation to portrait
       
   115         * @since 3.1
       
   116         */
       
   117         void SetDisplayPortraitL( );
       
   118         
       
   119         /**
       
   120         * SetDisplayAuto
       
   121         * Called to set the display orientation is automatic
       
   122         * @since 3.1
       
   123         */
       
   124         void SetDisplayAuto( );
       
   125         
       
   126         /**
       
   127         * AsyncExit
       
   128         * Start an Async exit
       
   129         * @param aAllWidgets - ETrue to exit all widgets; EFalse to exit active widget
       
   130         * @since 3.1
       
   131         */
       
   132         void AsyncExit( TBool aAllWidgets );
       
   133         
       
   134     public: // from CEikAppUi 
       
   135           
       
   136         /**
       
   137         * ConstructL
       
   138         * EPOC default constructor.
       
   139         * @since 3.1
       
   140         * @param none
       
   141         * @return void
       
   142         */
       
   143         void ConstructL();
       
   144         
       
   145     public: // From MApiProvider
       
   146     
       
   147         /**
       
   148         * Exit the widget, if the widget is the only widget running, exit the application
       
   149         * @since 3.1
       
   150         */
       
   151         void ExitWidget();
       
   152     
       
   153     public:
       
   154         /**
       
   155          * Callback to delay foreground event after new widget starts
       
   156          * @param TAny* - pointer to app ui
       
   157          * @return TInt - return error code
       
   158          * @since 3.1
       
   159          */
       
   160         static TInt HandleDelayedForegroundEventCallback( TAny* aAppUi );
       
   161         
       
   162         /**
       
   163          * Delays foreground event after new widget starts
       
   164          * @return TInt - return error code
       
   165          * @since 3.1
       
   166          */
       
   167         TInt HandleDelayedForegroundEvent();
       
   168         
       
   169         /**
       
   170          * Override ProcessCommandL() to handle LSK handler
       
   171          * @param TInt - user command
       
   172          * @since 5.0
       
   173          */
       
   174         void ProcessCommandL(TInt aCommand);
       
   175 
       
   176     private: // From CEikAppUi
       
   177 
       
   178         /**
       
   179         * DynInitMenuPaneL
       
   180         * @since 3.1
       
   181         * @param aResourceId
       
   182         * @param aMenuPane
       
   183         * @return void
       
   184         */
       
   185         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   186 
       
   187         /**
       
   188         * HandleMessageL
       
   189         * @since 3.1
       
   190         * @param aClientHandleOfTargetWindowGroup
       
   191         * @param aMessageUid
       
   192         * @param aMessageParameters
       
   193         * @return TMessageResponse
       
   194         */
       
   195        MCoeMessageObserver::TMessageResponse HandleMessageL( 
       
   196                         TUint32 aClientHandleOfTargetWindowGroup,
       
   197                         TUid aMessageUid, 
       
   198                         const TDesC8& aMessageParameters );
       
   199 
       
   200         /**
       
   201         * HandleWsEventL
       
   202         * @since 3.1
       
   203         * @param aEvent
       
   204         * @param aDestination
       
   205         * @return none
       
   206         */               
       
   207        void HandleWsEventL( const TWsEvent&, CCoeControl* );
       
   208        
       
   209         /**
       
   210         * From CAknViewAppUi, CEikAppUi
       
   211         * Handles changes in keyboard focus when an 
       
   212         * application switches to foreground
       
   213         * @param aForeground Is foreground event?
       
   214         */
       
   215         void HandleForegroundEventL( TBool aForeground );
       
   216 
       
   217 		/**
       
   218         * Handles application specific events like OOM from window server.
       
   219         * @param aEventType The type of event.
       
   220         * @param aWsEvent window server event.
       
   221         * @return Key response.
       
   222         */
       
   223 		void HandleApplicationSpecificEventL(TInt aEventType, const TWsEvent& aWsEvent);
       
   224 
       
   225     private: // new function
       
   226 
       
   227         /**
       
   228         * ActiveView
       
   229         * @since 3.1
       
   230         * @param none
       
   231         * @return CAknView*
       
   232         */
       
   233         CAknView* ActiveView();
       
   234 
       
   235         /**
       
   236         * LoadAdditionalResourcefile
       
   237         * @since 3.1
       
   238         * @param none
       
   239         * @return none
       
   240         */
       
   241         void LoadAdditionalResourcefile();
       
   242         
       
   243         /**
       
   244         * SetRotationSupport
       
   245         * @since S60 v5.0
       
   246         * @param none
       
   247         * @return none
       
   248         */
       
   249         void SetRotationSupport();
       
   250         
       
   251         /**
       
   252         * Process command line argument and fetch related information.
       
   253         * 
       
   254         * The method parses the given command line argument, and 
       
   255         * fetches the UID and miniview size. Values are stored in
       
   256         * out-parameters.
       
   257         * Miniview is a boolean value. 0 == normal launch, !0 == miniview.
       
   258         *
       
   259         * @param aLine Command line
       
   260         * @param aUid Application uid
       
   261         * @param aOperation What to do: launch or deactivate.
       
   262         */
       
   263         void ProcessMessageArgumentsL( 
       
   264             const TDesC8& aLine,
       
   265             TUid& aUid,
       
   266             TUint32& aOperation );
       
   267 
       
   268         /**
       
   269         * Launch window.
       
   270         * 
       
   271         * Launches full window or miniview window, as suggested in parameters.
       
   272         * @param aMessage Message to process.
       
   273         */
       
   274         void LaunchWindowL( const TDesC8& aParams );
       
   275             
       
   276     private:
       
   277         // WindowManager to manage the list of running widget windows
       
   278         CWidgetUiWindowManager*       iWindowManager;
       
   279         // WidgetUiAsyncExit to handle async exiting of widgets
       
   280         CWidgetUiAsyncExit*           iWidgetUiAsyncExit;
       
   281         // delays foreground events till after new widget starts
       
   282         CIdle* iDelayedForegroundEvent;
       
   283         // Resource File
       
   284         TInt iResourceFile;
       
   285         
       
   286         TBool iIsForeground;
       
   287         TBool iRotationSupported;
       
   288     };
       
   289 
       
   290 #endif // WIDGEUIAPPUI_H
       
   291 
       
   292 // End of File