270 |
270 |
271 // ----------------------------------------------------------------------------- |
271 // ----------------------------------------------------------------------------- |
272 // ActivateL:Activates the Zoom Control,set the image visual ,do the initial setup |
272 // ActivateL:Activates the Zoom Control,set the image visual ,do the initial setup |
273 // ----------------------------------------------------------------------------- |
273 // ----------------------------------------------------------------------------- |
274 // |
274 // |
275 EXPORT_C void CGlxZoomControl::ActivateL(TInt /*aInitialZoomRatio*/, TZoomStartMode aStartMode, |
275 EXPORT_C void CGlxZoomControl::ActivateL(TInt aInitialZoomRatio, TZoomStartMode aStartMode, |
276 TInt aFocusIndex, TGlxMedia& aItem, TPoint* aZoomFocus,TBool aViewingMode) |
276 TInt aFocusIndex, TGlxMedia& aItem, TPoint* aZoomFocus,TBool aViewingMode) |
277 { |
277 { |
278 TRACER("CGlxZoomControl::ActivateL()"); |
278 TRACER("CGlxZoomControl::ActivateL()"); |
279 |
279 |
280 if ( !iZoomActive ) |
280 if ( !iZoomActive ) |
318 // Now since our maximum size possible is 3 MP. all our zoom percentages will be relative to it. |
318 // Now since our maximum size possible is 3 MP. all our zoom percentages will be relative to it. |
319 // So our initial zoom ratio will be different and cnsequently our minimum slider value too will change. |
319 // So our initial zoom ratio will be different and cnsequently our minimum slider value too will change. |
320 // Maximum is an |
320 // Maximum is an |
321 TInt initialZoomRatio = GetInitialZoomLevel(maxVirtualImageSize); |
321 TInt initialZoomRatio = GetInitialZoomLevel(maxVirtualImageSize); |
322 iZoomSliderModel->SetMinRange(initialZoomRatio); |
322 iZoomSliderModel->SetMinRange(initialZoomRatio); |
323 |
323 |
324 iEventHandler->SetZoomActivated(ETrue); |
324 iEventHandler->SetZoomActivated(ETrue); |
325 iEventHandler->ActivateZoom(initialZoomRatio, |
325 if (aStartMode == EZoomStartSlider) |
326 maxVirtualImageSize, |
326 { |
327 aStartMode, |
327 iEventHandler->ActivateZoom(aInitialZoomRatio, |
328 iZoomSliderModel->MinRange(), |
328 maxVirtualImageSize, |
329 iZoomSliderModel->MaxRange(), |
329 aStartMode, |
330 maxVirtualImageSize, |
330 iZoomSliderModel->MinRange(), |
331 aZoomFocus); |
331 iZoomSliderModel->MaxRange(), |
332 |
332 maxVirtualImageSize, |
|
333 aZoomFocus); |
|
334 } |
|
335 else |
|
336 { |
|
337 iEventHandler->ActivateZoom(initialZoomRatio, |
|
338 maxVirtualImageSize, |
|
339 aStartMode, |
|
340 iZoomSliderModel->MinRange(), |
|
341 iZoomSliderModel->MaxRange(), |
|
342 maxVirtualImageSize, |
|
343 aZoomFocus); |
|
344 } |
333 TRAP_IGNORE(iImageTexture = |
345 TRAP_IGNORE(iImageTexture = |
334 &(iTextureMgr->CreateZoomedTextureL(aItem,thumbNailAttribute,idspace,this))); |
346 &(iTextureMgr->CreateZoomedTextureL(aItem,thumbNailAttribute,idspace,this))); |
335 |
347 |
336 //This is for handling the alaram interrupt events,that causes the phone to freeze. |
348 //This is for handling the alaram interrupt events,that causes the phone to freeze. |
337 CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
349 CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
880 if (aEvent.Visual() == iImageVisual) |
892 if (aEvent.Visual() == iImageVisual) |
881 { |
893 { |
882 iEventHandler->HandleDragEvent(aEvent); |
894 iEventHandler->HandleDragEvent(aEvent); |
883 } |
895 } |
884 break; |
896 break; |
885 case EGestureTap: |
897 case EGestureTap: |
886 if (aEvent.Visual() == iImageVisual) |
|
887 { |
|
888 iEventHandler->HandleSingleTap(aEvent); |
898 iEventHandler->HandleSingleTap(aEvent); |
889 } |
|
890 break; |
899 break; |
891 case EGesturePinch: |
900 case EGesturePinch: |
892 iEventHandler->HandlePinchEventL(aEvent); |
901 iEventHandler->HandlePinchEventL(aEvent); |
893 break; |
902 break; |
894 case EGestureDoubleTap: |
903 case EGestureDoubleTap: |