|
1 /* |
|
2 * Copyright (c) 2007 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: Dialer container class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_VTUIDIALERCONTAINER_H |
|
20 #define C_VTUIDIALERCONTAINER_H |
|
21 |
|
22 #include <coecntrl.h> |
|
23 #include "CVtUiAppUi.h" |
|
24 #include "mvtuicomponent.h" |
|
25 #include "mvtuiresourcechangeobserver.h" |
|
26 #include "mvtuikeyeventobserver.h" |
|
27 #include "mvtuinumbersource.h" |
|
28 #include "tvtuicomponentstate.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class MVtUiVideoWindow; |
|
32 class MVtUiComponentManager; |
|
33 class CVtUiBitmapManager; |
|
34 class CVtUiDialerVideoControl; |
|
35 class CVideoDTMFDialer; |
|
36 class TVtUiStates; |
|
37 class CVtUiDialerSKModifier; |
|
38 class CVtUiFeatureManager; |
|
39 class CVtUiDTMFBuffer; |
|
40 class CAknsBasicBackgroundControlContext; |
|
41 |
|
42 // CONSTANTS |
|
43 const TInt KVtUiDigitBufferSize = 128; |
|
44 |
|
45 /** |
|
46 * TVtUiMiniDialerComponentState |
|
47 * |
|
48 * Mini dialer component state definition. |
|
49 * |
|
50 * @since S60 v5.0 |
|
51 */ |
|
52 class TVtUiDialerComponentState : public TVtUiComponentState |
|
53 { |
|
54 |
|
55 public: |
|
56 |
|
57 /** |
|
58 * Constructor |
|
59 */ |
|
60 TVtUiDialerComponentState( MVtUiComponent& aComponent ); |
|
61 |
|
62 }; |
|
63 |
|
64 /** |
|
65 * CVtUiDialerContainer |
|
66 * |
|
67 * Mini dialer UI feature definition. |
|
68 * |
|
69 * @since S60 v5.0 |
|
70 */ |
|
71 class CVtUiDialerContainer : public CCoeControl, |
|
72 public MVtUiResourceChangeObserver, public MVtUiComponent, |
|
73 public MVtUiNumberSource, public MVtUiKeyEventObserver |
|
74 { |
|
75 |
|
76 public: |
|
77 |
|
78 /** |
|
79 * Static constructor |
|
80 * @param aFeatureManager Reference to feature manager. |
|
81 * @param aComponentManager Reference to component manager. |
|
82 * @param aBitmapManager Reference to bitmap manager. |
|
83 * @return Newly created instance of CVtUiDialerContainer. |
|
84 */ |
|
85 static CVtUiDialerContainer* |
|
86 NewL( CVtUiFeatureManager& aFeatureManager ); |
|
87 |
|
88 /** |
|
89 * Destructor |
|
90 */ |
|
91 ~CVtUiDialerContainer(); |
|
92 |
|
93 /** |
|
94 * Registers component to component manager's event handling mechanism. |
|
95 * @exception May leave with error KErrAlreadyExists, if the component |
|
96 * has already been registered. |
|
97 */ |
|
98 void RegisterComponentL(); |
|
99 |
|
100 /** |
|
101 * Unregisters component from component manager's event handling mechanism. |
|
102 */ |
|
103 void UnregisterComponent(); |
|
104 |
|
105 /** |
|
106 * Returns video window. |
|
107 * @return Pointer to video window. |
|
108 */ |
|
109 MVtUiVideoWindow* ComponentAsVideoWindow(); |
|
110 |
|
111 /** |
|
112 * @see CCoeControl::MopSupplyObject |
|
113 */ |
|
114 TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
115 |
|
116 private: // from MVtUiResourceChangeObserver |
|
117 |
|
118 /** |
|
119 * @see MVtUiResourceChangeObserver::HandleResourceChangeL |
|
120 */ |
|
121 void HandleResourceChangeL( TInt aType ); |
|
122 |
|
123 |
|
124 private: // from MVtUiComponent |
|
125 |
|
126 /** |
|
127 * @see MVtUiComponent::ComponentId |
|
128 */ |
|
129 TComponentId ComponentId() const; |
|
130 |
|
131 /** |
|
132 * @see MVtUiComponent::ComponentAsControl |
|
133 */ |
|
134 CCoeControl* ComponentAsControl(); |
|
135 |
|
136 /** |
|
137 * @see MVtUiComponent::DoActivateL |
|
138 */ |
|
139 void DoActivateL(); |
|
140 |
|
141 /** |
|
142 * @see MVtUiComponent::DoDeactivateL |
|
143 */ |
|
144 void DoDeactivateL(); |
|
145 |
|
146 private: // from MVtUiNumberSource |
|
147 |
|
148 /** |
|
149 * @see MVtUiNumberSource::GetContents |
|
150 */ |
|
151 void GetContents( TDes& aContents ) const; |
|
152 |
|
153 private: // from MVtUiKeyEventObserver |
|
154 |
|
155 /** |
|
156 * @see MVtUiNumberSource::OfferKeyEventL |
|
157 */ |
|
158 TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, |
|
159 TEventCode aCode ); |
|
160 |
|
161 private: // from CCoeControl |
|
162 |
|
163 /** |
|
164 * @see CCoeControl::Draw |
|
165 */ |
|
166 void Draw( const TRect& aRect ) const; |
|
167 |
|
168 /** |
|
169 * @see CCoeControl::SizeChanged |
|
170 */ |
|
171 void SizeChanged(); |
|
172 |
|
173 /** |
|
174 * @see CCoeControl::PositionChanged |
|
175 */ |
|
176 void PositionChanged(); |
|
177 |
|
178 /** |
|
179 * @see CCoeControl::CountComponentControls |
|
180 */ |
|
181 TInt CountComponentControls() const; |
|
182 |
|
183 /** |
|
184 * @see CCoeControl::ComponentControl |
|
185 */ |
|
186 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
187 |
|
188 private: |
|
189 |
|
190 /** |
|
191 * Constructor |
|
192 */ |
|
193 CVtUiDialerContainer( CVtUiFeatureManager& aFeatureManager ); |
|
194 |
|
195 /** |
|
196 * 2nd constructor |
|
197 */ |
|
198 void ConstructL( CVtUiBitmapManager& aBitmapManager ); |
|
199 |
|
200 /** |
|
201 * Layouts this control. |
|
202 */ |
|
203 void LayoutDialerContainer(); |
|
204 |
|
205 /** |
|
206 * Returns dialer's rect (wrapper to VtUiLayout). |
|
207 */ |
|
208 TRect DialerRect() const; |
|
209 |
|
210 /** |
|
211 * Resets digit buffer. |
|
212 */ |
|
213 void Reset(); |
|
214 |
|
215 /** |
|
216 * Appends new digit to digit buffer. If buffer is full, oldest digit is |
|
217 * deleted. |
|
218 */ |
|
219 void AppendDigit( TChar aDigit ); |
|
220 |
|
221 /** |
|
222 * Static callback method for deactivating dialer asynchronously. |
|
223 */ |
|
224 static TInt ASyncDoDeactivate( TAny* aSelf ); |
|
225 |
|
226 private: |
|
227 |
|
228 // Component state |
|
229 TVtUiDialerComponentState iComponentState; |
|
230 |
|
231 // Feature manager instance |
|
232 CVtUiFeatureManager* iFeatureManager; |
|
233 |
|
234 // Component manager |
|
235 MVtUiComponentManager* iComponentManager; |
|
236 |
|
237 // UI states |
|
238 TVtUiStates& iUiStates; |
|
239 |
|
240 // Video control instance |
|
241 CVtUiDialerVideoControl* iVideoControl; |
|
242 |
|
243 // Dialer instance |
|
244 CVideoDTMFDialer* iDialer; |
|
245 |
|
246 // Buffer for digits |
|
247 CVtUiDTMFBuffer* iInputBuffer; |
|
248 |
|
249 // Rendering mode |
|
250 CVtUiAppUi::TRenderingMode iMode; |
|
251 |
|
252 // Softkey modifier for dialer feature |
|
253 CVtUiDialerSKModifier* iSKModifier; |
|
254 |
|
255 // Asynccallback instance for handling asynchronous deactivation. |
|
256 CAsyncCallBack* iAsyncDeactivate; |
|
257 |
|
258 // Owned: background context. |
|
259 CAknsBasicBackgroundControlContext* iBgContext; |
|
260 |
|
261 }; |
|
262 |
|
263 #endif // C_VTUIDIALERCONTAINER_H |