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