19 #include <cvtengmodel.h> |
19 #include <cvtengmodel.h> |
20 #include <mvtengcamerapreferences.h> |
20 #include <mvtengcamerapreferences.h> |
21 #include <eikenv.h> |
21 #include <eikenv.h> |
22 #include <cvtlogger.h> |
22 #include <cvtlogger.h> |
23 #include <avkon.hrh> |
23 #include <avkon.hrh> |
|
24 #include <akntoolbar.h> |
24 |
25 |
25 #include "cvtuiprefsettinglistbase.h" |
26 #include "cvtuiprefsettinglistbase.h" |
26 #include "CVtUiAppUi.h" |
27 #include "CVtUiAppUi.h" |
27 #include "cvtuitransparentsettingpage.h" |
28 #include "cvtuitransparentsettingpage.h" |
28 #include "CVtUiMainControl.h" |
29 #include "CVtUiMainControl.h" |
35 #include <layoutmetadata.cdl.h> |
36 #include <layoutmetadata.cdl.h> |
36 |
37 |
37 // constants |
38 // constants |
38 static const TInt KMaxNumberOfArrayItems = 5; |
39 static const TInt KMaxNumberOfArrayItems = 5; |
39 static const TInt KMaxNumberOfActiveItems = 5; |
40 static const TInt KMaxNumberOfActiveItems = 5; |
40 static const TInt KOrdinalPositionBase = 3; |
41 static const TInt KOrdinalPositionBase = 4; |
41 |
42 |
42 // --------------------------------------------------------------------------- |
43 // --------------------------------------------------------------------------- |
43 // CVtUiPrefSettingListBase::~CVtUiPrefSettingListBase |
44 // CVtUiPrefSettingListBase::~CVtUiPrefSettingListBase |
44 // --------------------------------------------------------------------------- |
45 // --------------------------------------------------------------------------- |
45 // |
46 // |
156 { |
157 { |
157 __VTPRINTENTER( "CVtUiPrefSettingListBase.StartSettingPageL" ) |
158 __VTPRINTENTER( "CVtUiPrefSettingListBase.StartSettingPageL" ) |
158 // Swap image places if needed |
159 // Swap image places if needed |
159 iAppUi.SwitchViewFinderToMainPaneL(); |
160 iAppUi.SwitchViewFinderToMainPaneL(); |
160 |
161 |
161 // Get context control's window priority and position |
162 // Creates setting page first |
162 iContextControlWindowPriority = iAppUi.ContextControl().DrawableWindow() |
|
163 ->OrdinalPriority(); |
|
164 iContextControlWindowPosition = iAppUi.ContextControl().DrawableWindow() |
|
165 ->OrdinalPosition(); |
|
166 |
|
167 // Get main control's window priority |
|
168 iMainControlWindowPriority= iAppUi.MainControl().DrawableWindow() |
|
169 ->OrdinalPriority(); |
|
170 |
|
171 // Get remote video control's window priority and position |
|
172 iRemoteVideoControlWindowPriority = |
|
173 iAppUi.RemoteVideoControl().DrawableWindow()->OrdinalPriority(); |
|
174 iRemoteVideoControlWindowPosition = |
|
175 iAppUi.RemoteVideoControl().DrawableWindow()->OrdinalPosition(); |
|
176 |
|
177 // Get end call button pane priority and position |
|
178 iEndCallButtonPanePriority = |
|
179 iAppUi.EndCallButtonPane().DrawableWindow()->OrdinalPriority(); |
|
180 iEndCallButtonPanePosition = |
|
181 iAppUi.EndCallButtonPane().DrawableWindow()->OrdinalPosition(); |
|
182 |
|
183 // Rise context control's window priority othwerwise setting page will be |
|
184 // drawn partially over the context control window. |
|
185 iAppUi.ContextControl().DrawableWindow()->SetOrdinalPosition( |
|
186 iContextControlWindowPosition, |
|
187 iContextControlWindowPriority + 1 ); |
|
188 |
|
189 // Rise remote video control's window priority othwerwise setting page |
|
190 // will be drawn partially over the context control window. |
|
191 iAppUi.RemoteVideoControl().DrawableWindow()->SetOrdinalPosition( |
|
192 iRemoteVideoControlWindowPosition, |
|
193 iRemoteVideoControlWindowPriority + 2 ); |
|
194 |
|
195 // Rise end call button pane priority othwerwise setting page |
|
196 // will be drawn partially over the context control window. |
|
197 iAppUi.EndCallButtonPane().DrawableWindow()->SetOrdinalPosition( |
|
198 iEndCallButtonPanePosition, |
|
199 iEndCallButtonPanePriority + 1 ); |
|
200 |
|
201 // Creates setting page |
|
202 CreateSettingPageL(); |
163 CreateSettingPageL(); |
|
164 |
|
165 // Sort controls window position |
|
166 SortControlsWindowPoistion(); |
|
167 |
203 // Launch setting page. |
168 // Launch setting page. |
204 iSettingPage->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted, EFalse ); |
169 iSettingPage->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted, EFalse ); |
205 iSettingPage = NULL; |
170 iSettingPage = NULL; |
206 __VTPRINTEXIT( "CVtUiPrefSettingListBase.StartSettingPageL" ) |
171 __VTPRINTEXIT( "CVtUiPrefSettingListBase.StartSettingPageL" ) |
207 } |
172 } |
211 // |
176 // |
212 // |
177 // |
213 void CVtUiPrefSettingListBase::StopSettingPageL() |
178 void CVtUiPrefSettingListBase::StopSettingPageL() |
214 { |
179 { |
215 __VTPRINTENTER( "CVtUiPrefSettingListBase.StopSettingPageL" ) |
180 __VTPRINTENTER( "CVtUiPrefSettingListBase.StopSettingPageL" ) |
216 // Swap image places if needed |
|
217 iAppUi.RestoreViewFinderL(); |
|
218 |
181 |
219 if ( iSettingPage) |
182 if ( iSettingPage) |
220 { |
183 { |
221 // Cancell the setting page |
184 // Cancell the setting page |
222 TKeyEvent keyEvent; |
185 TKeyEvent keyEvent; |
223 keyEvent.iCode = EKeyEscape; |
186 keyEvent.iCode = EKeyEscape; |
224 iSettingPage->OfferKeyEventL( keyEvent, EEventKey ); |
187 iSettingPage->OfferKeyEventL( keyEvent, EEventKey ); |
225 } |
188 } |
226 |
189 |
227 TInt ordinalPos = KOrdinalPositionBase; |
190 // Sort controls window position |
228 |
191 SortControlsWindowPoistion(); |
229 // Set main control priority and position back to |
192 |
230 // orginal value. |
193 // Swap image places if needed |
231 iAppUi.MainControl().DrawableWindow()->SetOrdinalPosition( |
194 iAppUi.RestoreViewFinderL(); |
232 ordinalPos--, iMainControlWindowPriority ); |
|
233 |
|
234 // Set end call button pane priority and position back to |
|
235 // orginal value. |
|
236 iAppUi.EndCallButtonPane().DrawableWindow()->SetOrdinalPosition( |
|
237 ordinalPos--, iEndCallButtonPanePriority ); |
|
238 |
|
239 // Set context control's window priority and position back to |
|
240 // orginal value. |
|
241 iAppUi.ContextControl().DrawableWindow()->SetOrdinalPosition( |
|
242 ordinalPos--, iContextControlWindowPriority ); |
|
243 |
|
244 // Set remote video control's window priority and position back to |
|
245 // orginal value. |
|
246 iAppUi.RemoteVideoControl().DrawableWindow()->SetOrdinalPosition( |
|
247 ordinalPos--, |
|
248 iRemoteVideoControlWindowPriority ); |
|
249 |
195 |
250 __VTPRINTEXIT( "CVtUiPrefSettingListBase.StopSettingPageL" ) |
196 __VTPRINTEXIT( "CVtUiPrefSettingListBase.StopSettingPageL" ) |
251 } |
197 } |
252 |
198 |
253 // --------------------------------------------------------------------------- |
199 // --------------------------------------------------------------------------- |
409 } |
355 } |
410 |
356 |
411 iBitmapTopLeftCorner = iStreamLayout.Rect().iTl; |
357 iBitmapTopLeftCorner = iStreamLayout.Rect().iTl; |
412 __VTPRINTEXIT( "CVtUiPrefSettingListBase.ResizeBackroundBitmapRect" ) |
358 __VTPRINTEXIT( "CVtUiPrefSettingListBase.ResizeBackroundBitmapRect" ) |
413 } |
359 } |
|
360 |
|
361 // --------------------------------------------------------------------------- |
|
362 // CVtUiPrefSettingListBase::SortControlsWindowPoistion |
|
363 // --------------------------------------------------------------------------- |
|
364 // |
|
365 void CVtUiPrefSettingListBase::SortControlsWindowPoistion() |
|
366 { |
|
367 TInt ordinalPos = KOrdinalPositionBase; |
|
368 |
|
369 if ( iSettingPage ) |
|
370 { |
|
371 ordinalPos++; |
|
372 } |
|
373 |
|
374 // Re-sort control's window position |
|
375 iAppUi.MainControl().DrawableWindow()->SetOrdinalPosition( |
|
376 ordinalPos--, |
|
377 iAppUi.MainControl().DrawableWindow()->OrdinalPriority() ); |
|
378 |
|
379 if ( iSettingPage ) |
|
380 { |
|
381 iSettingPage->DrawableWindow()->SetOrdinalPosition( |
|
382 ordinalPos--, |
|
383 iSettingPage->DrawableWindow()->OrdinalPriority() ); |
|
384 } |
|
385 |
|
386 iAppUi.CurrentFixedToolbar()->DrawableWindow()->SetOrdinalPosition( |
|
387 ordinalPos--, |
|
388 iAppUi.CurrentFixedToolbar()->DrawableWindow()->OrdinalPriority() ); |
|
389 |
|
390 iAppUi.ContextControl().DrawableWindow()->SetOrdinalPosition( |
|
391 ordinalPos--, |
|
392 iAppUi.ContextControl().DrawableWindow()->OrdinalPriority() ); |
|
393 |
|
394 iAppUi.RemoteVideoControl().DrawableWindow()->SetOrdinalPosition( |
|
395 ordinalPos--, |
|
396 iAppUi.RemoteVideoControl().DrawableWindow()->OrdinalPriority() ); |
|
397 |
|
398 iAppUi.EndCallButtonPane().DrawableWindow()->SetOrdinalPosition( |
|
399 ordinalPos--, |
|
400 iAppUi.EndCallButtonPane().DrawableWindow()->OrdinalPriority() ); |
|
401 } |
|
402 |
|
403 // End of file |