uifw/AvKon/akncompamode/inc/akncompautils.h
changeset 0 2f259fa3e83a
child 11 7e31c909d88d
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Compatibility mode utility functions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __AKNCOMPAUTILS_H__
       
    20 #define __AKNCOMPAUTILS_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 #include <barsc.h>
       
    25 
       
    26 class CAknCompaButton;
       
    27 class CAknAppUiBase;
       
    28 class CCoeEnv;
       
    29 class CAknCompaClearer;
       
    30 class CRepository;
       
    31 
       
    32 /**
       
    33  * Compatibility mode utility class
       
    34  *
       
    35  * Static functions to used by compatility mode
       
    36  *
       
    37  * @lib compamode.lib
       
    38  * @since S60 v5.0
       
    39  */
       
    40 NONSHARABLE_CLASS(AknCompaUtils)
       
    41     {
       
    42 public: // types
       
    43     enum
       
    44         {
       
    45         EQvgaWidth = 240,
       
    46         EQvgaHeight = 320,
       
    47         EQhdWidth = 360,
       
    48         EQhdHeight = 640
       
    49         };
       
    50 
       
    51     enum TCompaAppCheckResult
       
    52         {
       
    53         ECompaCheckResultNo,  // not a "compa mode" application
       
    54         ECompaCheckResultYes, // "compa mode" application
       
    55         ECompaCheckResultUndefinite // unsure whether compa mode is needed
       
    56         };
       
    57 
       
    58     enum TCompaModePanics
       
    59         {
       
    60         EButtonCount
       
    61         };
       
    62 
       
    63 public: // functions
       
    64 
       
    65     static TInt SetCompaAppScreenModeL(TBool& aScrModeChanged,
       
    66         TBool& aIsConsoleApp, CAknCompaClearer*& aClearer,
       
    67         TInt aAppUiFlags, CAknAppUiBase& aAppUi,
       
    68         const CCoeEnv& aCoeEnv, CRepository& aRepository);
       
    69 
       
    70     static TInt FindCompaScreenMode();
       
    71     
       
    72     static TBool IsGlobalUiSrv(TSecureId aSecureId);
       
    73     static TBool IsEikSrv(TSecureId aSecureId);
       
    74     static TBool IsAknCapSrv(TSecureId aSecureId);
       
    75 
       
    76     static void AknCompaUtils::ReadButtonsL(
       
    77         RPointerArray<CAknCompaButton>& aButtons, TInt& aPenButton,
       
    78         CCoeEnv& aCoeEnv);
       
    79 
       
    80     static void OpenResourceFileLC(RResourceFile& aResourceFile,
       
    81         RFs& aFsSession);
       
    82 
       
    83     static TInt AddTextResourceFileL(CCoeEnv& aCoeEnv);
       
    84 
       
    85     static void WaitTransEffectsOff(CRepository& aThemesCenRep);
       
    86 
       
    87     static void Panic(TInt aCode);
       
    88 
       
    89     static void ScaleRect(TRect& aRect, TInt aMoveX, TInt aMoveY);
       
    90     
       
    91 private: // functions
       
    92 
       
    93     static void SetAppScreenModeL(CAknAppUiBase& aAppUi, TInt aMode);
       
    94     
       
    95     static void ReadIntegerResourceL(RArray<TInt>& aArray,
       
    96         const RResourceFile& aResourceFile, TInt aResId);
       
    97 
       
    98     static TCompaAppCheckResult IsCompaModeAppL(TBool aIsConsoleApp,
       
    99         TInt aConfigFlags, TInt aAppUiFlags, const CCoeEnv& aCoeEnv);
       
   100 
       
   101     static TBool InGlobalUiSrv(TInt aAppUiFlags);
       
   102 
       
   103     static TBool IsConsoleApp(CAknAppUiBase& aAppUi);
       
   104     };
       
   105 
       
   106 #endif // __AKNCOMPAUTILS_H__