ui/widgets/glxzoomwidget/inc/glxzoomwidget.h
changeset 55 fb37077c270f
parent 49 f291796e213d
child 61 743eb0b9959e
--- a/ui/widgets/glxzoomwidget/inc/glxzoomwidget.h	Tue Jul 06 14:16:16 2010 +0300
+++ b/ui/widgets/glxzoomwidget/inc/glxzoomwidget.h	Wed Aug 18 09:48:53 2010 +0300
@@ -33,6 +33,8 @@
 
 const int MAXZVALUE = 100;
 const int MINZVALUE = 0;
+const int NOOFSTEPS = 20;
+const float MAXDTZOOMIN = 3.5;
 
 class GLXZOOMWIDGETSHARED_EXPORT GlxZoomWidget : public HbScrollArea
 {
@@ -53,11 +55,13 @@
      * This is an overloaded function when an index is changes due to deletion 
      */
     void indexChanged();
+    void forceZoomToBackground();
     
     signals:
     void pinchGestureReceived(int index);
     void zoomWidgetMovedBackground(int index);
-
+    void stepZoom();
+    
     public slots:
     //for Decoder support
     void decodedImageAvailable();
@@ -66,9 +70,11 @@
 	//for animation effects
 	void animateZoomIn(QPointF animRefPoint);
 	void animateZoomOut(QPointF animRefPoint);
-	void animationFrameChanged(int frameNumber);
 	void animationTimeLineFinished();
 
+	//animate double tap
+	void animateDoubleTap();
+	
     protected:
     bool sceneEvent(QEvent *event);
     bool sceneEventFilter(QGraphicsItem *watched,QEvent *event);
@@ -94,23 +100,36 @@
     void finalizeWidgetTransform();
     //get the focused image from the model
     QPixmap getFocusedImage();
+    //set all the zoom parameters as per the circumstances
+    void setZoomParams();
 
+    bool isFocussedItemCorrupt();
     //data members
-    private:
+private:
+    //to be in sync with the model
+    QAbstractItemModel *mModel;
+
+    //view Z values 
+    //might push to layouts later
+    int mMinZValue ;
+    int mMaxZValue ;
+    int mTimerId;
+
+    //status flags
+    //To check if the decode request has already been send or not
+    bool mImageDecodeRequestSend; 
+    //To check if the pinch gesture is in progress to block any events to HbScrollArea
+    bool mPinchGestureOngoing; 
+    //to check if decoded image is available
+    bool mDecodedImageAvailable;
+    //to check if the widget is actually in Foreground
+    bool mZoomOngoing;
+
     //view widgets
     QGraphicsPixmapItem *mZoomItem;   //Item containing the pixmap
     QGraphicsWidget *mZoomWidget;     //container :all scaling and transforms would be done on this widget
     HbIconItem* mBlackBackgroundItem; //for setting black background
 
-    //view Z values 
-    //might push to layouts later
-
-    int mMinZValue ;
-    int mMaxZValue ;
-
-
-    //to be in sync with the model
-    QAbstractItemModel *mModel;
     int mFocusIndex;
 
     //size parameter
@@ -129,14 +148,13 @@
     //for Decoder support
     GlxImageDecoderWrapper* mImageDecoder;
 
-    //status flags
-	//To check if the decode request has already been send or not
-    bool mImageDecodeRequestSend; 
-	//To check if the pinch gesture is in progress to block any events to HbScrollArea
-    bool mPinchGestureOngoing; 
-    //to check if decoded image is available
-    bool mDecodedImageAvailable;
-    int mTimerId;
-
+    //stores the incremental scalingfactor(sf) while performing double tap animation
+    qreal mIncSF;
+    //stores the scalingfactor increment applicable for each step of double tap animation
+    qreal msfInc;
+    //stores the item size before performing zoomout(zo)
+    QSizeF mzoSize;
+    //counter to track the double tap animation steps
+    int mdoubletapSteps;
 };
 #endif  //GLXZOOMWIDGET_H