Tizen 2.1 base
[sdk/ide/native-sample.git] / samples / native / cpp / Sample / Tizen C++ / UiGestureDetector / UiGestureDetector / project / inc / SampleLongPressGestureDetectorForm.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 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://www.tizenopensource.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 #ifndef _SAMPLE_LONGPRESS_GESTURE_DETECTOR_H_
18 #define _SAMPLE_LONGPRESS_GESTURE_DETECTOR_H_
19
20 #include "FUiITouchLongPressGestureEventListener.h"
21 #include "BaseForm.h"
22
23 class SampleLongPressGestureDetectorForm:
24         public BaseForm,
25         public Osp::Ui::ITouchLongPressGestureEventListener,
26         public Osp::Ui::ITouchEventListener,
27         public Osp::Ui::ITextEventListener
28 {
29 public:
30         SampleLongPressGestureDetectorForm(void);
31         virtual ~SampleLongPressGestureDetectorForm();
32
33         virtual bool Initialize(void);
34
35         virtual result OnInitializing(void);
36         virtual result OnTerminating(void);
37
38         virtual void OnLongPressGestureDetected(Osp::Ui::TouchLongPressGestureDetector& gestureDetector);
39         virtual void OnLongPressGestureCanceled(Osp::Ui::TouchLongPressGestureDetector& gestureDetector);
40
41         virtual void OnTextValueChanged(const Osp::Ui::Control& source);
42         virtual void OnTextValueChangeCanceled(const Osp::Ui::Control& source);
43
44         virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
45         virtual result OnDraw(void);
46
47         virtual void  OnTouchFocusIn (const Osp::Ui::Control &source, const Osp::Graphics::Point &currentPosition, const Osp::Ui::TouchEventInfo &touchInfo);
48         virtual void  OnTouchFocusOut (const Osp::Ui::Control &source, const Osp::Graphics::Point &currentPosition, const Osp::Ui::TouchEventInfo &touchInfo);
49         virtual void  OnTouchMoved (const Osp::Ui::Control &source, const Osp::Graphics::Point &currentPosition, const Osp::Ui::TouchEventInfo &touchInfo);
50         virtual void  OnTouchPressed (const Osp::Ui::Control &source, const Osp::Graphics::Point &currentPosition, const Osp::Ui::TouchEventInfo &touchInfo);
51         virtual void  OnTouchReleased (const Osp::Ui::Control &source, const Osp::Graphics::Point &currentPosition, const Osp::Ui::TouchEventInfo &touchInfo);
52
53 private:
54         static const int ID_BUTTON_CLEAR = 101;
55         Osp::Ui::Controls::Label* __pDurationLabel;
56         Osp::Ui::Controls::Label* __pFingerCountLabel;
57         Osp::Ui::Controls::EditField* __pDuration;
58         Osp::Ui::Controls::EditField* __pFingerCount;
59         Osp::Ui::Controls::Label* __pTouchArea;
60         Osp::Ui::Controls::Label* __pTouchResult;
61         Osp::Ui::Controls::Button* __pClearButton;
62         Osp::Ui::TouchLongPressGestureDetector* __pLongPressGesture;
63         int __previousDuration;
64         int __previousTouchCount;
65         Osp::Graphics::Canvas*  __pCanvas;
66 };
67
68 #endif /* _SAMPLE_LONGPRESS_GESTURE_DETECTOR_H_ */