akntouchgesturefw/src/akntouchgesturefwevent.cpp
branchRCL_3
changeset 56 d48ab3b357f1
parent 0 2f259fa3e83a
equal deleted inserted replaced
55:aecbbf00d063 56:d48ab3b357f1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Concrete touch gesture event classes.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "akntouchgesturefwevent.h"
       
    19 
       
    20 using namespace AknTouchGestureFw;
       
    21 
       
    22 // ======== MEMBER FUNCTIONS ========
       
    23 
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // Returns the gesture group.
       
    27 // ---------------------------------------------------------------------------
       
    28 //
       
    29 TAknTouchGestureFwGroup TAknTouchGestureFwUnknownEvent::Group() const
       
    30     {
       
    31     return EAknTouchGestureFwNoGroup;
       
    32     }
       
    33 
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // Returns the gesture type.
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 TAknTouchGestureFwType TAknTouchGestureFwUnknownEvent::Type() const
       
    40     {
       
    41     return EAknTouchGestureFwUnknown;
       
    42     }
       
    43 
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // Virtual method provided to allow extensibility.
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 TInt TAknTouchGestureFwUnknownEvent::Extension( TUid /*aInterface*/,
       
    50                                                 TAny* /*aParam*/ )
       
    51     {
       
    52     return KErrNotSupported;
       
    53     }
       
    54 
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // Sets the type of the tap gesture.
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 void TAknTouchGestureFwTapEvent::SetType( TAknTouchGestureFwType aType )
       
    61     {
       
    62     iType = aType;
       
    63     }
       
    64 
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // Sets the position of the tap.
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 void TAknTouchGestureFwTapEvent::SetPosition( const TPoint& aPosition )
       
    71     {
       
    72     iPosition = aPosition;
       
    73     }
       
    74 
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // Returns the gesture group.
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 TAknTouchGestureFwGroup TAknTouchGestureFwTapEvent::Group() const
       
    81     {
       
    82     return EAknTouchGestureFwGroupTap;
       
    83     }
       
    84 
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // Returns the gesture type.
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 TAknTouchGestureFwType TAknTouchGestureFwTapEvent::Type() const
       
    91     {
       
    92     return iType;
       
    93     }
       
    94 
       
    95 
       
    96 // ---------------------------------------------------------------------------
       
    97 // Virtual method provided to allow extensibility.
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 TInt TAknTouchGestureFwTapEvent::Extension( TUid /*aInterface*/,
       
   101                                             TAny* /*aParam*/ )
       
   102     {
       
   103     return KErrNotSupported;
       
   104     }
       
   105 
       
   106 
       
   107 // ---------------------------------------------------------------------------
       
   108 // Returns the tap position.
       
   109 // ---------------------------------------------------------------------------
       
   110 //
       
   111 TPoint TAknTouchGestureFwTapEvent::Position() const
       
   112     {
       
   113     return iPosition;
       
   114     }
       
   115 
       
   116 
       
   117 // ---------------------------------------------------------------------------
       
   118 // Sets the gesture state.
       
   119 // ---------------------------------------------------------------------------
       
   120 //
       
   121 void TAknTouchGestureFwDragEvent::SetState( TAknTouchGestureFwState aState )
       
   122     {
       
   123     iState = aState;
       
   124     }
       
   125 
       
   126 
       
   127 // ---------------------------------------------------------------------------
       
   128 // Sets the start position of the drag.
       
   129 // ---------------------------------------------------------------------------
       
   130 //
       
   131 void TAknTouchGestureFwDragEvent::SetStartPosition(
       
   132     const TPoint& aStartPosition )
       
   133     {
       
   134     iStartPosition = aStartPosition;
       
   135     }
       
   136 
       
   137 
       
   138 // ---------------------------------------------------------------------------
       
   139 // Sets the current position of the drag.
       
   140 // ---------------------------------------------------------------------------
       
   141 //
       
   142 void TAknTouchGestureFwDragEvent::SetCurrentPosition(
       
   143     const TPoint& aCurrentPosition )
       
   144     {
       
   145     iCurrentPosition = aCurrentPosition;
       
   146     }
       
   147 
       
   148 
       
   149 // ---------------------------------------------------------------------------
       
   150 // Sets the previous position of the drag.
       
   151 // ---------------------------------------------------------------------------
       
   152 //
       
   153 void TAknTouchGestureFwDragEvent::SetPreviousPosition(
       
   154     const TPoint& aPreviousPosition )
       
   155     {
       
   156     iPreviousPosition = aPreviousPosition;
       
   157     }
       
   158 
       
   159 
       
   160 // ---------------------------------------------------------------------------
       
   161 // Returns the gesture group.
       
   162 // ---------------------------------------------------------------------------
       
   163 //
       
   164 TAknTouchGestureFwGroup TAknTouchGestureFwDragEvent::Group() const
       
   165     {
       
   166     return EAknTouchGestureFwGroupDrag;
       
   167     }
       
   168 
       
   169 
       
   170 // ---------------------------------------------------------------------------
       
   171 // Returns the gesture type.
       
   172 // ---------------------------------------------------------------------------
       
   173 //
       
   174 TAknTouchGestureFwType TAknTouchGestureFwDragEvent::Type() const
       
   175     {
       
   176     return EAknTouchGestureFwDrag;
       
   177     }
       
   178 
       
   179 
       
   180 // ---------------------------------------------------------------------------
       
   181 // Returns the gesture state.
       
   182 // ---------------------------------------------------------------------------
       
   183 //
       
   184 TAknTouchGestureFwState TAknTouchGestureFwDragEvent::State() const
       
   185     {
       
   186     return iState;
       
   187     }
       
   188 
       
   189 
       
   190 // ---------------------------------------------------------------------------
       
   191 // Virtual method provided to allow extensibility.
       
   192 // ---------------------------------------------------------------------------
       
   193 //
       
   194 TInt TAknTouchGestureFwDragEvent::Extension( TUid /*aInterface*/,
       
   195                                              TAny* /*aParam*/ )
       
   196     {
       
   197     return KErrNotSupported;
       
   198     }
       
   199 
       
   200 
       
   201 // ---------------------------------------------------------------------------
       
   202 // Returns the start position of the drag.
       
   203 // ---------------------------------------------------------------------------
       
   204 //
       
   205 TPoint TAknTouchGestureFwDragEvent::StartPosition() const
       
   206     {
       
   207     return iStartPosition;
       
   208     }
       
   209 
       
   210 
       
   211 // ---------------------------------------------------------------------------
       
   212 // Returns the current position of the drag.
       
   213 // ---------------------------------------------------------------------------
       
   214 //
       
   215 TPoint TAknTouchGestureFwDragEvent::CurrentPosition() const
       
   216     {
       
   217     return iCurrentPosition;
       
   218     }
       
   219 
       
   220 
       
   221 // ---------------------------------------------------------------------------
       
   222 // Returns the previous position of the drag.
       
   223 // ---------------------------------------------------------------------------
       
   224 //
       
   225 TPoint TAknTouchGestureFwDragEvent::PreviousPosition() const
       
   226     {
       
   227     return iPreviousPosition;
       
   228     }
       
   229 
       
   230 
       
   231 // ---------------------------------------------------------------------------
       
   232 // Sets the flick gesture type.
       
   233 // ---------------------------------------------------------------------------
       
   234 //
       
   235 void TAknTouchGestureFwFlickEvent::SetType( TAknTouchGestureFwType aType )
       
   236     {
       
   237     iType = aType;
       
   238     }
       
   239 
       
   240 
       
   241 // ---------------------------------------------------------------------------
       
   242 // Sets the flick position.
       
   243 // ---------------------------------------------------------------------------
       
   244 //
       
   245 void TAknTouchGestureFwFlickEvent::SetPosition( const TPoint& aFlickPosition )
       
   246     {
       
   247     iFlickPosition = aFlickPosition;
       
   248     }
       
   249 
       
   250 
       
   251 // ---------------------------------------------------------------------------
       
   252 // Sets the flick speed.
       
   253 // ---------------------------------------------------------------------------
       
   254 //
       
   255 void TAknTouchGestureFwFlickEvent::SetSpeed( const TPoint& aSpeed )
       
   256     {
       
   257     iSpeed = aSpeed;
       
   258     }
       
   259 
       
   260 
       
   261 // ---------------------------------------------------------------------------
       
   262 // Returns the gesture group.
       
   263 // ---------------------------------------------------------------------------
       
   264 //
       
   265 TAknTouchGestureFwGroup TAknTouchGestureFwFlickEvent::Group() const
       
   266     {
       
   267     return EAknTouchGestureFwGroupFlick;
       
   268     }
       
   269 
       
   270 
       
   271 // ---------------------------------------------------------------------------
       
   272 // Returns the gesture type.
       
   273 // ---------------------------------------------------------------------------
       
   274 //
       
   275 TAknTouchGestureFwType TAknTouchGestureFwFlickEvent::Type() const
       
   276     {
       
   277     return iType;
       
   278     }
       
   279 
       
   280 
       
   281 // ---------------------------------------------------------------------------
       
   282 // Virtual method provided to allow extensibility.
       
   283 // ---------------------------------------------------------------------------
       
   284 //
       
   285 TInt TAknTouchGestureFwFlickEvent::Extension( TUid /*aInterface*/,
       
   286                                               TAny* /*aParam*/ )
       
   287     {
       
   288     return KErrNotSupported;
       
   289     }
       
   290 
       
   291 
       
   292 // ---------------------------------------------------------------------------
       
   293 // Returns the flick position.
       
   294 // ---------------------------------------------------------------------------
       
   295 //
       
   296 TPoint TAknTouchGestureFwFlickEvent::Position() const
       
   297     {
       
   298     return iFlickPosition;
       
   299     }
       
   300 
       
   301 
       
   302 // ---------------------------------------------------------------------------
       
   303 // Returns the flick speed.
       
   304 // ---------------------------------------------------------------------------
       
   305 //
       
   306 TPoint TAknTouchGestureFwFlickEvent::Speed() const
       
   307     {
       
   308     return iSpeed;
       
   309     }
       
   310 
       
   311 
       
   312 // ---------------------------------------------------------------------------
       
   313 // Sets the pinch gesture state.
       
   314 // ---------------------------------------------------------------------------
       
   315 //
       
   316 void TAknTouchGestureFwPinchEvent::SetState( TAknTouchGestureFwState aState )
       
   317     {
       
   318     iState = aState;
       
   319     }
       
   320 
       
   321 
       
   322 // ---------------------------------------------------------------------------
       
   323 // Sets the pinch movement.
       
   324 // ---------------------------------------------------------------------------
       
   325 //
       
   326 void TAknTouchGestureFwPinchEvent::SetMovement( TInt aMovement )
       
   327     {
       
   328     iMovement = aMovement;
       
   329     }
       
   330 
       
   331 
       
   332 // ---------------------------------------------------------------------------
       
   333 // Returns the gesture group.
       
   334 // ---------------------------------------------------------------------------
       
   335 //
       
   336 TAknTouchGestureFwGroup TAknTouchGestureFwPinchEvent::Group() const
       
   337     {
       
   338     return EAknTouchGestureFwGroupPinch;
       
   339     }
       
   340 
       
   341 
       
   342 // ---------------------------------------------------------------------------
       
   343 // Returns the gesture type.
       
   344 // ---------------------------------------------------------------------------
       
   345 //
       
   346 TAknTouchGestureFwType TAknTouchGestureFwPinchEvent::Type() const
       
   347     {
       
   348     return EAknTouchGestureFwPinch;
       
   349     }
       
   350 
       
   351 
       
   352 // ---------------------------------------------------------------------------
       
   353 // Returns the gesture state.
       
   354 // ---------------------------------------------------------------------------
       
   355 //
       
   356 TAknTouchGestureFwState TAknTouchGestureFwPinchEvent::State() const
       
   357     {
       
   358     return iState;
       
   359     }
       
   360 
       
   361 
       
   362 // ---------------------------------------------------------------------------
       
   363 // Virtual method provided to allow extensibility.
       
   364 // ---------------------------------------------------------------------------
       
   365 //
       
   366 TInt TAknTouchGestureFwPinchEvent::Extension( TUid /*aInterface*/,
       
   367                                               TAny* /*aParam*/ )
       
   368     {
       
   369     return KErrNotSupported;
       
   370     }
       
   371 
       
   372 
       
   373 // ---------------------------------------------------------------------------
       
   374 // Returns the pinch movement.
       
   375 // ---------------------------------------------------------------------------
       
   376 //
       
   377 TInt TAknTouchGestureFwPinchEvent::Movement() const
       
   378     {
       
   379     return iMovement;
       
   380     }
       
   381 
       
   382 // End of File