1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/e32ktran.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,111 @@
1.4 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// 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
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32\include\e32ktran.h
1.18 +//
1.19 +//
1.20 +
1.21 +
1.22 +
1.23 +/**
1.24 + @file
1.25 + @internalTechnology
1.26 +*/
1.27 +
1.28 +#ifndef __E32KTRAN_H__
1.29 +#define __E32KTRAN_H__
1.30 +#include <e32std.h>
1.31 +#include <e32keys.h>
1.32 +#include <e32base.h>
1.33 +//
1.34 +class TMaskedModifiers
1.35 + {
1.36 +public:
1.37 + TUint iMask;
1.38 + TUint iValue;
1.39 + };
1.40 +//
1.41 +enum TPattern
1.42 + {
1.43 + EAnyKey=0x00,
1.44 + EAnyAlphaNumeric,
1.45 + EAnyAlpha,
1.46 + EAnyAlphaLowerCase,
1.47 + EAnyAlphaUpperCase,
1.48 + EAnyDecimalDigit,
1.49 + EAnyDigitGivenRadix,
1.50 + EAnyModifierKey,
1.51 + EMatchKey=0x40,
1.52 + EMatchKeyCaseInsens,
1.53 + EMatchLeftOrRight
1.54 + };
1.55 +//
1.56 +class TKeyCodePattern
1.57 + {
1.58 +public:
1.59 + TUint16 iKeyCode;
1.60 + TInt8 iPattern;
1.61 + TInt8 iFiller;
1.62 + };
1.63 +//
1.64 +class TCaptureKey
1.65 + {
1.66 +public:
1.67 + TMaskedModifiers iModifiers;
1.68 + TKeyCodePattern iKeyCodePattern;
1.69 + TUint iApp;
1.70 + TUint iHandle;
1.71 + };
1.72 +//
1.73 +class TKeyData
1.74 + {
1.75 +public:
1.76 + TInt iModifiers;
1.77 + TInt iApp;
1.78 + TInt iHandle;
1.79 + TBool iIsCaptureKey;
1.80 + TUint iKeyCode;
1.81 + };
1.82 +//
1.83 +class CCaptureKeys: public CBase
1.84 + {
1.85 +public:
1.86 + IMPORT_C CCaptureKeys();
1.87 + IMPORT_C ~CCaptureKeys();
1.88 + IMPORT_C void Construct();
1.89 + IMPORT_C void AddCaptureKeyL(const TCaptureKey &aCaptureKey);
1.90 + IMPORT_C void AddCaptureKeyL(const TCaptureKey &aCaptureKey, TUint8 aPriority);
1.91 + IMPORT_C void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey);
1.92 + IMPORT_C void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey, TUint8 aPriority);
1.93 + IMPORT_C void CancelCaptureKey(TUint32 aHandle);
1.94 + IMPORT_C void CancelAllCaptureKeys(TUint32 aApp);
1.95 + IMPORT_C void ProcessCaptureKeys(TKeyData &aKeyData) const;
1.96 +protected:
1.97 + void CheckCaptureKey(const TCaptureKey &aCaptureKey);
1.98 + void removeCaptureKey(TUint index);
1.99 +protected:
1.100 + RArray<TCaptureKey> iCKarray;
1.101 + };
1.102 +//
1.103 +class CKeyTranslator: public CBase
1.104 + {
1.105 +public:
1.106 + IMPORT_C static CKeyTranslator *New();
1.107 + virtual TInt GetModifierState()=0;
1.108 + virtual void SetModifierState(TEventModifier aModifier,TModifierState aState)=0;
1.109 + virtual TBool TranslateKey(TUint aScanCode,TBool aKeyUp,const CCaptureKeys &aCaptureKeys,TKeyData &aKeyData)=0;
1.110 + virtual void UpdateModifiers(TInt aModifiers)=0;
1.111 + virtual TInt ChangeKeyData(const TDesC& aLibraryName)=0;
1.112 + };
1.113 +
1.114 +#endif