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