akntouchgesturefw/src/akntouchgesturefw.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     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: Touch gesture framework public API methods.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <akntouchgesturefw.h>
       
    19 #include <AknTasHook.h>
       
    20 
       
    21 #include "akntouchgesturefwdefs.h"
       
    22 #include "akntouchgesturefwimpl.h"
       
    23 #include "akntouchgesturefwsimulation.h"
       
    24 
       
    25 using namespace AknTouchGestureFw;
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // Two-phase constructor
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 EXPORT_C CAknTouchGestureFw* CAknTouchGestureFw::NewL(
       
    32         MAknTouchGestureFwObserver& aObserver,
       
    33         CCoeControl& aControl )
       
    34     {
       
    35     CAknTouchGestureFw* self = new ( ELeave ) CAknTouchGestureFw;
       
    36     CleanupStack::PushL( self );
       
    37     self->ConstructL( aObserver, aControl );
       
    38     CleanupStack::Pop( self );
       
    39     return self;
       
    40     }
       
    41 
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // Destructor
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 CAknTouchGestureFw::~CAknTouchGestureFw()
       
    48     {
       
    49     AKNTASHOOK_REMOVE();
       
    50     CAknTouchGestureFwSimulation::EndSimulation( this );
       
    51     delete iImpl;
       
    52     }
       
    53 
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // Sets the gesture interest.
       
    57 // ---------------------------------------------------------------------------
       
    58 //
       
    59 EXPORT_C void CAknTouchGestureFw::SetGestureInterestL( TUint aGestureGroups,
       
    60                                                        TUint /*aFlags*/ )
       
    61     {
       
    62     iImpl->SetGestureInterestL( aGestureGroups );
       
    63     }
       
    64 
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // Defines gesture groups, which trigger tactile feedback automatically.
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 EXPORT_C void CAknTouchGestureFw::SetFeedbackForGroupsL( TUint aGestureGroups )
       
    71     {
       
    72     iImpl->SetFeedbackForGroupsL( aGestureGroups );
       
    73     }
       
    74 
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // Defines gesture types, which trigger tactile feedback automatically.
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 EXPORT_C void CAknTouchGestureFw::SetFeedbackForTypesL(
       
    81     TAknTouchGestureFwGroup aGestureGroup,
       
    82     TUint aGestureTypesForTactile,
       
    83     TUint aGestureTypesForAudio )
       
    84     {
       
    85     iImpl->SetFeedbackForTypesL(
       
    86         aGestureGroup,
       
    87         aGestureTypesForTactile,
       
    88         aGestureTypesForAudio );
       
    89     }
       
    90 
       
    91 
       
    92 // ----------------------------------------------------------------------------
       
    93 // Extension_
       
    94 // ----------------------------------------------------------------------------
       
    95 //
       
    96 TInt CAknTouchGestureFw::Extension_( TUint aExtensionId, TAny*& a0, TAny* a1 )
       
    97     {
       
    98     if ( aExtensionId == KAknTouchGestureFwTestingFeature )
       
    99         {
       
   100         TRAP_IGNORE(
       
   101                 CAknTouchGestureFwSimulation::InitSimulationL( this, iImpl ) );
       
   102         iImpl->EnableTestingFeatures();
       
   103         return KErrNone;
       
   104         }
       
   105     return CBase::Extension_( aExtensionId, a0, a1 );
       
   106     }
       
   107 
       
   108 
       
   109 // ---------------------------------------------------------------------------
       
   110 // Default C++ constructor.
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 CAknTouchGestureFw::CAknTouchGestureFw()
       
   114     {
       
   115     AKNTASHOOK_ADD( this, "CAknTouchGestureFw" );
       
   116     }
       
   117 
       
   118 
       
   119 // ---------------------------------------------------------------------------
       
   120 // Second-phase constructor.
       
   121 // ---------------------------------------------------------------------------
       
   122 //
       
   123 void CAknTouchGestureFw::ConstructL( MAknTouchGestureFwObserver& aObserver,
       
   124                                      CCoeControl& aControl )
       
   125     {
       
   126     iImpl = CAknTouchGestureFwImpl::NewL( aObserver, &aControl );
       
   127     }
       
   128 
       
   129 // End of File