Fork for IVI: mesa fixing
[profile/ivi/uifw.git] / src / ui / inc / FUi_TouchGestureDetectorImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file                FUi_TouchGestureDetectorImpl.h
19  * @brief       This is the header file for the %_TouchGestureDetectorImpl class.
20  *
21  * This header file contains the declarations of the %_TouchGestureDetectorImpl class.
22  */
23 #ifndef _FUI_INTERNAL_TOUCH_GESTURE_DETECTOR_IMPL_H_
24 #define _FUI_INTERNAL_TOUCH_GESTURE_DETECTOR_IMPL_H_
25
26 #include <FBaseObject.h>
27 #include <FBaseColIListT.h>
28 #include <FUiTouchGestureDetector.h>
29 #include <FUiITouchGestureEventListener.h>
30 #include "FUi_TouchGestureDetector.h"
31 #include "FUi_ITouchGestureDelegate.h"
32
33 namespace Tizen { namespace Ui
34 {
35 class _TouchEventArg;
36
37 class _TouchGestureDetectorImpl
38         : public Tizen::Base::Object
39         , virtual public _ITouchGestureDelegate
40 {
41 public:
42         virtual ~_TouchGestureDetectorImpl(void);
43
44         static _TouchGestureDetectorImpl* CreateInstanceN(TouchGestureDetector* pPublic);
45
46         result SetDetectorState(TouchGestureDetectorState state);
47         TouchGestureDetectorState GetDetectorState(void) const;
48
49         result SetDelayTouchEventEnabled(bool enable);
50         bool IsDelayTouchEventEnabled(void) const;
51
52         result SetCancelTouchEventOnSuccessEnabled(bool enable);
53         bool IsCancelTouchEventOnSuccessEnabled(void) const;
54
55         result AddGestureEventListener(Tizen::Ui::ITouchGestureEventListener& listener);
56         result RemoveGestureEventListener(Tizen::Ui::ITouchGestureEventListener& listener);
57         Tizen::Base::Collection::IListT <Tizen::Ui::ITouchGestureEventListener*>* GetGestureEventListenerList(void) const;
58
59         result StartOnFailureOf(const TouchGestureDetector& gesture);
60
61         Control* GetControl(void) const;
62
63         virtual const TouchGestureDetector& GetPublic(void) const;
64         virtual TouchGestureDetector& GetPublic(void);
65
66         virtual const _TouchGestureDetector& GetCore(void) const;
67         virtual _TouchGestureDetector& GetCore(void);
68
69         static _TouchGestureDetectorImpl* GetInstance(TouchGestureDetector& gestureDetector);
70         static const _TouchGestureDetectorImpl* GetInstance(const TouchGestureDetector& gestureDetector);
71
72         virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
73         virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
74         virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
75         virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo);
76
77 protected:
78         _TouchGestureDetectorImpl(TouchGestureDetector* pPublic, _TouchGestureDetector* pCore);
79
80 private:
81         _TouchEventArg* GetTouchEventArgN(const Control& source, const _TouchInfo& touchInfo);
82
83         _TouchGestureDetectorImpl(const _TouchGestureDetectorImpl&);
84         _TouchGestureDetectorImpl& operator =(const _TouchGestureDetectorImpl&);
85
86 private:
87         TouchGestureDetector* __pPublicGestureDetector;
88         _TouchGestureDetector* __pCoreGestureDetector;
89
90         Tizen::Base::Collection::IListT<Tizen::Ui::ITouchGestureEventListener*>* __pPublicGestureEventListenerList;
91 }; // _TouchGestureDetectorImpl
92
93 } } //Tizen::Ui
94
95 #endif //_FUI_INTERNAL_TOUCH_GESTURE_DETECTOR_IMPL_H_