photosgallery/viewframework/views/zoomview/inc/glxzoomeventhandler.h
branchRCL_3
changeset 9 6b87b143d312
parent 1 9ba538e329bd
child 30 a60acebbbd9d
equal deleted inserted replaced
5:f7f0874bfe7d 9:6b87b143d312
   111     /**
   111     /**
   112     * Handle the drag events for panning
   112     * Handle the drag events for panning
   113     */
   113     */
   114     void HandleDragEvent(const GestureHelper::MGestureEvent& aEvent );
   114     void HandleDragEvent(const GestureHelper::MGestureEvent& aEvent );
   115     
   115     
       
   116     /**
       
   117     * Handle the Pinch events for panning
       
   118     */
   116     void HandlePinchEventL(const GestureHelper::MGestureEvent& aEvent);
   119     void HandlePinchEventL(const GestureHelper::MGestureEvent& aEvent);
   117     
   120     
       
   121     /**
       
   122     * Handle the Double Tap events for panning
       
   123     */
   118     void HandleDoubleTap(const GestureHelper::MGestureEvent& aEvent );
   124     void HandleDoubleTap(const GestureHelper::MGestureEvent& aEvent );
   119     
   125     
       
   126     /**
       
   127     * Handle the Single Tap events for panning
       
   128     */
   120     void HandleSingleTap(const GestureHelper::MGestureEvent& aEvent );
   129     void HandleSingleTap(const GestureHelper::MGestureEvent& aEvent );
   121     
   130     
       
   131     /**
       
   132     * Handle the Gesture Released events for panning
       
   133     */
   122     void HandleGestureReleased(const GestureHelper::MGestureEvent& aEvent );
   134     void HandleGestureReleased(const GestureHelper::MGestureEvent& aEvent );
   123     
   135     
       
   136     /**
       
   137     * Remembers the previous events code. 
       
   138     */
   124     void SetPreviousEventCode(const GestureHelper::TGestureCode code );
   139     void SetPreviousEventCode(const GestureHelper::TGestureCode code );
   125     
   140     
       
   141     /**
       
   142     * Handle a multitouch gesture released event.
       
   143     */
   126     void HandleMultiTouchReleased();
   144     void HandleMultiTouchReleased();
   127     
   145     
       
   146     /**
       
   147     * Bring back zoom state to minimum. 
       
   148     */
       
   149     void ZoomToMinimumL();
       
   150     
   128 private:
   151 private:
   129     /*
   152     /*
   130      * Constructor
   153      * Constructor
   131      */
   154      */
   132     CGlxZoomPanEventHandler(MGlxZoomEventHandlers& aZoomEventHandler);
   155     CGlxZoomPanEventHandler(MGlxZoomEventHandlers& aZoomEventHandler);
   138 
   161 
   139     /**
   162     /**
   140     *  This Function handles all the KeyEvents 
   163     *  This Function handles all the KeyEvents 
   141     */
   164     */
   142     TBool HandlekeyEvents(const TAlfEvent &aEvent);
   165     TBool HandlekeyEvents(const TAlfEvent &aEvent);
   143     
       
   144     /**
       
   145     * Callback function for zoom 
       
   146     */     
       
   147     static TInt ZoomIntervalExpired(TAny* aPtr);
       
   148     
   166     
   149     /**
   167     /**
   150     * Callback function for pan
   168     * Callback function for pan
   151     */ 
   169     */ 
   152     static TInt PanIntervalExpired(TAny* aPtr);
   170     static TInt PanIntervalExpired(TAny* aPtr);
   153     
   171     
   154     /**
       
   155     * Start zoom in/out continously
       
   156     */     
       
   157     void DoZoom();
       
   158     
       
   159     // Zoom by the next zoom increment.
   172     // Zoom by the next zoom increment.
   160     // aZoomMode is ignored if aExpectedZoomLevel has a positive value
   173     // aZoomMode is ignored if aExpectedZoomLevel has a positive value
   161     void Zoom(TInt aExpectedZoomLevel, TInt aRelativeZoomFactor, TZoomMode aZoomMode = EZoomIn, TPoint* aZoomFocus = NULL);
   174     void Zoom(TInt aExpectedZoomLevel, TInt aRelativeZoomFactor, TZoomMode aZoomMode = EZoomIn, TPoint* aZoomFocus = NULL);
   162     /**
   175     /**
   163     * Start Panning continously
   176     * Start Panning continously
   164     */     
   177     */     
   165     void DoPan();
   178     void DoPan();
   166     
       
   167     /**
       
   168     * Starts the timer for continous zooming
       
   169     */     
       
   170     void StartZoomTimer();
       
   171     
   179     
   172     /**
   180     /**
   173     * Starts the timer for continous Panning
   181     * Starts the timer for continous Panning
   174     */ 
   182     */ 
   175     void StartPanTimer();
   183     void StartPanTimer();
   191      * Timer callback for zoomout 
   199      * Timer callback for zoomout 
   192      */
   200      */
   193     static TInt ZoomOutTimerL(TAny* aSelf);
   201     static TInt ZoomOutTimerL(TAny* aSelf);
   194     
   202     
   195     /**
   203     /**
   196     * Handle zoom key pressed or released.
       
   197     * @param aZoomIn    :ETrue for Zoom In key, EFalse for Zoom Out key
       
   198     * @param aEventCode :Type of key event.
       
   199     */
       
   200     void HandleZoomKey(TZoomMode aZoomMode, const TEventCode aEventCode);
       
   201     
       
   202     /**
       
   203     * Handle the key events for panning
   204     * Handle the key events for panning
   204     * @param aPanDirection: Specifies the pan direction
   205     * @param aPanDirection: Specifies the pan direction
   205     * @param aEvent       : Specifies the event values.
   206     * @param aEvent       : Specifies the event values.
   206     */
   207     */
   207     TBool HandlePanKey(const TAlfEvent &aEvent);
   208     TBool HandlePanKey(const TAlfEvent &aEvent);
   268     CPeriodic*          iUiTimer;                       // The Timer used to Hide the UI/Screen Furniture[Back Key/Slider] after 2 seconds
   269     CPeriodic*          iUiTimer;                       // The Timer used to Hide the UI/Screen Furniture[Back Key/Slider] after 2 seconds
   269     CPeriodic*          iZoomPanTimer;                  // The Timer used  for Zooming/Panning the Image Exponentially
   270     CPeriodic*          iZoomPanTimer;                  // The Timer used  for Zooming/Panning the Image Exponentially
   270     TPoint              iStartDisplayPoint;             // The variable holds the starting pointer posistion to determine the Drag Distance
   271     TPoint              iStartDisplayPoint;             // The variable holds the starting pointer posistion to determine the Drag Distance
   271     TTime               iDoubleTap;                     // This Variable is used to determine the double tap,by using the difference of the time 
   272     TTime               iDoubleTap;                     // This Variable is used to determine the double tap,by using the difference of the time 
   272                                                         // between subsequent single Tap.
   273                                                         // between subsequent single Tap.
   273     // [todo] do we need this variable to be at a class level
   274     TInt                iInitialZoomRatio;
   274     TInt                iZoomRatio;
   275     TInt                iZoomRatio;
   275     TRect               iDoubleTapRect;                 // This varaible holds the rect for the Double Tap
   276     TRect               iDoubleTapRect;                 // This varaible holds the rect for the Double Tap
   276     TBool               iDragOngoing;                   // Is a drag event ongoing
   277     TBool               iDragOngoing;                   // Is a drag event ongoing
   277     TBool               iZoomActivated;                 // To Denote if zoom is activated
   278     TBool               iZoomActivated;                 // To Denote if zoom is activated
   278     TUiState            iZoomUiState;                   // To Denote if the Ui is On in zoom
   279     TUiState            iZoomUiState;                   // To Denote if the Ui is On in zoom