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: Number entry control for Video Telephone application. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CVTUINUMBERENTRYCONTROL_H |
|
21 #define CVTUINUMBERENTRYCONTROL_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <coecntrl.h> |
|
25 #include <AknUtils.h> |
|
26 |
|
27 #include "mvtuicomponent.h" |
|
28 #include "tvtuicomponentstate.h" |
|
29 #include "mvtuinumbersource.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class MVtUiFeature; |
|
33 class MVtUiComponentManager; |
|
34 class TVtUiStates; |
|
35 class MVtUiNumberEntryControlObserver; |
|
36 class CVtUiDTMFBuffer; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * TVtUiNumberEntryComponentState |
|
42 * |
|
43 * Component state implementation for Number Entry control. Component state is |
|
44 * used by the Component Manager. |
|
45 * |
|
46 * @since S60 3.2 |
|
47 */ |
|
48 class TVtUiNumberEntryComponentState : public TVtUiComponentState |
|
49 { |
|
50 |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Constructor. |
|
55 */ |
|
56 TVtUiNumberEntryComponentState( MVtUiComponent& aComponent ); |
|
57 |
|
58 }; |
|
59 |
|
60 /** |
|
61 * Number entry control for Video Telephone application. |
|
62 * |
|
63 * @since Series 60 2.6 |
|
64 */ |
|
65 class CVtUiNumberEntryControl |
|
66 : public CCoeControl, public MVtUiComponent |
|
67 { |
|
68 public: // Constructors and destructor |
|
69 |
|
70 /** |
|
71 * C++ constructor. |
|
72 * @param aAppUi application ui. |
|
73 * @param aUiStates ui states |
|
74 */ |
|
75 CVtUiNumberEntryControl( MVtUiFeature& aFeature, |
|
76 TVtUiStates& aUiStates ); |
|
77 |
|
78 /** |
|
79 * Symbian constructor. |
|
80 * @param aRect initial area. |
|
81 */ |
|
82 void ConstructL( const TRect& aRect ); |
|
83 |
|
84 /** |
|
85 * C++ destructor. |
|
86 */ |
|
87 ~CVtUiNumberEntryControl(); |
|
88 |
|
89 public: // New functions |
|
90 |
|
91 /** |
|
92 * Opens number entry. |
|
93 * @return ETrue if number entry was opened, EFalse otherwise. |
|
94 */ |
|
95 TBool OpenNumberEntry(); |
|
96 |
|
97 /** |
|
98 * Returns ETrue if number entry is open. |
|
99 * @return ETrue if number entry is open. |
|
100 */ |
|
101 TBool IsNumberEntryOpen() const; |
|
102 |
|
103 /** |
|
104 * Closes number entry. |
|
105 */ |
|
106 void CloseNumberEntry(); |
|
107 |
|
108 /** |
|
109 * Register component to component manager. |
|
110 */ |
|
111 void RegisterComponentL( MVtUiComponentManager& aComponentManager ); |
|
112 |
|
113 /** |
|
114 * Unregister component to component manager. |
|
115 */ |
|
116 void UnregisterComponent( MVtUiComponentManager& aComponentManager ); |
|
117 |
|
118 /** |
|
119 * Adds number entry control observer. |
|
120 */ |
|
121 void SetNumberEntryControlObserver( |
|
122 MVtUiNumberEntryControlObserver* aObserver ); |
|
123 |
|
124 public: // Functions from base classes |
|
125 |
|
126 /** |
|
127 * @see CCoeControl::OfferKeyEventL. |
|
128 */ |
|
129 virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
130 TEventCode aType ); |
|
131 |
|
132 private: |
|
133 |
|
134 /** |
|
135 * Callback function to close number entry. |
|
136 * @param aAny pointer to an instance of this class. |
|
137 * @return KErrNone. |
|
138 */ |
|
139 static TInt DoCloseNumberEntry( TAny* aAny ); |
|
140 |
|
141 /** |
|
142 * Called from DoCloseNumberEntry when number entry needs to be closed. |
|
143 */ |
|
144 void HandleTimeoutCloseNumberEntry(); |
|
145 |
|
146 /** |
|
147 * Return ETrue if menu or dialog is being displayed. |
|
148 */ |
|
149 TBool IsDisplayingMenuOrDialog() const; |
|
150 |
|
151 private: // from MVtUiComponent |
|
152 |
|
153 /** |
|
154 * @see MVtUiComponent::ComponentId |
|
155 */ |
|
156 TComponentId ComponentId() const; |
|
157 |
|
158 /** |
|
159 * @see MVtUiComponent::ComponentAsControl |
|
160 */ |
|
161 CCoeControl* ComponentAsControl(); |
|
162 |
|
163 /** |
|
164 * @see MVtUiComponent::DoActivateL |
|
165 */ |
|
166 void DoActivateL(); |
|
167 |
|
168 /** |
|
169 * @see MVtUiComponent::DoDeactivateL |
|
170 */ |
|
171 void DoDeactivateL(); |
|
172 |
|
173 private: |
|
174 |
|
175 // Reference to feature that owns this control. |
|
176 MVtUiFeature& iFeature; |
|
177 |
|
178 // Number entry area layout. |
|
179 TAknLayoutRect iNumberEntryAreaLayout; |
|
180 |
|
181 // Component state |
|
182 TVtUiNumberEntryComponentState iComponentState; |
|
183 |
|
184 // UI States |
|
185 TVtUiStates& iUiStates; |
|
186 |
|
187 // Number entry control observer |
|
188 MVtUiNumberEntryControlObserver* iControlObserver; |
|
189 |
|
190 // Buffer for digits |
|
191 CVtUiDTMFBuffer* iInputBuffer; |
|
192 }; |
|
193 |
|
194 #endif // CVTUINUMBERENTRYCONTROL_H |
|
195 |
|
196 // End of File |
|