sl@0: // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\include\e32ktran.h sl@0: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without notice. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef __E32KTRAN_H__ sl@0: #define __E32KTRAN_H__ sl@0: #include sl@0: #include sl@0: #include sl@0: // sl@0: class TMaskedModifiers sl@0: { sl@0: public: sl@0: TUint iMask; sl@0: TUint iValue; sl@0: }; sl@0: // sl@0: enum TPattern sl@0: { sl@0: EAnyKey=0x00, sl@0: EAnyAlphaNumeric, sl@0: EAnyAlpha, sl@0: EAnyAlphaLowerCase, sl@0: EAnyAlphaUpperCase, sl@0: EAnyDecimalDigit, sl@0: EAnyDigitGivenRadix, sl@0: EAnyModifierKey, sl@0: EMatchKey=0x40, sl@0: EMatchKeyCaseInsens, sl@0: EMatchLeftOrRight sl@0: }; sl@0: // sl@0: class TKeyCodePattern sl@0: { sl@0: public: sl@0: TUint16 iKeyCode; sl@0: TInt8 iPattern; sl@0: TInt8 iFiller; sl@0: }; sl@0: // sl@0: class TCaptureKey sl@0: { sl@0: public: sl@0: TMaskedModifiers iModifiers; sl@0: TKeyCodePattern iKeyCodePattern; sl@0: TUint iApp; sl@0: TUint iHandle; sl@0: }; sl@0: // sl@0: class TKeyData sl@0: { sl@0: public: sl@0: TInt iModifiers; sl@0: TInt iApp; sl@0: TInt iHandle; sl@0: TBool iIsCaptureKey; sl@0: TUint iKeyCode; sl@0: }; sl@0: // sl@0: class CCaptureKeys: public CBase sl@0: { sl@0: public: sl@0: IMPORT_C CCaptureKeys(); sl@0: IMPORT_C ~CCaptureKeys(); sl@0: IMPORT_C void Construct(); sl@0: IMPORT_C void AddCaptureKeyL(const TCaptureKey &aCaptureKey); sl@0: IMPORT_C void AddCaptureKeyL(const TCaptureKey &aCaptureKey, TUint8 aPriority); sl@0: IMPORT_C void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey); sl@0: IMPORT_C void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey, TUint8 aPriority); sl@0: IMPORT_C void CancelCaptureKey(TUint32 aHandle); sl@0: IMPORT_C void CancelAllCaptureKeys(TUint32 aApp); sl@0: IMPORT_C void ProcessCaptureKeys(TKeyData &aKeyData) const; sl@0: protected: sl@0: void CheckCaptureKey(const TCaptureKey &aCaptureKey); sl@0: void removeCaptureKey(TUint index); sl@0: protected: sl@0: RArray iCKarray; sl@0: }; sl@0: // sl@0: class CKeyTranslator: public CBase sl@0: { sl@0: public: sl@0: IMPORT_C static CKeyTranslator *New(); sl@0: virtual TInt GetModifierState()=0; sl@0: virtual void SetModifierState(TEventModifier aModifier,TModifierState aState)=0; sl@0: virtual TBool TranslateKey(TUint aScanCode,TBool aKeyUp,const CCaptureKeys &aCaptureKeys,TKeyData &aKeyData)=0; sl@0: virtual void UpdateModifiers(TInt aModifiers)=0; sl@0: virtual TInt ChangeKeyData(const TDesC& aLibraryName)=0; sl@0: }; sl@0: sl@0: #endif sl@0: