|
1 /* |
|
2 * Copyright (c) 2008 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 the License "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: Gesture helper implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "statemachine.h" |
|
19 #include "gestureframework.h" |
|
20 #include "gestureframeworkimpl.h" |
|
21 #include "GestureEngine.h" |
|
22 #include "rt_gestureengineif.h" |
|
23 #include "rt_gesturelistener.h" |
|
24 #include "tapgesturerecogniser.h" |
|
25 #include "pangesturerecogniser.h" |
|
26 |
|
27 using namespace stmGesture ; |
|
28 |
|
29 CGestureFramework::CGestureFramework() |
|
30 { |
|
31 // No implementation required |
|
32 } |
|
33 |
|
34 CGestureFramework::~CGestureFramework() |
|
35 { |
|
36 delete m_impl ; |
|
37 } |
|
38 |
|
39 CGestureFramework* CGestureFramework::NewLC() |
|
40 { |
|
41 CGestureFramework* self = new (ELeave) CGestureFramework(); |
|
42 CleanupStack::PushL(self); |
|
43 self->ConstructL(); |
|
44 return self; |
|
45 } |
|
46 |
|
47 CGestureFramework* CGestureFramework::NewL() |
|
48 { |
|
49 CGestureFramework* self = CGestureFramework::NewLC(); |
|
50 CleanupStack::Pop(self); |
|
51 return self; |
|
52 } |
|
53 |
|
54 void CGestureFramework::ConstructL() |
|
55 { |
|
56 m_impl = CGestureFrameworkImpl::NewL() ; |
|
57 } |
|
58 |
|
59 TVersion CGestureFramework::Version() |
|
60 { |
|
61 // Version number of example API |
|
62 const TInt KMajor = 1; |
|
63 const TInt KMinor = 0; |
|
64 const TInt KBuild = 1; |
|
65 return TVersion(KMajor, KMinor, KBuild); |
|
66 } |
|
67 |
|
68 /*! |
|
69 * Create new gesture engine if not already existing and return the interface |
|
70 */ |
|
71 MGestureEngineIf* CGestureFramework::getGestureEngine() |
|
72 { |
|
73 return m_impl->getGestureEngine() ; |
|
74 } |
|
75 |
|
76 stmUiEventEngine::CStateMachine* CGestureFramework::getUiStateMachine() |
|
77 { |
|
78 return m_impl->getUiStateMachine() ; |
|
79 } |
|
80 |
|
81 void CGestureFramework::enableLogging(bool loggingEnabled) |
|
82 { |
|
83 m_loggingenabled = loggingEnabled; |
|
84 if (m_impl) m_impl->enableLogging(loggingEnabled) ; |
|
85 } |
|
86 |