|
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32\include\e32ktran.h |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 */ |
|
22 |
|
23 #ifndef __E32KTRAN_H__ |
|
24 #define __E32KTRAN_H__ |
|
25 #include <e32std.h> |
|
26 #include <e32keys.h> |
|
27 #include <e32base.h> |
|
28 // |
|
29 class TMaskedModifiers |
|
30 { |
|
31 public: |
|
32 TUint iMask; |
|
33 TUint iValue; |
|
34 }; |
|
35 // |
|
36 enum TPattern |
|
37 { |
|
38 EAnyKey=0x00, |
|
39 EAnyAlphaNumeric, |
|
40 EAnyAlpha, |
|
41 EAnyAlphaLowerCase, |
|
42 EAnyAlphaUpperCase, |
|
43 EAnyDecimalDigit, |
|
44 EAnyDigitGivenRadix, |
|
45 EAnyModifierKey, |
|
46 EMatchKey=0x40, |
|
47 EMatchKeyCaseInsens, |
|
48 EMatchLeftOrRight |
|
49 }; |
|
50 // |
|
51 class TKeyCodePattern |
|
52 { |
|
53 public: |
|
54 TUint16 iKeyCode; |
|
55 TInt8 iPattern; |
|
56 TInt8 iFiller; |
|
57 }; |
|
58 // |
|
59 class TCaptureKey |
|
60 { |
|
61 public: |
|
62 TMaskedModifiers iModifiers; |
|
63 TKeyCodePattern iKeyCodePattern; |
|
64 TUint iApp; |
|
65 TUint iHandle; |
|
66 }; |
|
67 // |
|
68 class TKeyData |
|
69 { |
|
70 public: |
|
71 TInt iModifiers; |
|
72 TInt iApp; |
|
73 TInt iHandle; |
|
74 TBool iIsCaptureKey; |
|
75 TUint iKeyCode; |
|
76 }; |
|
77 // |
|
78 class CCaptureKeys: public CBase |
|
79 { |
|
80 public: |
|
81 IMPORT_C CCaptureKeys(); |
|
82 IMPORT_C ~CCaptureKeys(); |
|
83 IMPORT_C void Construct(); |
|
84 IMPORT_C void AddCaptureKeyL(const TCaptureKey &aCaptureKey); |
|
85 IMPORT_C void AddCaptureKeyL(const TCaptureKey &aCaptureKey, TUint8 aPriority); |
|
86 IMPORT_C void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey); |
|
87 IMPORT_C void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey, TUint8 aPriority); |
|
88 IMPORT_C void CancelCaptureKey(TUint32 aHandle); |
|
89 IMPORT_C void CancelAllCaptureKeys(TUint32 aApp); |
|
90 IMPORT_C void ProcessCaptureKeys(TKeyData &aKeyData) const; |
|
91 protected: |
|
92 void CheckCaptureKey(const TCaptureKey &aCaptureKey); |
|
93 void removeCaptureKey(TUint index); |
|
94 protected: |
|
95 RArray<TCaptureKey> iCKarray; |
|
96 }; |
|
97 // |
|
98 class CKeyTranslator: public CBase |
|
99 { |
|
100 public: |
|
101 IMPORT_C static CKeyTranslator *New(); |
|
102 virtual TInt GetModifierState()=0; |
|
103 virtual void SetModifierState(TEventModifier aModifier,TModifierState aState)=0; |
|
104 virtual TBool TranslateKey(TUint aScanCode,TBool aKeyUp,const CCaptureKeys &aCaptureKeys,TKeyData &aKeyData)=0; |
|
105 virtual void UpdateModifiers(TInt aModifiers)=0; |
|
106 virtual TInt ChangeKeyData(const TDesC& aLibraryName)=0; |
|
107 }; |
|
108 |
|
109 #endif |
|
110 |