2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FWebCtrl_Web.h
20 * @brief The file contains the declaration of _Web class.
22 * The file contains the declaration of _Web class.
24 #ifndef _FWEB_CTRL_INTERNAL_WEB_H_
25 #define _FWEB_CTRL_INTERNAL_WEB_H_
27 #include <unique_ptr.h>
29 #include <FBaseColIListT.h>
30 #include <FUi_Control.h>
31 #include <FUi_ITouchFlickGestureEventListener.h>
32 #include <FUi_ITouchLongPressGestureEventListener.h>
33 #include <FUi_ITouchTapGestureEventListener.h>
35 namespace Tizen { namespace Ui
40 namespace Tizen { namespace Ui { namespace Animations
43 }}} // Tizen::Ui::Animations
45 namespace Tizen { namespace Graphics
52 namespace Tizen { namespace Web { namespace Controls
55 class _WebSettingImpl;
56 class _TapGestureState;
57 class _DoubleTapGestureState;
58 class _PanningGestureState;
59 class _FlickGestureState;
60 class _PinchGestureState;
65 WEB_GESTURE_TYPE_DOUBLE_TAP,
66 WEB_GESTURE_TYPE_PANNING,
67 WEB_GESTURE_TYPE_FLICK,
68 WEB_GESTURE_TYPE_PINCH
72 : public Tizen::Ui::_Control
73 , Tizen::Ui::_ITouchFlickGestureEventListener
74 , Tizen::Ui::_ITouchLongPressGestureEventListener
75 , Tizen::Ui::_ITouchTapGestureEventListener
76 , virtual public Tizen::Base::Runtime::IEventListener
77 , virtual public Tizen::Ui::_IUiEventListener
78 , virtual public Tizen::Ui::_IUiEventPreviewer
79 , virtual public Tizen::Ui::_ITouchGestureEventListener
86 static _Web* CreateWebN(void);
88 result InitializeWebNativeNode(void);
90 Evas_Object* GetWebNativeNode(void);
92 void ChangeGesture(_WebGestureType type);
94 Tizen::Graphics::Point GetAbsoluteCoordinate(Tizen::Graphics::Point relativePoint);
96 Tizen::Graphics::Point GetRelativeCoordinate(Tizen::Graphics::Point absolutePoint);
98 void SetWebSettingImpl(Tizen::Web::Controls::_WebSettingImpl* pWebSettingImpl);
100 _WebSettingImpl* GetWebSettingImpl(void) const;
102 virtual result OnAttaching(const _Control* pParent);
104 virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
106 virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo);
108 virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo);
110 virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo);
112 virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo);
114 virtual bool OnFlickGestureDetected(Tizen::Ui::_TouchFlickGestureDetector& gesture);
116 virtual bool OnFlickGestureCanceled(Tizen::Ui::_TouchFlickGestureDetector& gesture);
118 virtual bool OnLongPressGestureDetected(Tizen::Ui::_TouchLongPressGestureDetector& gesture);
120 virtual bool OnLongPressGestureCanceled(Tizen::Ui::_TouchLongPressGestureDetector& gesture);
122 virtual bool OnTapGestureDetected(Tizen::Ui::_TouchTapGestureDetector& gesture);
124 virtual bool OnTapGestureCanceled(Tizen::Ui::_TouchTapGestureDetector& gesture);
126 virtual Tizen::Graphics::Canvas* OnCanvasRequestedN(const Tizen::Graphics::Dimension& size);
128 virtual Tizen::Graphics::Bitmap* OnCapturedBitmapRequestedN(void);
131 _Web(const _Web& value);
133 _Web& operator =(const _Web& value);
135 result CreateWebkitEvasObject(void);
137 result InitializeGestureStates(void);
138 result AddGestureListeners(void);
139 void RemoveGestureListener(void);
141 void SendTouchEventForJavaScript(const Tizen::Ui::_TouchInfo& touchInfo);
142 void SendTouchEventForJavaScriptWithTouchInfo(const Tizen::Ui::_TouchInfo& touchInfo);
144 Ewk_Touch_Event_Type GetEwkTouchEvent(Tizen::Ui::_TouchStatus touchStatus);
145 Evas_Touch_Point_State GetEvasTouchState(Tizen::Ui::TouchStatus touchStatus);
147 void DumpPointList(void* pData);
150 Tizen::Ui::_ITouchEventListener* __pGestureHandler;
152 Tizen::Web::Controls::_WebSettingImpl* __pWebSettingImpl;
154 std::unique_ptr<_EflWebkit> __pEflWebkit;
156 std::unique_ptr<Tizen::Ui::_TouchFlickGestureDetector> __pGestureFlick;
158 std::unique_ptr<Tizen::Ui::_TouchLongPressGestureDetector> __pGestureLongPress;
160 std::unique_ptr<Tizen::Ui::_TouchTapGestureDetector> __pGestureDoubleTap;
162 std::unique_ptr<Tizen::Base::Collection::IListT<Tizen::Ui::_TouchInfo*> > __pTouchEventInfoList;
164 std::unique_ptr<_TapGestureState> __pTapGestureHandler;
166 std::unique_ptr<_DoubleTapGestureState> __pDoubleTapGestureHandler;
168 std::unique_ptr<_PanningGestureState> __pPanningGestureHandler;
170 std::unique_ptr<_FlickGestureState> __pFlickGestureHandler;
172 std::unique_ptr<_PinchGestureState> __pPinchGestureHandler;
175 }}} // Tizen::Web::Controls
176 #endif // _FWEB_CTRL_INTERNAL_WEB_H_