Merge "JavaScript support for DALi" into tizen
[platform/core/uifw/dali-toolkit.git] / plugins / dali-script-v8 / src / events / pan-gesture-detector-wrapper.h
1 #ifndef __DALI_V8PLUGIN_PAN_GESTURE_DETECTOR_WRAPPER_H__
2 #define __DALI_V8PLUGIN_PAN_GESTURE_DETECTOR_WRAPPER_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <v8.h>
23 #include <dali/public-api/events/pan-gesture-detector.h>
24
25 // INTERNAL INCLUDES
26 #include <object/handle-wrapper.h>
27
28 namespace Dali
29 {
30
31 namespace V8Plugin
32 {
33
34 /**
35  * Wraps a PanGestureDetector.
36  */
37 class PanGestureDetectorWrapper : public HandleWrapper
38 {
39
40 public:
41
42   /**
43    * Constructor
44    */
45   PanGestureDetectorWrapper( PanGestureDetector panGestureDetector, GarbageCollectorInterface& gc );
46
47   /**
48    * Virtual destructor
49    */
50   virtual ~PanGestureDetectorWrapper(){};
51
52   /**
53    * Creates a new PanGestureDetector wrapped inside a Javascript Object.
54    * @param[in] args v8 function call arguments interpreted
55    */
56   static void NewPanGestureDetector( const v8::FunctionCallbackInfo< v8::Value >& args);
57
58   /**
59    * Wraps a PanGestureDetector inside a Javascript object
60    */
61   static v8::Handle<v8::Object> WrapPanGestureDetector(v8::Isolate* isolate, PanGestureDetector panGestureDetector );
62
63   /*
64    * Get the wrapped PanGestureDetector
65    */
66   PanGestureDetector GetPanGestureDetector();
67
68 private:
69
70   /**
71    * Create a v8 object template for the PanGestureDetector
72    */
73   static v8::Handle<v8::ObjectTemplate> MakePanGestureDetectorTemplate( v8::Isolate* isolate );
74
75   PanGestureDetector mPanGestureDetector;
76 };
77
78 } // namespace V8Plugin
79
80 } // namespace Dali
81
82 #endif // header