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_ITouchPinchGestureEventListener.h>
34 #include <FUi_ITouchTapGestureEventListener.h>
35 #include <FUiAnim_IVisualElementCaptureProvider.h>
37 namespace Tizen { namespace Ui
39 class _AccessibilityElement;
43 namespace Tizen { namespace Ui { namespace Animations
46 }}} // Tizen::Ui::Animations
48 namespace Tizen { namespace Graphics
56 namespace Tizen { namespace Web { namespace Controls
59 class _WebSettingImpl;
60 class _TapGestureState;
61 class _PanningGestureState;
62 class _FlickGestureState;
63 class _PinchGestureState;
69 WEB_GESTURE_TYPE_PANNING,
70 WEB_GESTURE_TYPE_FLICK,
71 WEB_GESTURE_TYPE_PINCH
77 WEB_EDGE_LEFT = 1 << 1,
78 WEB_EDGE_RIGHT = 1 << 2,
79 WEB_EDGE_TOP = 1 << 3,
80 WEB_EDGE_BOTTOM = 1 << 4,
84 : public Tizen::Ui::_Control
85 , public Tizen::Ui::_ITouchFlickGestureEventListener
86 , public Tizen::Ui::_ITouchLongPressGestureEventListener
87 , public Tizen::Ui::_ITouchPinchGestureEventListener
88 , public Tizen::Ui::_ITouchTapGestureEventListener
89 , public Tizen::Ui::Animations::_IVisualElementCaptureProvider
90 , virtual public Tizen::Base::Runtime::IEventListener
91 , virtual public Tizen::Ui::_IUiEventListener
92 , virtual public Tizen::Ui::_IUiEventPreviewer
93 , virtual public Tizen::Ui::_ITouchGestureEventListener
100 static _Web* CreateWebN(void);
102 result InitializeWebNativeNode(void);
104 Evas_Object* GetWebNativeNode(void);
106 void ChangeGesture(_WebGestureType type);
108 Tizen::Graphics::Point GetAbsoluteCoordinate(Tizen::Graphics::Point relativePoint);
109 Tizen::Graphics::FloatPoint GetAbsoluteCoordinate(Tizen::Graphics::FloatPoint relativePoint);
111 Tizen::Graphics::Point GetRelativeCoordinate(Tizen::Graphics::Point absolutePoint);
112 Tizen::Graphics::FloatPoint GetRelativeCoordinate(Tizen::Graphics::FloatPoint absolutePoint);
114 WebSetting* GetSetting(void) const;
116 void SetEdgeReachedEvent(_WebEdgeType type);
118 void SetFullScreenEntered(bool isFullScreenEntered);
120 void SetFocusEnd(bool focus);
121 bool IsFocusEnd(void);
123 virtual result OnAttaching(const _Control* pParent);
124 virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
126 virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo);
127 virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo);
128 virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo);
129 virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo);
131 virtual void OnTouchPressHandled(const Tizen::Ui::_Control& control);
132 virtual void OnTouchReleaseHandled(const Tizen::Ui::_Control& control);
133 virtual void OnTouchMoveHandled(const Tizen::Ui::_Control& control);
134 virtual void OnTouchCancelHandled(const Tizen::Ui::_Control& control);
136 virtual bool OnPinchGestureStarted(Tizen::Ui::_TouchPinchGestureDetector& gesture);
137 virtual bool OnPinchGestureChanged(Tizen::Ui::_TouchPinchGestureDetector& gesture);
138 virtual bool OnPinchGestureFinished(Tizen::Ui::_TouchPinchGestureDetector& gesture);
139 virtual bool OnPinchGestureCanceled(Tizen::Ui::_TouchPinchGestureDetector& gesture);
141 virtual bool OnFlickGestureDetected(Tizen::Ui::_TouchFlickGestureDetector& gesture);
142 virtual bool OnFlickGestureCanceled(Tizen::Ui::_TouchFlickGestureDetector& gesture);
144 virtual bool OnLongPressGestureDetected(Tizen::Ui::_TouchLongPressGestureDetector& gesture);
145 virtual bool OnLongPressGestureCanceled(Tizen::Ui::_TouchLongPressGestureDetector& gesture);
147 virtual bool OnTapGestureDetected(Tizen::Ui::_TouchTapGestureDetector& gesture);
148 virtual bool OnTapGestureCanceled(Tizen::Ui::_TouchTapGestureDetector& gesture);
150 virtual Tizen::Graphics::Canvas* OnCanvasRequestedN(const Tizen::Graphics::FloatRectangle& size);
151 virtual Tizen::Graphics::Bitmap* OnCapturedBitmapRequestedN(void);
152 virtual bool OnCaptureAcquire(Tizen::Graphics::BufferInfo& output);
153 virtual void OnCaptureReleased(void) {};
155 virtual bool OnKeyPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo);
156 virtual bool OnKeyReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo);
157 virtual void OnDrawFocus(void);
160 _Web(const _Web& value);
162 _Web& operator =(const _Web& value);
164 result CreateWebkitEvasObject(void);
166 result InitializeGestureStates(void);
167 result AddGestureListeners(void);
168 void RemoveGestureListener(void);
170 void SendTouchEventForJavaScript(const Tizen::Ui::_TouchInfo& touchInfo);
171 void SendTouchEventForJavaScriptWithTouchInfo(const Tizen::Ui::_TouchInfo& touchInfo);
173 Ewk_Touch_Event_Type GetEwkTouchEvent(Tizen::Ui::_TouchStatus touchStatus);
174 Evas_Touch_Point_State GetEvasTouchState(Tizen::Ui::TouchStatus touchStatus);
177 Tizen::Ui::_ITouchEventListener* __pGestureHandler;
179 std::unique_ptr<_EflWebkit> __pEflWebkit;
181 std::unique_ptr<WebSetting> __pWebSetting;
183 std::unique_ptr<Tizen::Ui::_TouchFlickGestureDetector> __pGestureFlick;
185 std::unique_ptr<Tizen::Ui::_TouchLongPressGestureDetector> __pGestureLongPress;
187 std::unique_ptr<Tizen::Ui::_TouchPinchGestureDetector> __pGesturePinch;
189 std::unique_ptr<Tizen::Ui::_TouchTapGestureDetector> __pGestureDoubleTap;
191 std::unique_ptr<Tizen::Base::Collection::IListT<Tizen::Ui::_TouchInfo*> > __pTouchEventInfoList;
193 std::unique_ptr<_TapGestureState> __pTapGestureHandler;
195 std::unique_ptr<_PanningGestureState> __pPanningGestureHandler;
197 std::unique_ptr<_FlickGestureState> __pFlickGestureHandler;
199 std::unique_ptr<_PinchGestureState> __pPinchGestureHandler;
201 _WebGestureType __gestureType;
207 Tizen::Ui::_AccessibilityElement* __pTextElement;
209 Tizen::Graphics::FloatPoint __previousTouchedPosition;
211 bool __isFullScreenEntered;
214 }}} // Tizen::Web::Controls
215 #endif // _FWEB_CTRL_INTERNAL_WEB_H_