imageeditor/ImageEditorUI/src/ImageEditorUIContainer.cpp
changeset 12 18b321db4884
parent 1 edfc90759b9f
--- a/imageeditor/ImageEditorUI/src/ImageEditorUIContainer.cpp	Fri Jan 29 13:53:17 2010 +0200
+++ b/imageeditor/ImageEditorUI/src/ImageEditorUIContainer.cpp	Thu Jun 03 18:57:10 2010 +0800
@@ -67,6 +67,12 @@
 	ActivateL();
 	}
 
+//judge if it is draw plug-in
+EXPORT_C void CImageEditorUIContainer::IsDrawPlugin(TBool aFlag)
+	{
+	iIsDrawPlugin = aFlag;
+	}
+
 //=============================================================================
 CImageEditorUIContainer::~CImageEditorUIContainer()
 	{
@@ -95,7 +101,10 @@
 	if (iControl)
 		{
 		((CImageEditorControlBase *)iControl)->SetView(iEditorView);
-		iControl->SetRect(Rect() );
+		if(!iIsDrawPlugin)
+			{
+			iControl->SetRect(Rect() );
+			}		
 		}
 	DrawDeferred();
 	}
@@ -111,8 +120,7 @@
 	}
 
 //=============================================================================
-TKeyResponse CImageEditorUIContainer::OfferKeyEventL(
-		const TKeyEvent & aKeyEvent, TEventCode aType)
+TKeyResponse CImageEditorUIContainer::OfferKeyEventL(const TKeyEvent & aKeyEvent, TEventCode aType)
 	{
 	if (Busy() )
 		{
@@ -123,8 +131,7 @@
 		TKeyResponse res = EKeyWasNotConsumed;
 		if (iControl)
 			{
-			res = ((CCoeControl*)iControl)->OfferKeyEventL(aKeyEvent,
-					aType);
+			res = ((CCoeControl*)iControl)->OfferKeyEventL(aKeyEvent,aType);
 			}
 		return res;
 		}
@@ -147,8 +154,7 @@
 	}
 
 //=============================================================================
-void CImageEditorUIContainer::HandlePointerEventL(
-		const TPointerEvent &aPointerEvent)
+void CImageEditorUIContainer::HandlePointerEventL(const TPointerEvent &aPointerEvent)
 	{
 	if (Busy() )
 		{
@@ -162,12 +168,10 @@
 			}
 		else
 			{
-
 			switch (aPointerEvent.iType)
 				{
 				case TPointerEvent::EButton1Down:
-					{
-					
+					{					
 #ifdef RD_TACTILE_FEEDBACK
 						if ( iTouchFeedBack )
 							{
@@ -175,8 +179,7 @@
 							RDebug::Printf( "ImageEditor::ImageEditorUIContainer: ETouchFeedback" );
 							}
 #endif /* RD_TACTILE_FEEDBACK  */
-						
-					if ( !iEditorView->InZoomingState() )
+						if ( !iEditorView->InZoomingState() )
 						{
 						iEditorView->HandleCommandL(EImageEditorMenuCmdApplyEffect);
 						}
@@ -188,21 +191,17 @@
 					}
 				case TPointerEvent::EDrag:
 					{
-					iXDirChange = iTappedPosition.iX
-							- aPointerEvent.iPosition.iX;
-					iYDirChange = iTappedPosition.iY
-							- aPointerEvent.iPosition.iY;
+					iXDirChange = iTappedPosition.iX - aPointerEvent.iPosition.iX;
+					iYDirChange = iTappedPosition.iY - aPointerEvent.iPosition.iY;
 
 					// Compare total change in pixels (absolute value) to 
 					// threshold value. This is to prevent calling engine's 
 					// Pan-function in every minimal movement                                                         
-					if ( (Abs(iXDirChange) + Abs(iYDirChange) )
-							> KTouchPanTotalMoveThreshold)
+					if ( (Abs(iXDirChange) + Abs(iYDirChange) )	> KTouchPanTotalMoveThreshold )
 						{
 						iTappedPosition = aPointerEvent.iPosition;
 						iEditorView->HandleCommandL(EImageEditorCmdTouchPan);
 						}
-
 					break;
 					}
 				case TPointerEvent::EButton1Up:
@@ -216,11 +215,8 @@
 					break;
 					}
 				}
-
 			}
-
 		}
-
 	}
 
 //=============================================================================
@@ -314,17 +310,14 @@
 			MAknsControlContext* cc = AknsDrawUtils::ControlContext( this);
 			AknsDrawUtils::DrawBackground(skin, cc, this, gc, TPoint(0, 0),
 					Rect(), KAknsDrawParamDefault);
-
 			}
 		}
-
 	iWaitIndicator->DrawItem(gc);
 	}
 
 //=============================================================================
 void CImageEditorUIContainer::HandleControlEventL(CCoeControl * /*aControl*/,
-		TCoeEvent /*aEventType*/
-)
+		TCoeEvent /*aEventType*/)
 	{
 
 	}