1 /* |
|
2 * Copyright (c) 2006 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: Input method related functionality. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CPHONEQWERTYHANDLER_H |
|
21 #define CPHONEQWERTYHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "mphoneqwertymodeobserver.h" |
|
26 #include "mphonelangsettingobserver.h" |
|
27 #include <PtiDefs.h> |
|
28 #include <w32std.h> |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CPhoneLangSettingMonitor; |
|
34 class CPhoneQwertyModeMonitor; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Input method related functionality. |
|
40 * |
|
41 */ |
|
42 class CPhoneQwertyHandler : public CBase, |
|
43 private MPhoneLangSettingObserver, |
|
44 private MPhoneQwertyModeObserver |
|
45 { |
|
46 friend class T_CPhoneQwertyHandlerUT; |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 IMPORT_C static CPhoneQwertyHandler* NewL(); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 IMPORT_C virtual ~CPhoneQwertyHandler(); |
|
59 |
|
60 /** |
|
61 * Checks if qwerty input is used. |
|
62 * @return ETrue if in qwerty mode. |
|
63 */ |
|
64 IMPORT_C TBool IsQwertyInput() const; |
|
65 |
|
66 /** |
|
67 * Gets keycode according to current keyboard mapping. |
|
68 */ |
|
69 IMPORT_C TInt NumericKeyCode( const TKeyEvent& aKeyEvent ); |
|
70 |
|
71 private: |
|
72 |
|
73 /** |
|
74 * @see MIdleLangSettingObserver. |
|
75 */ |
|
76 void HandleInputLanguageSettingChange( TInt aLanguage ); |
|
77 |
|
78 /** |
|
79 * @see MIdleQwertyModeObserver. |
|
80 */ |
|
81 void HandleQwertyModeChange( TInt aMode ); |
|
82 |
|
83 /** |
|
84 * @see MIdleQwertyModeObserver. |
|
85 */ |
|
86 void HandleKeyboardLayoutChange(); |
|
87 |
|
88 /** |
|
89 * C++ default constructor. |
|
90 */ |
|
91 CPhoneQwertyHandler(); |
|
92 |
|
93 /** |
|
94 * By default Symbian 2nd phase constructor is private. |
|
95 */ |
|
96 void ConstructL(); |
|
97 |
|
98 /** |
|
99 * LoadNumericKeyBindings |
|
100 */ |
|
101 void LoadNumericKeyBindings( TInt aLanguage, TInt aKeyboard ); |
|
102 |
|
103 |
|
104 private: // Data |
|
105 |
|
106 // Input language |
|
107 TInt iInputLanguageId; |
|
108 |
|
109 // Qwerty mode |
|
110 TInt iQwertyMode; |
|
111 |
|
112 // Language setting monitor |
|
113 CPhoneLangSettingMonitor* iLangSettingMonitor; |
|
114 |
|
115 // Qwerty mode monitor |
|
116 CPhoneQwertyModeMonitor* iQwertyModeMonitor; |
|
117 |
|
118 // RArray |
|
119 RArray<TPtiNumericKeyBinding> iNumericKeys; |
|
120 }; |
|
121 |
|
122 #endif // CPHONEQWERTYHANDLER_H |
|
123 |
|
124 // End of File |
|