taskswitcher/teleportui/hgteleportapp/inc/hgteleportphysicsengine.h
changeset 4 4d54b72983ae
parent 3 fb3763350a08
child 5 c743ef5928ba
equal deleted inserted replaced
3:fb3763350a08 4:4d54b72983ae
     1 /*
       
     2  * ============================================================================
       
     3  *  Name        : hgteleportphysicsengine.h
       
     4  *  Part of     : Hg Teleport
       
     5  *  Description : Teleport physic engine
       
     6  *  Version     : %version:  3 %
       
     7  *
       
     8  *  Copyright © 2009 Nokia.  All rights reserved.
       
     9  *  This material, including documentation and any related computer
       
    10  *  programs, is protected by copyright controlled by Nokia.  All
       
    11  *  rights are reserved.  Copying, including reproducing, storing,
       
    12  *  adapting or translating, any or all of this material requires the
       
    13  *  prior written consent of Nokia.  This material also contains
       
    14  *  confidential information which may not be disclosed to others
       
    15  *  without the prior written consent of Nokia.
       
    16  * ============================================================================
       
    17  *
       
    18  */
       
    19 
       
    20 #ifndef HGTELEPORTPHYSICSENGINE_H_
       
    21 #define HGTELEPORTPHYSICSENGINE_H_
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <akntouchgesturefw.h>
       
    25 // CLASS DECLARATION
       
    26 class CAknPhysics;
       
    27 class CHgTeleportPhysics;
       
    28 /**
       
    29  * Teleport physic engine implementation
       
    30  */
       
    31 class CHgTeleportPhysicsEngine: public CBase
       
    32     {
       
    33 public:
       
    34     // Constructors and destructor
       
    35 
       
    36     /**
       
    37      * Destructor.
       
    38      */
       
    39     ~CHgTeleportPhysicsEngine();
       
    40 
       
    41     /**
       
    42      * Two-phased constructor.
       
    43      */
       
    44     static CHgTeleportPhysicsEngine* NewL(MAknPhysicsObserver& aPhysicObserver,
       
    45             CCoeControl& aViewControl);
       
    46 
       
    47     /**
       
    48      * Two-phased constructor.
       
    49      */
       
    50     static CHgTeleportPhysicsEngine* NewLC(MAknPhysicsObserver& aPhysicObserver,
       
    51             CCoeControl& aViewControl);
       
    52 
       
    53 private:
       
    54 
       
    55     /**
       
    56      * Constructor for performing 1st stage construction
       
    57      */
       
    58     CHgTeleportPhysicsEngine();
       
    59 
       
    60     /**
       
    61      * EPOC default constructor for performing 2nd stage construction
       
    62      */
       
    63     void ConstructL(MAknPhysicsObserver& aPhysicObserver,
       
    64             CCoeControl& aViewControl);
       
    65     
       
    66     
       
    67 public:
       
    68     /**
       
    69      * Implements drag gesture handling
       
    70      * @param aEvent - drag event
       
    71      */
       
    72     void HandleDragEvent(AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent);
       
    73     
       
    74     /**
       
    75      */
       
    76     TBool IsRunning() const;
       
    77     
       
    78     /**
       
    79      */
       
    80     void Stop();
       
    81     
       
    82     /**
       
    83      * Initialize animation between current position and destination point
       
    84      * @param aPoint - destination point 
       
    85      */
       
    86     void AnimateToTarget(const TPoint& aPoint);
       
    87     
       
    88     /**
       
    89      * 
       
    90      * @param aWorldSize Physics world size.
       
    91      * @param aViewSize Physics (visible) view size.
       
    92      * @param aLandscape ETrue if physics should work in landscape.     
       
    93      **/
       
    94     void ReInitPhysicsL(const TSize& aWorldSize, 
       
    95                         const TSize& aViewSize,
       
    96                         TBool aLandscape);
       
    97     
       
    98 private:
       
    99     /**
       
   100      * Physics. 
       
   101      * Own.
       
   102      */
       
   103     CAknPhysics* iPhysics;
       
   104 
       
   105     /**
       
   106      * Drag start time
       
   107      */
       
   108     TTime iStartTime;
       
   109     
       
   110     /**
       
   111      * Teleport physics for item switch animation
       
   112      */
       
   113     CHgTeleportPhysics* iTeleportPhysics;
       
   114 
       
   115     };
       
   116 
       
   117 #endif /* HGTELEPORTPHYSICSENGINE_H_*/