epoc32/include/mw/aknappui.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description: 
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
#ifndef __AKNAPPUI_H__
williamr@2
    19
#define __AKNAPPUI_H__
williamr@2
    20
williamr@2
    21
//  INCLUDES
williamr@2
    22
#include <eikappui.h>
williamr@2
    23
#include <Eikspane.h>
williamr@2
    24
#include <eikcba.h>
williamr@2
    25
#include <avkon.hrh>
williamr@2
    26
#include <akndef.h>
williamr@2
    27
#include <AknTouchPaneObserver.h>
williamr@2
    28
williamr@2
    29
// FORWARD DECLARATIONS
williamr@2
    30
class CEikButtonGroupContainer;
williamr@2
    31
class CAknAppShutter;
williamr@2
    32
class CAknAppUiExtension;
williamr@2
    33
class CAknWsEventMonitor;
williamr@2
    34
class CAknKeySoundSystem;
williamr@2
    35
class CAknAppUiBaseExtension;
williamr@2
    36
class CAknTouchPane;
williamr@2
    37
class CAknToolbar;
williamr@2
    38
class CAknPointerEventModifier;
williamr@2
    39
williamr@2
    40
// MACROS
williamr@2
    41
#define iAvkonAppUi ((CAknAppUi*)CEikonEnv::Static()->EikAppUi())
williamr@2
    42
#define iAvkonAppUiBase ((CAknAppUiBase*)CEikonEnv::Static()->EikAppUi())
williamr@2
    43
williamr@2
    44
/**
williamr@2
    45
*  Avkon key resolver interface
williamr@2
    46
*
williamr@2
    47
*  @since S60 3.1
williamr@2
    48
*/
williamr@2
    49
class MAknAliasKeyCodeResolver
williamr@2
    50
    {
williamr@2
    51
public:
williamr@2
    52
    /**
williamr@2
    53
    * Resolves keyboard layout dependent keycode for the given event 
williamr@2
    54
    *
williamr@2
    55
    * @since S60 3.1
williamr@2
    56
    * @param aCode reference to variable to contain new keycode 
williamr@2
    57
    * @param aKeyEvent reference to original, complete, event
williamr@2
    58
    * @param aType indicating original event type
williamr@2
    59
    * @return KErrNone on success, otherwise system wide error codes
williamr@2
    60
    */
williamr@2
    61
    virtual TInt GetAliasKeyCode(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType)=0;        
williamr@2
    62
    };
williamr@2
    63
williamr@2
    64
// CLASS DECLARATION
williamr@2
    65
williamr@2
    66
/**
williamr@2
    67
*  Abstract Avkon application UI base class
williamr@2
    68
*
williamr@2
    69
*  @since S60 3.0
williamr@2
    70
*/
williamr@2
    71
class CAknAppUiBase : public CEikAppUi
williamr@2
    72
    {
williamr@2
    73
private:
williamr@2
    74
    friend class CAknAppUi;
williamr@2
    75
    enum
williamr@2
    76
        {
williamr@2
    77
        EAppOrientationSpecifiedFlag            = 0x00010000, // In area reserved for System Guis
williamr@2
    78
        EAppOrientationLandscapeFlag            = 0x00020000,
williamr@2
    79
        EAppOrientationAutomaticFlag            = 0x00040000,
williamr@2
    80
        EAknEnableSkinFlag                      = 0x00080000,
williamr@2
    81
        // Since 3.0
williamr@2
    82
        EAknDisableHighlightAnimationFlag       = 0x00100000,
williamr@2
    83
        EAknEnableMSKflag                       = 0x00200000,
williamr@2
    84
        /**
williamr@2
    85
         * When enabled, avkon does not complete startup effect
williamr@2
    86
         * application has to do it by itself.
williamr@2
    87
         *
williamr@2
    88
         * @since S60 3.2
williamr@2
    89
         *
williamr@2
    90
         */
williamr@2
    91
        EAknExplicitStartupEffectCompletionFlag     = 0x00400000,
williamr@2
    92
williamr@2
    93
        /**
williamr@2
    94
         * Application supports touch (doesn't need keyboard). If the flag
williamr@2
    95
         * is missing and compatibility mode is enabled in a device,
williamr@2
    96
         * application is run in a compatibility mode (QVGA window with a
williamr@2
    97
         * virtual keypad.
williamr@2
    98
         *
williamr@2
    99
         * @since S60 5.0
williamr@2
   100
         */
williamr@2
   101
        EAknTouchCompatibleFlag                 = 0x00800000
williamr@2
   102
        };
williamr@2
   103
williamr@2
   104
    public:
williamr@2
   105
williamr@2
   106
    enum TAppUiOrientation
williamr@2
   107
        {
williamr@2
   108
        /**
williamr@2
   109
        * Use the default device screen rotation of the product for this 
williamr@2
   110
        * application. This is the default rotation setting for an 
williamr@2
   111
        * application, and it should be used by nearly all applications. 
williamr@2
   112
        */
williamr@2
   113
        EAppUiOrientationUnspecified,
williamr@2
   114
        /**
williamr@2
   115
        * Use a portrait screen rotation for this application.
williamr@2
   116
        * This should only be used when an application specifically wants
williamr@2
   117
        * portrait rotation. The device will select an appropriate portrait
williamr@2
   118
        * rotation, if one is available.
williamr@2
   119
        */
williamr@2
   120
        EAppUiOrientationPortrait,
williamr@2
   121
        /**
williamr@2
   122
        * Use a landscape screen rotation for this application.
williamr@2
   123
        * This should only be used when an application specifically wants
williamr@2
   124
        * landscape rotation. The device will select an appropriate landscape
williamr@2
   125
        * rotation, if one is available.
williamr@2
   126
        */
williamr@2
   127
        EAppUiOrientationLandscape,
williamr@2
   128
        /**
williamr@2
   129
        * Use the normal device screen rotation for this application.
williamr@2
   130
        * Both portrait and landscape screen rotations are possible. The 
williamr@2
   131
        * application rotation follows device screen rotation.
williamr@2
   132
        */
williamr@2
   133
        EAppUiOrientationAutomatic
williamr@2
   134
        };
williamr@2
   135
    enum
williamr@2
   136
        {
williamr@2
   137
        /**
williamr@2
   138
        * Flag indicating that default skin parameters should be provided by
williamr@2
   139
        * UI controls created within the scope of this AppUi instance.
williamr@2
   140
        * This value (or binary combination with some other values) should
williamr@2
   141
        * be given as a parameter to <code>BaseConstructL</code> in case
williamr@2
   142
        * the application wants to enable default skin parameters for all
williamr@2
   143
        * the Avkon controls supporting them.
williamr@2
   144
        *
williamr@2
   145
        * Note: The value can be queried by using 
williamr@2
   146
        * <code>AknsUtils::AvkonSkinEnabled()</code> from AknSkins.lib.
williamr@2
   147
        *
williamr@2
   148
        * @since S60 2.0
williamr@2
   149
        */
williamr@2
   150
        EAknEnableSkin = EAknEnableSkinFlag,
williamr@2
   151
        EAppOrientationPortrait     = EAppOrientationSpecifiedFlag,
williamr@2
   152
        EAppOrientationLandscape    = EAppOrientationSpecifiedFlag 
williamr@2
   153
                                      | EAppOrientationLandscapeFlag,
williamr@2
   154
        EAppOrientationAutomatic    = EAppOrientationSpecifiedFlag
williamr@2
   155
                                      | EAppOrientationAutomaticFlag,
williamr@2
   156
        // Since 3.0
williamr@2
   157
        EAknDisableHighlightAnimation = EAknDisableHighlightAnimationFlag,
williamr@2
   158
        // Since 3.1
williamr@2
   159
        EAknEnableMSK = EAknEnableMSKflag,
williamr@2
   160
        // Since 3.2
williamr@2
   161
        EAknExplicitStartupEffectCompletion = EAknExplicitStartupEffectCompletionFlag,
williamr@2
   162
        // Since 5.0
williamr@2
   163
        EAknTouchCompatible = EAknTouchCompatibleFlag
williamr@2
   164
        };
williamr@2
   165
    enum TKeyEventFlag
williamr@2
   166
        {
williamr@2
   167
        EDisableSendKeyShort = 0x01, // Short press of send key
williamr@2
   168
        EDisableSendKeyLong  = 0x02  // Long press of send key
williamr@2
   169
        };    
williamr@2
   170
williamr@2
   171
public:
williamr@2
   172
    /**
williamr@2
   173
    * Destructor.
williamr@2
   174
    */    
williamr@2
   175
    IMPORT_C ~CAknAppUiBase();
williamr@2
   176
    
williamr@2
   177
    /**
williamr@2
   178
    * C++ Default constructor.
williamr@2
   179
    */
williamr@2
   180
    IMPORT_C CAknAppUiBase();
williamr@2
   181
public: 
williamr@2
   182
    
williamr@2
   183
    /**
williamr@2
   184
    * Initialises this Avkon base app UI with standard values. 
williamr@2
   185
    * @c aAppUiFlags values are common with 
williamr@2
   186
    * @c CEikAppUi::BaseConstructL(aAppUiFlags).
williamr@2
   187
    * @param aAppUiFlags Application user interface flags.
williamr@2
   188
    */
williamr@2
   189
    IMPORT_C void BaseConstructL( TInt aAppUiFlags );
williamr@2
   190
    
williamr@2
   191
    /**
williamr@2
   192
    * Handles changes in keyboard focus when an application switches to,
williamr@2
   193
    * or from, the foreground. This function calls 
williamr@2
   194
    * @c CEikAppUi::HandleForegroundEventL.
williamr@2
   195
    * @param aForeground @c ETrue if the application is in the foreground, 
williamr@2
   196
    * otherwise @c EFalse.
williamr@2
   197
    */ 
williamr@2
   198
    IMPORT_C void HandleForegroundEventL(TBool aForeground);
williamr@2
   199
williamr@2
   200
public: // From CEikAppUi
williamr@2
   201
    
williamr@2
   202
    /**
williamr@2
   203
    * From @c CEikAppUi. Completes construction. The implementation of 
williamr@2
   204
    * @c ConstructL() in @c CAknAppUiBase simply calls @c BaseConstructL().
williamr@2
   205
    */
williamr@2
   206
    IMPORT_C void ConstructL();  // virtual
williamr@2
   207
    
williamr@2
   208
    /** 
williamr@2
   209
    * From @c CEikAppUi. Closes the app UI.
williamr@2
   210
    */
williamr@2
   211
    IMPORT_C void Exit(); //virtual
williamr@2
   212
    
williamr@2
   213
    /**
williamr@2
   214
    * From @c CEikAppUi. Sets whether the windows are faded.
williamr@2
   215
    * @param aFaded @c ETrue if windows are faded, otherwise windows are 
williamr@2
   216
    * unfaded.
williamr@2
   217
    */
williamr@2
   218
    IMPORT_C void SetFadedL(TBool aFaded); // virtual
williamr@2
   219
    
williamr@2
   220
    /**
williamr@2
   221
    * From @c CEikAppUi. Handles a change to the application's resources which
williamr@2
   222
    * are shared across the environment. This function calls 
williamr@2
   223
    * @c CEikAppUi::HandleResourceChangeL except when @c aType is 
williamr@2
   224
    * @c KEikDynamicLayoutVariantSwitch.
williamr@2
   225
    * @param aType The type of resources that have changed. 
williamr@2
   226
    */
williamr@2
   227
    IMPORT_C void HandleResourceChangeL(TInt aType); // virtual
williamr@2
   228
    
williamr@2
   229
    /**
williamr@2
   230
    * From @c CEikAppUi. Gets the total area of the screen available to the
williamr@2
   231
    * application. This includes the space that is available for a toolbar, 
williamr@2
   232
    * toolband or title band, if the application requires them.
williamr@2
   233
    * @return The total area of the screen available to the application.
williamr@2
   234
    */
williamr@2
   235
    IMPORT_C TRect ApplicationRect() const; //virtual
williamr@2
   236
williamr@2
   237
public: // from CCoeAppUiBase
williamr@2
   238
    
williamr@2
   239
    /** 
williamr@2
   240
    * From @c CCoeAppUiBase. Performs pre-exit processing by calling 
williamr@2
   241
    * @c CEikAppUi::PrepareToExit() to ensure the application will exit
williamr@2
   242
    * cleanly.
williamr@2
   243
    */
williamr@2
   244
    IMPORT_C void PrepareToExit();
williamr@2
   245
public: // New Functions
williamr@2
   246
    /**
williamr@2
   247
    * Determines whether the system is faded.
williamr@2
   248
    * @return @c ETrue if system is faded 
williamr@2
   249
    */
williamr@2
   250
    IMPORT_C TBool IsFaded() const;
williamr@2
   251
williamr@2
   252
    /**
williamr@2
   253
    * Returns the object which allows events to be spyed upon in addition to
williamr@2
   254
    * normal event handling.
williamr@2
   255
    * @return Pointer to window server event monitor object.
williamr@2
   256
    */
williamr@2
   257
    IMPORT_C CAknWsEventMonitor* EventMonitor() const;
williamr@2
   258
    
williamr@2
   259
    /**
williamr@2
   260
    * Gets a pointer to KeySound API object.
williamr@2
   261
    * @return Pointer to KeySound API object. 
williamr@2
   262
    */
williamr@2
   263
    IMPORT_C CAknKeySoundSystem* KeySounds() const;
williamr@2
   264
williamr@2
   265
    /**
williamr@2
   266
    * Determines whether the application is full screen application.
williamr@2
   267
    * @return @c ETrue if the application is full screen application.
williamr@2
   268
    */
williamr@2
   269
    IMPORT_C TBool IsFullScreenApp() const;
williamr@2
   270
    
williamr@2
   271
    /**
williamr@2
   272
    * Determines whether the application is layout aware.
williamr@2
   273
    * @return @c ETrue if the application is layout aware.
williamr@2
   274
    */
williamr@2
   275
    IMPORT_C TBool IsLayoutAwareApp() const;
williamr@2
   276
    
williamr@2
   277
    /**
williamr@2
   278
    * Determines whether the application has MSK enabled.
williamr@2
   279
    * @return @c ETrue if the application has MSK enabled.
williamr@2
   280
    *
williamr@2
   281
    * @since 3.1 
williamr@2
   282
    */
williamr@2
   283
    TBool IsMSKEnabledApp() const;
williamr@2
   284
williamr@2
   285
    /**
williamr@2
   286
    * Determines whether the application is closing.
williamr@2
   287
    * In practice this means that CEikonEnv has been destroyed.
williamr@2
   288
    * @return @c ETrue if the application is closing.
williamr@2
   289
    *
williamr@2
   290
    * @since 3.2
williamr@2
   291
    */
williamr@2
   292
    TBool IsAppClosing() const;
williamr@2
   293
    
williamr@2
   294
    /**
williamr@2
   295
    * Set application layout aware.
williamr@2
   296
    * @param aLayoutAwareApp @c ETrue if the application is layout aware, 
williamr@2
   297
    * @c EFlase otherwise.
williamr@2
   298
    */
williamr@2
   299
    IMPORT_C void SetLayoutAwareApp(TBool aLayoutAwareApp);
williamr@2
   300
    
williamr@2
   301
    /**
williamr@2
   302
    * Determines whether the application is foreground.
williamr@2
   303
    * @return @c ETrue if the application is foreground.
williamr@2
   304
    */
williamr@2
   305
    IMPORT_C TBool IsForeground() const;
williamr@2
   306
    
williamr@2
   307
    /**
williamr@2
   308
    * Determines whether the application is partially foreground.
williamr@2
   309
    * @return @c ETrue if the application is partially foreground.
williamr@2
   310
    */
williamr@2
   311
    IMPORT_C TBool IsPartialForeground() const;
williamr@2
   312
williamr@2
   313
    /**
williamr@2
   314
    * Gets the application screen orientation.
williamr@2
   315
    * @return Application screen orientation.
williamr@2
   316
    */
williamr@2
   317
    IMPORT_C TAppUiOrientation Orientation() const;
williamr@2
   318
    
williamr@2
   319
    /**
williamr@2
   320
    * Tests whether it is possible for this app to have a
williamr@2
   321
    * practical effect on the screen orientation, through
williamr@2
   322
    * SetOrientationL().
williamr@2
   323
    * @since S60 3.2
williamr@2
   324
    * @return ETrue if SetOrientationL can change the orientation, EFalse otherwise.
williamr@2
   325
    */
williamr@2
   326
    IMPORT_C TBool OrientationCanBeChanged() const;
williamr@2
   327
    
williamr@2
   328
    /**
williamr@2
   329
    * Sets the application screen orientation.
williamr@2
   330
    * Note: this API has no effect on non-full-screen app UIs.
williamr@2
   331
    * @param aOrientation application screen orientation.
williamr@2
   332
    */
williamr@2
   333
    IMPORT_C void SetOrientationL(TAppUiOrientation aOrientation);
williamr@2
   334
williamr@2
   335
    /**
williamr@2
   336
    * Find the window group ID of the application below this application.
williamr@2
   337
    * @return the window group ID of the application below this application.
williamr@2
   338
    */
williamr@2
   339
    TInt FindAppWgIdBelowMeL();
williamr@2
   340
    
williamr@2
   341
    /**
williamr@2
   342
    * Simply return @c KEikPartialForeground if @c aPartialFg == @c ETrue, 
williamr@2
   343
    * otherwise if @c aForeground == @c ETrue then return @c EEventFocusGained
williamr@2
   344
    * else return @c EEventFocusLost.  
williamr@2
   345
    * @return if @c aPartialFg then return KEikPartialForeground.
williamr@2
   346
    */
williamr@2
   347
    TInt EventForForegroundState(TBool aPartialFg, TBool aForeground);
williamr@2
   348
    
williamr@2
   349
    /**
williamr@2
   350
    * Determines whether the thread owning this application window group is
williamr@2
   351
    * foreground.    
williamr@2
   352
    * @return @c ETrue if the thread owning this application window group is
williamr@2
   353
    * foreground, @c EFlase otherwise.
williamr@2
   354
    */
williamr@2
   355
    TBool ThreadIsForeground() const;
williamr@2
   356
williamr@2
   357
    /**
williamr@2
   358
    * Simulates an event being received from wserv
williamr@2
   359
    * @param aEvent the event id being simulated.
williamr@2
   360
    */
williamr@2
   361
    void SimulateWsEventL(TInt aEvent);
williamr@2
   362
williamr@2
   363
    /** 
williamr@2
   364
     * Gets the application local zoom
williamr@2
   365
     * @return Application local zoom
williamr@2
   366
     * @since 3.1 
williamr@2
   367
     */
williamr@2
   368
    IMPORT_C TAknUiZoom LocalUiZoom() const;
williamr@2
   369
williamr@2
   370
    /**
williamr@2
   371
    * Sets the application local zoom. However, in order to have any 
williamr@2
   372
    * effect, it may be necessary to make a subsequent call to  
williamr@2
   373
    * @c ApplyLayoutChangeL.
williamr@2
   374
    *
williamr@2
   375
    * @param aZoom application local zoom
williamr@2
   376
    * @since 3.1 
williamr@2
   377
    */
williamr@2
   378
    IMPORT_C void SetLocalUiZoom(TAknUiZoom aZoom);
williamr@2
   379
williamr@2
   380
    /*
williamr@2
   381
    * Can be used to apply changes to settings that affect the current layout,
williamr@2
   382
    * such as changes to the local zoom. Optionally reports the change
williamr@2
   383
    * to the layout to all controls in the application. There are a number of 
williamr@2
   384
    * different possible usages of this API:
williamr@2
   385
    * <ul>
williamr@2
   386
    * <li> Can be used to immediately change the local zoom, by passing in 
williamr@2
   387
    * ETrue for the reporting parameter.</li>
williamr@2
   388
    * <li> Can be called before BaseConstructL without leaving, the effect
williamr@2
   389
    * is the same as passing EFalse for the reporting parameter, as 
williamr@2
   390
    * the correct layout data is picked up later on during control layout.</li>
williamr@2
   391
    * <li>Can be used by implementors of the 
williamr@2
   392
    * @c MAknSettingCacheUpdatePlugin interface, in order to set the local 
williamr@2
   393
    * zoom whilst updating the settings cache. By passing in EFalse for the 
williamr@2
   394
    * reporting parameter, the layout switch is deferred to the usual 
williamr@2
   395
    * processing in @c UpdateSettingCacheAndForwardEventL.</li>
williamr@2
   396
    * <li> Can be used by controls that require a different local zoom to 
williamr@2
   397
    * the underlying application, such as a dialog. By not 
williamr@2
   398
    * reporting the change during construction, the dialog will lay itself out 
williamr@2
   399
    * correctly. However, the dialog must then report the change back to the 
williamr@2
   400
    * app zoom level when it closes, ignoring the resulting resource changed 
williamr@2
   401
    * layout switch event.</li>
williamr@2
   402
    * </ul>
williamr@2
   403
    *
williamr@2
   404
    * @param aReportChange if this is true, then the layout event will be 
williamr@2
   405
    *               reported to controls on the control stack
williamr@2
   406
    * @since 3.1 
williamr@2
   407
    */    
williamr@2
   408
    IMPORT_C void ApplyLayoutChangeL(TBool aReportChange);
williamr@2
   409
    
williamr@2
   410
    /**
williamr@2
   411
    * Checks if application UI has full or partial foreground status.
williamr@2
   412
    * @since 3.2
williamr@2
   413
    * @return ETrue if application UI has full or partial foreground status.
williamr@2
   414
    *         Otherwise EFalse.
williamr@2
   415
    */
williamr@2
   416
    TBool HasFullOrPartialForeground() const;    
williamr@2
   417
williamr@2
   418
    /**
williamr@2
   419
    * Sets the flags for default key event handling
williamr@2
   420
    * @since 5.0
williamr@2
   421
    * @param aFlags which can be a combination of flags 
williamr@2
   422
    *        declared in enumeration TKeyEventFlag 
williamr@2
   423
    */
williamr@2
   424
    IMPORT_C void SetKeyEventFlags( const TInt aFlags );
williamr@2
   425
    
williamr@2
   426
    /**
williamr@2
   427
    * Returns a pointer to appui's pointer event modifier. This method is
williamr@2
   428
    * intended for internal usage only.
williamr@2
   429
    *
williamr@2
   430
    * @since S60 v5.0
williamr@2
   431
    * @return pointer event modifier
williamr@2
   432
    */
williamr@2
   433
    IMPORT_C CAknPointerEventModifier* PointerEventModifier();
williamr@2
   434
    
williamr@2
   435
    /**
williamr@2
   436
    * Checks if the application is touch compatible i.e. it has been
williamr@2
   437
    * constructed with the flag EAknTouchCompatible.
williamr@2
   438
    *
williamr@2
   439
    * @since S60 v5.0
williamr@2
   440
    * @return ETrue if the application is touch compatible
williamr@2
   441
    */
williamr@2
   442
    IMPORT_C TBool IsTouchCompatible() const;
williamr@2
   443
    
williamr@2
   444
protected: // From CCoeAppUiBase
williamr@2
   445
    /**
williamr@2
   446
    * From @c CCoeAppUiBase.   
williamr@2
   447
    * Calls CCoeAppUi::HandleScreenDeviceChangedL().
williamr@2
   448
    */
williamr@2
   449
    IMPORT_C virtual void HandleScreenDeviceChangedL(); // was Reserved_1()
williamr@2
   450
williamr@2
   451
protected: // From CCoeAppUi
williamr@2
   452
     
williamr@2
   453
    /**
williamr@2
   454
    * From @c CCoeAppUi. Handles an application specific event.
williamr@2
   455
    * @param aType The type of the event that occurred. This should be a 
williamr@2
   456
    * unique identifier constant.
williamr@2
   457
    * @param aEvent The window server event that occurred. 
williamr@2
   458
    */
williamr@2
   459
    IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType,
williamr@2
   460
        const TWsEvent& aEvent);
williamr@2
   461
williamr@2
   462
protected: // New functions
williamr@2
   463
    /**
williamr@2
   464
    * Set the application to be a full screen application.
williamr@2
   465
    * @param aIsFullScreen is @c ETrue if the application is a full screen
williamr@2
   466
    * application, @c EFlase otherwise.
williamr@2
   467
    */
williamr@2
   468
    IMPORT_C void SetFullScreenApp(TBool aIsFullScreen);
williamr@2
   469
    
williamr@2
   470
    /**
williamr@2
   471
    * Replace current key sound server with new one.
williamr@2
   472
    * @param aUid ID of the new key sound server.
williamr@2
   473
    */
williamr@2
   474
    IMPORT_C void ReplaceKeySoundsL( TInt aUid );
williamr@2
   475
williamr@2
   476
protected: // from MObjectProvider
williamr@2
   477
    IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
williamr@2
   478
williamr@2
   479
public: // not exported
williamr@2
   480
    void SetScreenModeL(TInt aModeNumber);
williamr@2
   481
    TInt ScreenMode() const;
williamr@2
   482
williamr@2
   483
private:
williamr@2
   484
    void UpdateSettingCacheAndForwardEventL( TInt aEventId );
williamr@2
   485
    // Method tests on aError. If < KErrNone, it calls CCoeEnv::SetAppUi in order to pass
williamr@2
   486
    // ownership to the environment. CCoeEnv then will delete the AppUi at the usual point in the destruct order
williamr@2
   487
    void SetAppUiAndLeaveIfErrorL( TInt aError );
williamr@2
   488
    TBool AlwaysForwardEvent( TInt aEventId );
williamr@2
   489
    void RelinquishPriorityToForegroundAppLC();
williamr@2
   490
williamr@2
   491
private:
williamr@2
   492
    // Avkon app ui class flags
williamr@2
   493
    TBitFlags iAknFlags;
williamr@2
   494
williamr@2
   495
    // Added for Avkon. Monitor events for emergency call support
williamr@2
   496
    CAknWsEventMonitor* iEventMonitor;
williamr@2
   497
williamr@2
   498
    // Added for Avkon. Provides access to keysound server.
williamr@2
   499
    // Moved from CAknAppUi, because CEikSrvUi needs it as well
williamr@2
   500
    CAknKeySoundSystem* iKeySounds; 
williamr@2
   501
    
williamr@2
   502
    CAknAppUiBaseExtension* iAppUiBaseExtension;
williamr@2
   503
    };
williamr@2
   504
williamr@2
   505
/**
williamr@2
   506
*  Abstract Avkon application UI class
williamr@2
   507
*
williamr@2
   508
*  @since S60 0.9
williamr@2
   509
*/
williamr@2
   510
williamr@2
   511
class CAknAppUi : public CAknAppUiBase, MEikStatusPaneObserver,
williamr@2
   512
            public MCoeViewDeactivationObserver,
williamr@2
   513
            public MAknTouchPaneObserver
williamr@2
   514
    {
williamr@2
   515
public:
williamr@2
   516
    
williamr@2
   517
    /**
williamr@2
   518
    * Initialises this Avkon app UI with standard values. @c aAppUiFlags
williamr@2
   519
    * values are common with @c CEikAppUi::BaseConstructL(aAppUiFlags). 
williamr@2
   520
    * Additionally those @c aAppUiFlags values can be bitwise ORed with
williamr@2
   521
    * @c EAknEnableSkin flag to provide default skin parameters for this AppUi
williamr@2
   522
    * instance.
williamr@2
   523
    * @param aAppUiFlags Application user interface flags.
williamr@2
   524
    */
williamr@2
   525
    IMPORT_C void BaseConstructL(TInt aAppUiFlags=EStandardApp);
williamr@2
   526
    
williamr@2
   527
    /**
williamr@2
   528
    * Destructor.
williamr@2
   529
    */
williamr@2
   530
    IMPORT_C ~CAknAppUi();
williamr@2
   531
williamr@2
   532
public: // From CEikAppUi
williamr@2
   533
     /**
williamr@2
   534
     * From @c CEikAppUi. Completes construction. The implementation of
williamr@2
   535
     * @c ConstructL() in @c CAknAppUi simply calls @c BaseConstructL().
williamr@2
   536
     */
williamr@2
   537
    IMPORT_C void ConstructL();  // virtual
williamr@2
   538
williamr@2
   539
public:
williamr@2
   540
    /**
williamr@2
   541
    * Gets a pointer to the status pane.
williamr@2
   542
    * @return Pointer to the status pane 
williamr@2
   543
    */
williamr@2
   544
    IMPORT_C CEikStatusPane* StatusPane();
williamr@2
   545
    /**
williamr@2
   546
    * Gets a pointer to the Command Button Area.
williamr@2
   547
    * @return Pointer to the CBA 
williamr@2
   548
    */
williamr@2
   549
    IMPORT_C CEikButtonGroupContainer* Cba();
williamr@2
   550
williamr@2
   551
    /**
williamr@2
   552
    * Gets a pointer to the touch pane.
williamr@2
   553
    * @return Pointer to the the touch pane
williamr@2
   554
    * @since S60 5.0
williamr@2
   555
    */
williamr@2
   556
    IMPORT_C CAknTouchPane* TouchPane();
williamr@2
   557
williamr@2
   558
    /**
williamr@2
   559
    * Gets a pointer to the application toolbar.
williamr@2
   560
    * @return Pointer to the applicaton toolbar or NULL
williamr@2
   561
    * @since S60 3.1
williamr@2
   562
    */
williamr@2
   563
    IMPORT_C CAknToolbar* PopupToolbar() const; 
williamr@2
   564
    
williamr@2
   565
    /**
williamr@2
   566
    * Gets a pointer to the current toolbar( view toolbar is priority ).
williamr@2
   567
    * @return Pointer to the current toolbar or NULL
williamr@2
   568
    * @since S60 3.1
williamr@2
   569
    */
williamr@2
   570
    IMPORT_C CAknToolbar* CurrentPopupToolbar() const;
williamr@2
   571
    
williamr@2
   572
    /**
williamr@2
   573
    * Gets a pointer to the current fixed toolbar( view toolbar is priority ).
williamr@2
   574
    * @return Pointer to the current fixed toolbar or NULL
williamr@2
   575
    * @since S60 5.0
williamr@2
   576
    */
williamr@2
   577
    IMPORT_C CAknToolbar* CurrentFixedToolbar() const; 
williamr@2
   578
williamr@2
   579
    
williamr@2
   580
    /**
williamr@2
   581
    * Hides popup toolbar if it is visible
williamr@2
   582
    * @since S60 3.1
williamr@2
   583
    */
williamr@2
   584
    void StopDisplayingPopupToolbar(); 
williamr@2
   585
        
williamr@2
   586
      
williamr@2
   587
    /**
williamr@2
   588
    * Processes user commands.
williamr@2
   589
    * This function passes @c aCommand (except values @c EAknSoftkeyOptions,
williamr@2
   590
    * @c EAknCmdExit, @c EEikCmdCanceled) to user derived @c HandleCommandL.
williamr@2
   591
    * @param aCommand A command ID.
williamr@2
   592
    */
williamr@2
   593
    IMPORT_C void ProcessCommandL(TInt aCommand);
williamr@2
   594
williamr@2
   595
    
williamr@2
   596
    /**
williamr@2
   597
    * Handles errors.
williamr@2
   598
    * @param aError The error code.
williamr@2
   599
    * @param aExtErr For extended error messages. Not used.
williamr@2
   600
    * @param aErrorText Error text. Not used.
williamr@2
   601
    * @param aContextText Text describing the context of the error. Not used.
williamr@2
   602
    * @return @c ENoDisplay if Error handled proper way, else 
williamr@2
   603
    * @c EErrorNotHandled
williamr@2
   604
    */
williamr@2
   605
    IMPORT_C TErrorHandlerResponse HandleError (TInt aError,
williamr@2
   606
        const SExtendedError& aExtErr, TDes& aErrorText, TDes& aContextText); 
williamr@2
   607
williamr@2
   608
    /**
williamr@2
   609
    * Run the application shutter if it exists.
williamr@2
   610
    */
williamr@2
   611
    IMPORT_C void RunAppShutter();
williamr@2
   612
    
williamr@2
   613
    /**
williamr@2
   614
    * Determines whether the application shutter is active.
williamr@2
   615
    * @return @c ETrue if application shutter is active.
williamr@2
   616
    */
williamr@2
   617
    IMPORT_C TBool IsAppShutterRunning() const;
williamr@2
   618
williamr@2
   619
    /**
williamr@2
   620
    * Determines whether the application is hidden in background.
williamr@2
   621
    * (i.e. HideInBackground has been called and application has not
williamr@2
   622
    *       yet been activated)
williamr@2
   623
    * @return @c ETrue if application is hidden in background.
williamr@2
   624
    */
williamr@2
   625
    TBool IsAppHiddenInBackground() const;
williamr@2
   626
    
williamr@2
   627
public: // MCoeViewDeactivationObserver
williamr@2
   628
williamr@2
   629
    /**
williamr@2
   630
    * From @c MCoeViewDeactivationObserver.
williamr@2
   631
    * Handles the deactivation of the view identified by
williamr@2
   632
    * @c aViewIdToBeDeactivated before the newly activated view with id
williamr@2
   633
    * @c aNewlyActivatedViewId is marked as current.
williamr@2
   634
    * Default implementation calls @c iAvkonEnv->CloseAllIntermediateStates()
williamr@2
   635
    * without using @c aViewIdToBeDeactivated and @c aNewlyActivatedViewId.
williamr@2
   636
    * @param aViewIdToBeDeactivated
williamr@2
   637
    * @param aNewlyActivatedViewId  
williamr@2
   638
    */
williamr@2
   639
    IMPORT_C virtual void HandleViewDeactivation(
williamr@2
   640
        const TVwsViewId& aViewIdToBeDeactivated,
williamr@2
   641
        const TVwsViewId &aNewlyActivatedViewId);
williamr@2
   642
williamr@2
   643
public: // from CCoeAppUiBase
williamr@2
   644
    
williamr@2
   645
    /**
williamr@2
   646
    * From @c CCoeAppUiBase. Performs pre-exit processing to ensure the
williamr@2
   647
    * application will exit cleanly.
williamr@2
   648
    */
williamr@2
   649
    IMPORT_C void PrepareToExit();
williamr@2
   650
williamr@2
   651
public: // from MAknTouchPaneObserver
williamr@2
   652
williamr@2
   653
    /**
williamr@2
   654
    * From @MAknTouchPaneObserver.
williamr@2
   655
    * Handles a change in the size or position of touch pane.
williamr@2
   656
    */
williamr@2
   657
    IMPORT_C void HandleTouchPaneSizeChange();
williamr@2
   658
williamr@2
   659
protected:
williamr@2
   660
    // from MEikStatusPaneObserver
williamr@2
   661
    /**
williamr@2
   662
    * From @c MEikStatusPaneObserver. Handles a change in the position or size
williamr@2
   663
    * of the screen area occupied by the status pane.
williamr@2
   664
    */  
williamr@2
   665
    IMPORT_C void HandleStatusPaneSizeChange();
williamr@2
   666
williamr@2
   667
    // from CCoeAppUi
williamr@2
   668
    /**
williamr@2
   669
    * From @c CCoeAppUi. Handles system events generated by the window server.
williamr@2
   670
    * @param aEvent The window server event that occurred.
williamr@2
   671
    */
williamr@2
   672
    IMPORT_C void HandleSystemEventL(const TWsEvent& aEvent);
williamr@2
   673
williamr@2
   674
protected: // formerly from MTopSetMember<CEikMenuBar>, now reserved
williamr@2
   675
    IMPORT_C virtual void Reserved_MtsmPosition();
williamr@2
   676
    IMPORT_C virtual void Reserved_MtsmObject();
williamr@2
   677
protected:
williamr@2
   678
    
williamr@2
   679
    /**
williamr@2
   680
    * Handles changes in keyboard focus when an application switches to, 
williamr@2
   681
    * or from, the foreground.
williamr@2
   682
    * @param aForeground @c ETrue if the application is in the foreground,
williamr@2
   683
    * otherwise @c EFalse.
williamr@2
   684
    */
williamr@2
   685
    IMPORT_C void HandleForegroundEventL(TBool aForeground);
williamr@2
   686
    
williamr@2
   687
    /**
williamr@2
   688
    * Handles window server events.
williamr@2
   689
    * @param aEvent The window server event that occurred.
williamr@2
   690
    * @param aDestination The control associated with the event.
williamr@2
   691
    */
williamr@2
   692
    IMPORT_C void HandleWsEventL(const TWsEvent& aEvent,
williamr@2
   693
        CCoeControl* aDestination);
williamr@2
   694
williamr@2
   695
    /**
williamr@2
   696
    * Set key block mode.
williamr@2
   697
    * In default mode, the S60 Developer Platform blocks simultaneous key
williamr@2
   698
    * presses.
williamr@2
   699
    * @param aMode @c ENoKeyBlock if no key block, otherwise
williamr@2
   700
    * @c EDefaultBlockMode
williamr@2
   701
    */
williamr@2
   702
    IMPORT_C void SetKeyBlockMode(TAknKeyBlockMode aMode);
williamr@2
   703
    IMPORT_C void HandleErrorL(TInt aError, HBufC** aErrorDesc, TBool aShowNote = ETrue );
williamr@2
   704
williamr@2
   705
#ifdef _DEBUG
williamr@2
   706
    
williamr@2
   707
    /**
williamr@2
   708
    * Prints out information about the control and all its subcontrols to
williamr@2
   709
    * RDebug console.
williamr@2
   710
    * @param aControl object to be printed.
williamr@2
   711
    * @param aLevel  positioning constant.
williamr@2
   712
    * @param aDebug stream for printing.
williamr@2
   713
    */
williamr@2
   714
    void DumpControl(CCoeControl* aControl, TInt aLevel, RDebug& aDebug);
williamr@2
   715
#endif
williamr@2
   716
    /**
williamr@2
   717
    * Try to set window server buffer size to @c KAknDefaultWsBufferSize.
williamr@2
   718
    */
williamr@2
   719
    void DecideWsClientBufferSizesL();
williamr@2
   720
williamr@2
   721
private:
williamr@2
   722
    void UpdateKeyBlockMode();
williamr@2
   723
    TBool SimulateHashKeyMarkingEvent(const TWsEvent& aEvent);
williamr@2
   724
williamr@2
   725
private:
williamr@2
   726
    TBool iDumpNextControl;
williamr@2
   727
    CAknAppShutter* iAppShutter;// May be set to NULL by the app shutter itself
williamr@2
   728
    TAknKeyBlockMode iBlockMode;
williamr@2
   729
    CAknAppUiExtension * iExtension;
williamr@2
   730
williamr@2
   731
public:
williamr@2
   732
    /**
williamr@2
   733
    * Hide application from Fast-swap window.
williamr@2
   734
    * @since S60 2.6
williamr@2
   735
    * @param aHide @c ETrue if application is hided from Fast-swap window, otherwise
williamr@2
   736
    * @c EFalse
williamr@2
   737
    */
williamr@2
   738
    IMPORT_C void HideApplicationFromFSW(TBool aHide=ETrue);
williamr@2
   739
williamr@2
   740
    /**
williamr@2
   741
    * Gets keyboard layout specific keycode. Uses given resolver
williamr@2
   742
    * SetAliasKeyCodeResolverL() if set, by default
williamr@2
   743
    * fetches alternative code from avkon server.
williamr@2
   744
    *
williamr@2
   745
    * @since S60 3.1
williamr@2
   746
    * @param aCode reference to variable to contain new keycode 
williamr@2
   747
    * @param aKeyEvent reference to original, complete, event
williamr@2
   748
    * @param aType indicating original event type
williamr@2
   749
    */
williamr@2
   750
    IMPORT_C void GetAliasKeyCodeL(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType);
williamr@2
   751
williamr@2
   752
    /**
williamr@2
   753
    * Sets custom resolver for keycode aliases
williamr@2
   754
    * Creates iExtension if it doesn't exist
williamr@2
   755
    * @since S60 3.1
williamr@2
   756
    * @param aHandler instance implementing MAknAliasKeyCodeResolver 
williamr@2
   757
    */
williamr@2
   758
    IMPORT_C void SetAliasKeyCodeResolverL(MAknAliasKeyCodeResolver* aResolver);
williamr@2
   759
    
williamr@2
   760
    /**
williamr@2
   761
    * This is same as RWindowGroup::CaptureKey, except that this version takes
williamr@2
   762
    * S60 keymappings into account and captures the key that produces requested
williamr@2
   763
    * aKeyCode according to S60 keymappings. Standard RWindowgroup::CaptureKey
williamr@2
   764
    * functionality takes place before S60 AppUi framework and has no knowledge
williamr@2
   765
    * of S60 keymappings.
williamr@2
   766
    * Note: This method requires same capabilites as RWindowGroup::CaptureKey()     
williamr@2
   767
    *
williamr@2
   768
    * @since S60 V3.2
williamr@2
   769
    * @param aKeycode The key code for the key to be captured. Key codes for
williamr@2
   770
    *                 special keys are defined in TKeyCode. 
williamr@2
   771
    * @param aModifier Mask Only the modifier keys in this mask are tested against
williamr@2
   772
    *                      the states specified in aModifier. 
williamr@2
   773
    * @param aModifier The key is captured only when the modifier keys specified in
williamr@2
   774
    *                  aModifierMask match these states, where 1=modifier set,
williamr@2
   775
    *                  and 0=modifier not set. Modifier key states are defined
williamr@2
   776
    *                  in TEventModifier. 
williamr@2
   777
    * @return A handle identifying the capture key, or one of the system-wide error
williamr@2
   778
    *                  codes (if <0). Handles should be kept in order to be passed to
williamr@2
   779
    *                  CancelCaptureKey() later. 
williamr@2
   780
    */
williamr@2
   781
    IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);         
williamr@2
   782
    
williamr@2
   783
    /**
williamr@2
   784
    * This is same as RWindowGroup::CaptureKey, except that this version takes
williamr@2
   785
    * S60 keymappings into account and captures the key that produces requested
williamr@2
   786
    * aKeyCode according to S60 keymappings. This version leaves instead of returning
williamr@2
   787
    * an error code. Standard RWindowgroup::CaptureKey functionality takes place
williamr@2
   788
    * before S60 AppUi framework and has no knowledge of S60 keymappings.
williamr@2
   789
    * Note: This method requires same capabilites as RWindowGroup::CaptureKey() 
williamr@2
   790
    *
williamr@2
   791
    * @since S60 V3.2
williamr@2
   792
    * @param aKeycode The key code for the key to be captured. Key codes for
williamr@2
   793
    *                 special keys are defined in TKeyCode. 
williamr@2
   794
    * @param aModifier Mask Only the modifier keys in this mask are tested against
williamr@2
   795
    *                      the states specified in aModifier. 
williamr@2
   796
    * @param aModifier The key is captured only when the modifier keys specified in
williamr@2
   797
    *                  aModifierMask match these states, where 1=modifier set,
williamr@2
   798
    *                  and 0=modifier not set. Modifier key states are defined
williamr@2
   799
    *                  in TEventModifier. 
williamr@2
   800
    * @param aHandle   identifying the capture key. Handles should be kept in order
williamr@2
   801
    *                  to be passed to CancelCaptureKey() later. 
williamr@2
   802
    */    
williamr@2
   803
    IMPORT_C void CaptureKeyL(TUint aKeycode, TUint aModifierMask, TUint aModifier, TInt32& aHandle);
williamr@2
   804
    
williamr@2
   805
    /**
williamr@2
   806
    * This tells the application if it is allowed to hide itself in the
williamr@2
   807
    * background in response to a user (menu or softkey) exit command, 
williamr@2
   808
    * instead of actually exiting.
williamr@2
   809
    * If the application appears to exit, but actually leaves itself in
williamr@2
   810
    * memory, it may appear to start faster next time the user activates it.
williamr@2
   811
    *
williamr@2
   812
    * @since S60 V5.0
williamr@2
   813
    * @return ETrue if the application can hide itself in the background, 
williamr@2
   814
    *		  EFalse if it must exit properly by calling Exit().
williamr@2
   815
    */    
williamr@2
   816
    IMPORT_C TBool ExitHidesInBackground() const;
williamr@2
   817
    
williamr@2
   818
    /**
williamr@2
   819
    * Hide the running instance of this application from the user, which
williamr@2
   820
    * makes it appear as if the application has exited.
williamr@2
   821
    * This is done by placing the application in the background, behind 
williamr@2
   822
    * all other apps, and removing the application from the Fast Swap Window.
williamr@2
   823
    * When the application comes to the foreground again, it will be
williamr@2
   824
    * restored to the Fast Swap Window (in HandleForegroundEventL). If the
williamr@2
   825
    * application is not supposed to be in the Fast Swap Window, it will have
williamr@2
   826
    * to remove itself again.
williamr@2
   827
    * @since S60 V5.0
williamr@2
   828
    */    
williamr@2
   829
    IMPORT_C void HideInBackground();
williamr@2
   830
    
williamr@2
   831
    /**
williamr@2
   832
    * Disables next key sound (and repeated key sounds until pointer up event).
williamr@2
   833
    *
williamr@2
   834
    * @since S60 V5.0
williamr@2
   835
    * @param aScanCode Scan code of disabled key.
williamr@2
   836
    */
williamr@2
   837
    IMPORT_C void DisableNextKeySound( TInt aScanCode ); 
williamr@2
   838
    
williamr@2
   839
private:
williamr@2
   840
    TBool ExitHidesInBackgroundL() const;
williamr@2
   841
    };
williamr@2
   842
williamr@2
   843
williamr@2
   844
williamr@2
   845
#endif
williamr@2
   846
williamr@2
   847
williamr@2
   848
williamr@2
   849
williamr@2
   850
williamr@2
   851
williamr@2
   852