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: Implementation for presentation element- progressbar. |
|
15 * |
|
16 */ |
|
17 |
|
18 //Toolkit Includes |
|
19 #include <alf/alfimagevisual.h> |
|
20 #include <alf/alfevent.h> |
|
21 |
|
22 // Alfred Client includes |
|
23 #include <alf/alfenv.h> |
|
24 #include <alf/alftexture.h> |
|
25 #include <alf/alftextvisual.h> |
|
26 #include <alf/alflayout.h> |
|
27 #include <aknconsts.h> |
|
28 #include <avkon.mbg> |
|
29 |
|
30 //Widget Model Includes |
|
31 #include <alf/alfwidgetenvextension.h> |
|
32 |
|
33 //Avkon Includes |
|
34 #include <AknUtils.h> |
|
35 #include <AknsConstants.h> |
|
36 #include <utf.h> |
|
37 |
|
38 //OpenC Includes |
|
39 |
|
40 #include <math.h> |
|
41 |
|
42 //slider widget includes |
|
43 #include "mulprogressbarslider.h" |
|
44 #include "mulutility.h" |
|
45 #include "mulsliderutils.h" |
|
46 #include "mulsliderwidget.h" |
|
47 #include "mulslidermodel.h" |
|
48 #include "mulsliderdefinitions.h" |
|
49 |
|
50 // Textureid's used for comparison |
|
51 const TInt KAlfProgressBarTextureId = 1; |
|
52 const TInt KAlfFrameLeftTextureId = 2; |
|
53 const TInt KAlfFrameCentreTextureId = 3; |
|
54 const TInt KAlfFrameRightTextureId = 4; |
|
55 namespace Alf |
|
56 { |
|
57 // Structure to store data for the progressbar element class |
|
58 struct MulSliderProgressBarImpl |
|
59 { |
|
60 int mMaxRange; //Store Max range for progressbar from model |
|
61 int mMinRange; //Store Min range for progressbar from model |
|
62 int mTempMin; //Temporary stores the min range |
|
63 int mTempMax; //Temporary stores the max range |
|
64 int mTick; // Store Tick value for progressbar from model |
|
65 int mImageTextureId; // to differtiate between textures |
|
66 bool mOrientationLandScape; // check for landscape |
|
67 sliderTemplate mTemplateId; //slider template id |
|
68 CAlfLayout* mMainLayout; //slider main layout |
|
69 int mProgressBarTextureId;// to store the auto generated texture id's |
|
70 int mFrameLeftTextureId ; |
|
71 int mFrameCentreTextureId; |
|
72 int mFrameRightTextureId ; |
|
73 CAlfLayout* mBaseSliderLayout; |
|
74 CAlfImageVisual* mSliderProgressCentre; |
|
75 CAlfImageVisual* mSliderSecProgressCentre; |
|
76 CAlfImageVisual* mFrameLeftImage; |
|
77 CAlfImageVisual* mFrameRightImage; |
|
78 CAlfImageVisual* mFrameCentreImage; |
|
79 CAlfTexture* mTexture; |
|
80 MulSliderProgressBarImpl() |
|
81 { |
|
82 mTick = 0; |
|
83 mMaxRange = 0; |
|
84 mMinRange = 0; |
|
85 mTempMax = 0; |
|
86 mTempMin = 0; |
|
87 mImageTextureId = 0; |
|
88 mTemplateId = ESliderTemplateNone; |
|
89 mProgressBarTextureId = 0; |
|
90 mFrameLeftTextureId = 0; |
|
91 mFrameCentreTextureId = 0; |
|
92 mFrameRightTextureId = 0; |
|
93 mBaseSliderLayout = NULL; |
|
94 mSliderProgressCentre = NULL; |
|
95 mSliderSecProgressCentre = NULL; |
|
96 mOrientationLandScape = false; |
|
97 } |
|
98 }; |
|
99 // --------------------------------------------------------------------------- |
|
100 // MulSliderProgressive default constructor. |
|
101 // --------------------------------------------------------------------------- |
|
102 // |
|
103 MulSliderProgressive::MulSliderProgressive( |
|
104 CAlfWidgetControl& aControl, |
|
105 const char* aName , |
|
106 AlfCustomInitDataBase* /*aCustomData*/) |
|
107 : mData(NULL) |
|
108 { |
|
109 // Base class (AlfElement) construct |
|
110 construct(aControl, aName); |
|
111 mData = new (EMM) MulSliderProgressBarImpl; |
|
112 iBitmap = new (EMM) CFbsBitmap; |
|
113 // initializes the mSlliderModel and mSliderWidget |
|
114 initializeSliderData(); |
|
115 |
|
116 } |
|
117 // --------------------------------------------------------------------------- |
|
118 // Destructor |
|
119 // --------------------------------------------------------------------------- |
|
120 // |
|
121 MulSliderProgressive::~MulSliderProgressive() |
|
122 { |
|
123 // Visualization Data |
|
124 if(mData) |
|
125 { |
|
126 (&control().Env())->TextureManager().UnloadTexture(mData->mProgressBarTextureId); |
|
127 (&control().Env())->TextureManager().UnloadTexture(mData->mFrameLeftTextureId); |
|
128 (&control().Env())->TextureManager().UnloadTexture(mData->mFrameRightTextureId); |
|
129 (&control().Env())->TextureManager().UnloadTexture(mData->mFrameCentreTextureId); |
|
130 |
|
131 delete mData; |
|
132 delete iBitmap; |
|
133 } |
|
134 else |
|
135 { |
|
136 |
|
137 } |
|
138 |
|
139 }//End of Destructor |
|
140 |
|
141 // --------------------------------------------------------------------------- |
|
142 // From class MAlfInterfaceBase. |
|
143 // Getter for interfaces provided by the slider widget. |
|
144 // --------------------------------------------------------------------------- |
|
145 // |
|
146 IAlfInterfaceBase* MulSliderProgressive::makeInterface( |
|
147 const IfId& aType) |
|
148 { |
|
149 UString param (aType.mImplementationId); |
|
150 if (param == IAlfWidgetEventHandler::type().mImplementationId) |
|
151 { |
|
152 return static_cast<IAlfWidgetEventHandler*>(this); |
|
153 } |
|
154 |
|
155 else if (param == |
|
156 IMulSliderBaseElementInternal::type().mImplementationId) |
|
157 { |
|
158 return static_cast<IMulSliderBaseElementInternal*>(this); |
|
159 } |
|
160 |
|
161 IAlfInterfaceBase* interface = 0; |
|
162 interface = AlfElement::makeInterface(aType); |
|
163 return interface; |
|
164 } |
|
165 |
|
166 // --------------------------------------------------------------------------- |
|
167 // Gets called when the parent layout is relayouted. |
|
168 // resets all the anchor points and updates the visualization |
|
169 // --------------------------------------------------------------------------- |
|
170 // |
|
171 void MulSliderProgressive::baseLayoutSizeChanged() |
|
172 { |
|
173 mData->mMainLayout->ClearFlag(EAlfVisualFlagLayoutUpdateNotification); |
|
174 control().Env().RefreshCallBack(&(control().Env())); |
|
175 // Layout the visualization w.r.t. mainlayout |
|
176 layoutVisuals(mSliderModel->GetTemplate()); |
|
177 if(mSliderModel->IsLandscape()) |
|
178 { |
|
179 if(mSliderWidget->GetOpacity()) |
|
180 { |
|
181 TAlfTimedValue opacity(1,0); |
|
182 mData->mMainLayout->SetOpacity(opacity); |
|
183 } |
|
184 } |
|
185 else |
|
186 { |
|
187 TAlfTimedValue opacity(0,0); |
|
188 mData->mMainLayout->SetOpacity(opacity); |
|
189 } |
|
190 mData->mMainLayout->SetFlag(EAlfVisualFlagLayoutUpdateNotification); |
|
191 updateVisualization(); |
|
192 } |
|
193 // --------------------------------------------------------------------------- |
|
194 // From class IAlfWidgetEventHandler. |
|
195 // setActiveStates |
|
196 // --------------------------------------------------------------------------- |
|
197 void MulSliderProgressive::setActiveStates( |
|
198 unsigned int /*aStates*/) |
|
199 { |
|
200 //do nothing |
|
201 } |
|
202 |
|
203 // --------------------------------------------------------------------------- |
|
204 // initializes Model and Widget Pointer |
|
205 // --------------------------------------------------------------------------- |
|
206 // |
|
207 void MulSliderProgressive::initializeSliderData() |
|
208 { |
|
209 // initialize the Slider Widget Pointer; |
|
210 IAlfWidgetFactory& widgetFactory = |
|
211 AlfWidgetEnvExtension::widgetFactory(control().Env()); |
|
212 mSliderWidget = static_cast<MulSliderWidget*>(widgetFactory.findWidget( |
|
213 control().widget()->widgetName())); |
|
214 |
|
215 // initialize the Slider Model Pointer; |
|
216 mSliderModel = static_cast<MulSliderModel*>(mSliderWidget->model()); |
|
217 } |
|
218 |
|
219 // --------------------------------------------------------------------------- |
|
220 // Bitmap provider |
|
221 // --------------------------------------------------------------------------- |
|
222 // |
|
223 void MulSliderProgressive::ProvideBitmapL (TInt aId, |
|
224 CFbsBitmap *& aBitmap, |
|
225 CFbsBitmap *& aMaskBitmap) |
|
226 { |
|
227 TAknLayoutRect layoutRect; |
|
228 |
|
229 switch(mData->mImageTextureId) |
|
230 { |
|
231 case KAlfProgressBarTextureId: |
|
232 { |
|
233 AknIconUtils::CreateIconL( |
|
234 aBitmap, aMaskBitmap, KAvkonBitmapFile, |
|
235 EMbmAvkonQgn_graf_bar_progress, |
|
236 EMbmAvkonQgn_graf_bar_progress_mask ); |
|
237 |
|
238 TInt aHandle = aBitmap->Handle(); |
|
239 |
|
240 iBitmap->Duplicate(aHandle); |
|
241 |
|
242 AknIconUtils::SetSize( aBitmap,TSize(50,14),EAspectRatioNotPreserved); |
|
243 mData->mImageTextureId = 0; |
|
244 mData->mProgressBarTextureId = aId; |
|
245 } |
|
246 break; |
|
247 case KAlfFrameLeftTextureId: |
|
248 { |
|
249 AknIconUtils::CreateIconL( |
|
250 aBitmap, aMaskBitmap, KAvkonBitmapFile, |
|
251 EMbmAvkonQgn_graf_bar_frame_side_l, |
|
252 EMbmAvkonQgn_graf_bar_frame_side_l_mask ); |
|
253 |
|
254 layoutRect = MulSliderUtils::GetComponentRect( |
|
255 EPSliderLeft, |
|
256 mData->mMainLayout, |
|
257 KVariety0); |
|
258 |
|
259 AknIconUtils::SetSize( aBitmap,TSize(layoutRect.Rect().Size().iWidth, |
|
260 layoutRect.Rect().Size().iWidth), |
|
261 EAspectRatioNotPreserved); |
|
262 |
|
263 // AknIconUtils::SetSize( aBitmap,TSize(7,17),EAspectRatioNotPreserved); |
|
264 |
|
265 mData->mImageTextureId = 0; |
|
266 mData->mFrameLeftTextureId = aId; |
|
267 } |
|
268 break; |
|
269 case KAlfFrameRightTextureId: |
|
270 { |
|
271 AknIconUtils::CreateIconL( |
|
272 aBitmap, aMaskBitmap, KAvkonBitmapFile, |
|
273 EMbmAvkonQgn_graf_bar_frame_side_r, |
|
274 EMbmAvkonQgn_graf_bar_frame_side_r_mask ); |
|
275 |
|
276 layoutRect = MulSliderUtils::GetComponentRect( |
|
277 EPSliderRight, |
|
278 mData->mMainLayout, |
|
279 KVariety0); |
|
280 |
|
281 AknIconUtils::SetSize( aBitmap,TSize(layoutRect.Rect().Size().iWidth, |
|
282 layoutRect.Rect().Size().iWidth), |
|
283 EAspectRatioNotPreserved); |
|
284 |
|
285 // AknIconUtils::SetSize( aBitmap,TSize(7,17),EAspectRatioNotPreserved); |
|
286 mData->mImageTextureId = 0; |
|
287 mData->mFrameRightTextureId = aId; |
|
288 } |
|
289 break; |
|
290 case KAlfFrameCentreTextureId: |
|
291 { |
|
292 AknIconUtils::CreateIconL( |
|
293 aBitmap, aMaskBitmap, KAvkonBitmapFile, |
|
294 EMbmAvkonQgn_graf_bar_frame_center, |
|
295 EMbmAvkonQgn_graf_bar_frame_center_mask ); |
|
296 |
|
297 layoutRect = MulSliderUtils::GetComponentRect( |
|
298 EPSliderCentre, |
|
299 mData->mMainLayout, |
|
300 KVariety0); |
|
301 |
|
302 AknIconUtils::SetSize( aBitmap,TSize(layoutRect.Rect().Size().iWidth, |
|
303 layoutRect.Rect().Size().iWidth), |
|
304 EAspectRatioNotPreserved); |
|
305 |
|
306 // AknIconUtils::SetSize( aBitmap,TSize(308,17),EAspectRatioNotPreserved); |
|
307 mData->mImageTextureId = 0; |
|
308 mData->mFrameCentreTextureId = aId; |
|
309 } |
|
310 default: |
|
311 break; |
|
312 |
|
313 } |
|
314 |
|
315 } |
|
316 //---------------------------------------------------------------------------- |
|
317 // layoutVisuals |
|
318 //---------------------------------------------------------------------------- |
|
319 void MulSliderProgressive::layoutVisuals(sliderTemplate aTemplateid) |
|
320 { |
|
321 |
|
322 TAknLayoutRect layoutRect; |
|
323 mData->mTemplateId = aTemplateid; |
|
324 //Get the mainlayout rect |
|
325 int mainX = mData->mMainLayout->Pos().iX.ValueNow(); |
|
326 int mainY = mData->mMainLayout->Pos().iY.ValueNow(); |
|
327 int mainWidth = mData->mMainLayout->Size().iX.ValueNow(); |
|
328 int mainHeight = mData->mMainLayout->Size().iY.ValueNow(); |
|
329 if (mData->mTemplateId == ESliderTemplate7 ) |
|
330 { |
|
331 |
|
332 |
|
333 mData->mBaseSliderLayout->SetRect( |
|
334 TRect( TPoint(0,0 ), |
|
335 TSize( mainWidth, mainHeight ))) ; |
|
336 |
|
337 layoutRect = MulSliderUtils::GetComponentRect( |
|
338 EPSliderLeft, |
|
339 mData->mMainLayout, |
|
340 KVariety0); |
|
341 |
|
342 mData->mSliderProgressCentre->SetRect( |
|
343 TRect( TPoint(0,0), |
|
344 TSize( 0, layoutRect.Rect().Size().iHeight ))) ; |
|
345 |
|
346 mData->mFrameLeftImage->SetRect( |
|
347 TRect( TPoint(layoutRect.Rect().iTl.iX, |
|
348 layoutRect.Rect().iTl.iY ), |
|
349 TSize( layoutRect.Rect().Size().iWidth, |
|
350 layoutRect.Rect().Size().iHeight ))) ; |
|
351 |
|
352 |
|
353 layoutRect = MulSliderUtils::GetComponentRect( |
|
354 EPSliderCentre, |
|
355 mData->mMainLayout, |
|
356 KVariety0); |
|
357 |
|
358 mData->mFrameCentreImage->SetRect( |
|
359 TRect( TPoint(layoutRect.Rect().iTl.iX,layoutRect.Rect().iTl.iY ), |
|
360 TSize( layoutRect.Rect().Size().iWidth, |
|
361 layoutRect.Rect().Size().iHeight ))) ; |
|
362 |
|
363 |
|
364 layoutRect = MulSliderUtils::GetComponentRect( |
|
365 EPSliderRight, |
|
366 mData->mMainLayout, |
|
367 KVariety0); |
|
368 mData->mFrameRightImage->SetRect( |
|
369 TRect( TPoint(layoutRect.Rect().iTl.iX,layoutRect.Rect().iTl.iY ), |
|
370 TSize( layoutRect.Rect().Size().iWidth, |
|
371 layoutRect.Rect().Size().iHeight ))) ; |
|
372 } |
|
373 |
|
374 |
|
375 } |
|
376 |
|
377 //---------------------------------------------------------------------------- |
|
378 // createVisualization |
|
379 //---------------------------------------------------------------------------- |
|
380 void MulSliderProgressive::createVisualization(sliderTemplate templateid) |
|
381 { |
|
382 mData->mTemplateId = templateid; |
|
383 CAlfControl *ctrl = &control(); |
|
384 |
|
385 // Visual Hierarchy creation |
|
386 mData->mMainLayout = CAlfLayout::AddNewL(*ctrl,NULL); |
|
387 mData->mMainLayout->SetFlag(EAlfVisualFlagLayoutUpdateNotification); |
|
388 mData->mMainLayout->SetFlag(EAlfVisualFlagAutomaticLocaleMirroringEnabled); |
|
389 mData->mBaseSliderLayout = CAlfLayout::AddNewL(*ctrl, mData->mMainLayout); |
|
390 mData->mBaseSliderLayout->SetFlag(EAlfVisualFlagAutomaticLocaleMirroringEnabled); |
|
391 mData->mSliderProgressCentre = CAlfImageVisual::AddNewL( |
|
392 *ctrl,mData->mBaseSliderLayout); |
|
393 mData->mFrameLeftImage = CAlfImageVisual::AddNewL(*ctrl,mData->mBaseSliderLayout); |
|
394 mData->mFrameCentreImage = CAlfImageVisual::AddNewL(*ctrl,mData->mBaseSliderLayout); |
|
395 mData->mFrameRightImage = CAlfImageVisual::AddNewL(*ctrl,mData->mBaseSliderLayout); |
|
396 |
|
397 if(mData->mFrameLeftImage) |
|
398 { |
|
399 mData->mImageTextureId = KAlfFrameLeftTextureId; |
|
400 // Create the texture from bitmap provider |
|
401 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
|
402 KAlfAutoGeneratedTextureId/*KAlfFrameLeftTextureId*/, |
|
403 (MAlfBitmapProvider *)this, |
|
404 (TAlfTextureFlags)(EAlfTextureFlagAutoSize| |
|
405 EAlfTextureFlagSkinContent))); |
|
406 |
|
407 int height = mData->mTexture->Size().iHeight; |
|
408 int width = mData->mTexture->Size().iWidth; |
|
409 |
|
410 TAlfImage aImageLeft(*mData->mTexture ); |
|
411 mData->mFrameLeftImage->SetImage(aImageLeft); |
|
412 //mData->mFrameLeftImage->SetOpacity(0.5); |
|
413 } |
|
414 if(mData->mFrameCentreImage) |
|
415 { |
|
416 mData->mImageTextureId = KAlfFrameCentreTextureId; |
|
417 // Create the texture from bitmap provider |
|
418 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
|
419 KAlfAutoGeneratedTextureId/*KAlfFrameCentreTextureId*/, |
|
420 (MAlfBitmapProvider *)this, |
|
421 (TAlfTextureFlags)(EAlfTextureFlagAutoSize|EAlfTextureFlagSkinContent))); |
|
422 |
|
423 int height = mData->mTexture->Size().iHeight; |
|
424 int width = mData->mTexture->Size().iWidth; |
|
425 TAlfImage aImageCentre(*mData->mTexture ); |
|
426 mData->mFrameCentreImage->SetImage(aImageCentre); |
|
427 } |
|
428 |
|
429 if(mData->mFrameRightImage) |
|
430 { |
|
431 mData->mImageTextureId = KAlfFrameRightTextureId; |
|
432 // Create the texture from bitmap provider |
|
433 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
|
434 KAlfAutoGeneratedTextureId/*KAlfFrameRightTextureId*/, |
|
435 (MAlfBitmapProvider *)this, |
|
436 (TAlfTextureFlags)(EAlfTextureFlagAutoSize|EAlfTextureFlagSkinContent))); |
|
437 |
|
438 int height = mData->mTexture->Size().iHeight; |
|
439 int width = mData->mTexture->Size().iWidth; |
|
440 |
|
441 |
|
442 TAlfImage aImageRight(*mData->mTexture ); |
|
443 |
|
444 mData->mFrameRightImage->SetImage(aImageRight); |
|
445 } |
|
446 |
|
447 if(mData->mSliderProgressCentre) |
|
448 { |
|
449 mData->mImageTextureId = KAlfProgressBarTextureId; |
|
450 // Create the texture from bitmap provider |
|
451 mData->mTexture = &((ctrl->Env()).TextureManager().CreateTextureL( |
|
452 KAlfAutoGeneratedTextureId/*KAlfProgressBarTextureId*/, |
|
453 (MAlfBitmapProvider *)this, |
|
454 (TAlfTextureFlags)(EAlfTextureFlagAutoSize|EAlfTextureFlagSkinContent))); |
|
455 int height = mData->mTexture->Size().iHeight; |
|
456 int width = mData->mTexture->Size().iWidth; |
|
457 TAlfImage aImage(*mData->mTexture ); |
|
458 mData->mSliderProgressCentre->SetImage(aImage); |
|
459 } |
|
460 |
|
461 } |
|
462 |
|
463 // --------------------------------------------------------------------------- |
|
464 // OfferEvent |
|
465 // --------------------------------------------------------------------------- |
|
466 // |
|
467 AlfEventStatus MulSliderProgressive::offerEvent( |
|
468 CAlfWidgetControl&/* aControl*/, |
|
469 const TAlfEvent& /*aEvent*/ ) |
|
470 { |
|
471 // progress bar doesnt have any event handling |
|
472 return EEventNotHandled; |
|
473 } |
|
474 |
|
475 // --------------------------------------------------------------------------- |
|
476 // UpdateVisualization |
|
477 // --------------------------------------------------------------------------- |
|
478 void MulSliderProgressive::updateVisualization() |
|
479 { |
|
480 // Call to function to set relative |
|
481 //values for ranges if min range is not zero |
|
482 NormalizeRange(); |
|
483 int currTick = mSliderModel->PrimaryValue(); |
|
484 // Calculating the relative currtick if the MinRange is not zero. |
|
485 if (currTick >0 ) |
|
486 { |
|
487 currTick = currTick - mData->mTempMin; |
|
488 } |
|
489 // Set the new thumbimage position. |
|
490 SetTickPosition(currTick); |
|
491 } |
|
492 // --------------------------------------------------------------------------- |
|
493 // NormalizeRange |
|
494 // --------------------------------------------------------------------------- |
|
495 void MulSliderProgressive::NormalizeRange() |
|
496 { |
|
497 |
|
498 mData->mMaxRange = mSliderModel->MaxRange(); |
|
499 mData->mMinRange = mSliderModel->MinRange(); |
|
500 mData->mTick = mSliderModel->Tick(); |
|
501 mData->mTempMax = mData->mMaxRange; |
|
502 mData->mTempMin = mData->mMinRange; |
|
503 mData->mMaxRange = mData->mMaxRange - mData->mMinRange; |
|
504 mData->mMinRange = 0; |
|
505 } |
|
506 |
|
507 // --------------------------------------------------------------------------- |
|
508 // accept |
|
509 // --------------------------------------------------------------------------- |
|
510 // |
|
511 bool MulSliderProgressive::accept( |
|
512 CAlfWidgetControl& /*aControl*/, |
|
513 const TAlfEvent& /*aEvent*/) const |
|
514 { |
|
515 return false; |
|
516 } |
|
517 //--------------------------------------------------------------------------- |
|
518 //MulSliderProgressive eventHandlerType |
|
519 //------------------------------------------------------------------------- |
|
520 IAlfWidgetEventHandler::AlfEventHandlerType MulSliderProgressive:: |
|
521 eventHandlerType() |
|
522 { |
|
523 return IAlfWidgetEventHandler::EPresentationEventHandler; |
|
524 } |
|
525 |
|
526 //--------------------------------------------------------------------------- |
|
527 //MulSliderProgressive eventExecutionPhase |
|
528 //------------------------------------------------------------------------- |
|
529 IAlfWidgetEventHandler::AlfEventHandlerExecutionPhase MulSliderProgressive:: |
|
530 eventExecutionPhase() |
|
531 { |
|
532 return IAlfWidgetEventHandler::ETunnellingPhaseEventHandler; |
|
533 } |
|
534 // --------------------------------------------------------------------------- |
|
535 // SetTickPosition |
|
536 // --------------------------------------------------------------------------- |
|
537 void MulSliderProgressive::SetTickPosition(int aCurrTick) |
|
538 { |
|
539 //Getting slider width |
|
540 int sliderWidth = mData->mBaseSliderLayout->Size().Target().iX; |
|
541 //Getting the slider progress height |
|
542 int sliderProgressHeight = mData->mSliderProgressCentre->Size().Target().iY; |
|
543 //calculating the current postion of slider progress width |
|
544 int curpos =(sliderWidth * aCurrTick)/(mData->mMaxRange - mData->mMinRange); |
|
545 //setting the slider progress width |
|
546 mData->mSliderProgressCentre->SetSize( |
|
547 TAlfRealPoint(curpos,sliderProgressHeight),0); |
|
548 int sliderProgressWidth = mData->mSliderProgressCentre->Size().Target().iX; |
|
549 AknIconUtils::SetSize(iBitmap,TSize(sliderProgressWidth,sliderProgressHeight),EAspectRatioNotPreserved); |
|
550 } |
|
551 |
|
552 |
|
553 //--------------------------------------------------------------------------- |
|
554 //updateTextVisualization |
|
555 //------------------------------------------------------------------------- |
|
556 void MulSliderProgressive::updateTextVisualization() |
|
557 { |
|
558 // do nothing |
|
559 } |
|
560 }//namespace Alf |
|
561 |
|
562 //End Of File |
|