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: Qwerty Mode Monitor. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHONEQWERTYMODEMONITOR_H |
|
20 #define CPHONEQWERTYMODEMONITOR_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "mphonepubsubobserver.h" |
|
24 #include "mphoneqwertymodeobserver.h" |
|
25 |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * Qwerty Mode Monitor. |
|
31 */ |
|
32 class CPhoneQwertyModeMonitor |
|
33 : public CBase, |
|
34 private MPhonePubSubObserver |
|
35 { |
|
36 friend class T_CPhoneQwertyModeMonitorUT; |
|
37 |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * @return New instance |
|
43 */ |
|
44 static CPhoneQwertyModeMonitor* NewL(); |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CPhoneQwertyModeMonitor(); |
|
49 |
|
50 protected: // Functions from base classes |
|
51 |
|
52 /** |
|
53 * Handle the change of the setting from P&S key. |
|
54 * @param aUid identifing the P&S gategory. |
|
55 * @param aId P&S key. |
|
56 * @param aValue Current value of the key. |
|
57 */ |
|
58 virtual void HandlePropertyChangedL( |
|
59 const TUid& aCategory, |
|
60 const TUint aKey, |
|
61 const TInt aValue ); |
|
62 |
|
63 public: // New methods |
|
64 |
|
65 /** |
|
66 * Gets current qwerty mode. |
|
67 * @return Current qwerty mode. |
|
68 */ |
|
69 TInt QwertyMode() const; |
|
70 |
|
71 /** |
|
72 * Gets current keyboard. |
|
73 * @return Current keyboard. |
|
74 */ |
|
75 TInt Keyboard() const; |
|
76 |
|
77 /** |
|
78 * Adds qwerty mdoe observer. |
|
79 * @param aObserver Observer object. |
|
80 */ |
|
81 void AddObserverL( MPhoneQwertyModeObserver& aObserver ); |
|
82 |
|
83 /** |
|
84 * Removes qwerty mode observer. |
|
85 * @param aObserver Observer object. |
|
86 */ |
|
87 void RemoveObserver( MPhoneQwertyModeObserver& aObserver ); |
|
88 |
|
89 private: |
|
90 |
|
91 /** |
|
92 * C++ default constructor. |
|
93 */ |
|
94 CPhoneQwertyModeMonitor(); |
|
95 |
|
96 /** |
|
97 * By default Symbian OS constructor is private. |
|
98 */ |
|
99 void ConstructL(); |
|
100 |
|
101 /** |
|
102 * Current qwerty mode. |
|
103 */ |
|
104 TInt GetQwertyMode() const; |
|
105 |
|
106 /** |
|
107 * Current keyboard. |
|
108 */ |
|
109 TInt GetKeyboard() const; |
|
110 |
|
111 private: // Data |
|
112 |
|
113 // Call State Change Observer array. |
|
114 RPointerArray< MPhoneQwertyModeObserver > iObserverArray; |
|
115 |
|
116 // Current qwerty mode. |
|
117 TInt iQwertyMode; |
|
118 |
|
119 //Current keyboard. |
|
120 TInt iKeyboard; |
|
121 }; |
|
122 |
|
123 #endif // CPHONEQWERTYMODEMONITOR_H |
|
124 |
|
125 // End of File |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|