uifw/AvKon/AknKeyRotator/implementation/AknKeyRotatorImpl.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Key rotation implementation
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CAKNKEYROTATORIMPL_H
       
    19 #define CAKNKEYROTATORIMPL_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <AknKeyRotator.h>
       
    23 #include <e32property.h>
       
    24 #include <bitstd.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class TRawEvent;
       
    28 class MAnimGeneralFunctions;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  Key rotation implementation.
       
    34 *
       
    35 *  @lib AknKeyRotator.lib
       
    36 *  @since Series 60 3.0
       
    37 */
       
    38 class CAknKeyRotatorImpl : public CAknKeyRotator
       
    39     { 
       
    40     public: // Constructor and destructor
       
    41         static CAknKeyRotatorImpl* NewL();
       
    42         ~CAknKeyRotatorImpl();
       
    43 
       
    44     public: // Functions from base classes
       
    45         
       
    46         /**
       
    47         * From CAknKeyRotator
       
    48         */
       
    49         TBool CheckRotation( 
       
    50             const TRawEvent &aRawEvent,
       
    51             MAnimGeneralFunctions& aAnimGeneralFunctions );
       
    52             
       
    53     private:
       
    54         CAknKeyRotatorImpl();
       
    55         void ConstructL();
       
    56         void LoadHwStateRotationsL();
       
    57         void DoCheckRotation(
       
    58             TRawEvent& aNewRawEvent,
       
    59             MAnimGeneralFunctions& aAnimGeneralFunctions);
       
    60         static TBool IsArrowScanCode(TInt aScanCode);
       
    61         
       
    62         // Gets key rotator compensation value from wsini.ini
       
    63         static TInt GetKeyRotatorCompensationL();
       
    64         
       
    65         // Checks if character is end of line marker.
       
    66         inline static TBool IsEndOfLine( TText aChar );
       
    67         // Checks if character is byte ordering marker.
       
    68         inline static TBool IsByteOrderingMarker( TText aChar );
       
    69         // Reads wsini.ini file to memory
       
    70         static HBufC* GetWsiniLC();
       
    71         // Flags - returned by SkipSpaces
       
    72         enum TAknSkipSpacesFlags
       
    73             {
       
    74             // There was a space character (not end of line)
       
    75             EAknWasSpace = 1,
       
    76             // There was other kind of character
       
    77             EAknWasCharacter = 2
       
    78             };
       
    79         // Skips spaces, but stops if end of line.
       
    80         static TInt SkipSpaces( TLex& aLex );
       
    81         // Goes over digit sequence and returns string.
       
    82         static TPtrC GetDigits( TLex& aLex );
       
    83         // Checks if compensation value is ok.
       
    84         inline static TBool CheckCompensationValue( TInt aValue );
       
    85 
       
    86     private:
       
    87         RProperty iProperty; 
       
    88         TBool iRotatedRawEvent;   
       
    89         RArray<CFbsBitGc::TGraphicsOrientation> iHwRotations;
       
    90         CFbsBitGc::TGraphicsOrientation iUsedRotationForDownEvent;
       
    91         
       
    92         // Key rotator compensation value.
       
    93         TInt iKeyRotatorCompensation;
       
    94         
       
    95     };
       
    96     
       
    97     
       
    98 #endif      // CAKNKEYROTATORIMPL_H   
       
    99             
       
   100 // End of File