add patch
[framework/osp/web.git] / inc / FWebCtrlIWebUiEventListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
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 /**
19  * @file                FWebCtrlIWebUiEventListener.h
20  * @brief               This is the header file for the %IWebUiEventListener interface.
21  *
22  * This header file contains the declarations of the %IWebUiEventListener interface.
23  */
24 #ifndef _FWEB_CTRL_IWEB_UI_EVENT_LISTENER_H_
25 #define _FWEB_CTRL_IWEB_UI_EVENT_LISTENER_H_
26
27 #include <FBaseRtIEventListener.h>
28 #include <FWebCtrlWeb.h>
29 #include <FGrpPoint.h>
30
31 namespace Tizen { namespace Web { namespace Controls
32 {
33
34 /**
35  * @interface   IWebUiEventListener
36  * @brief               This interface is used for receiving user interface (UI) related events caused by the layout changes of a control.
37  *
38  * @since               2.0
39  *
40  * The %IWebUiEventListener interface is used for receiving user interface (UI) related events caused by the layout changes of a control.
41  * The browser engine requests a screen update through this interface when the layout of a page is changed.
42  */
43 class _OSP_EXPORT_ IWebUiEventListener
44         : public virtual Tizen::Base::Runtime::IEventListener
45 {
46 public:
47         /**
48          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
49          *
50          * @since               2.0
51          */
52         virtual ~IWebUiEventListener(void) {}
53
54         /**
55          * Called when the layout of a page is updated. @n
56          * The application must call Tizen::Ui::Control::Show() if the screen needs to be updated.
57          *
58          * @since               2.0
59          *
60          * @param[in]   source          The source of the event
61          */
62         virtual void OnWebPageShowRequested(Tizen::Web::Controls::Web& source) = 0;
63
64
65         /**
66          * Called when a request for creating a new window is received. @n
67          * The returned %Web control instance must be constructed by using a child window's Construct() method.
68          *
69          * @since               2.0
70          *
71          * @return              A pointer to the new WebWindow instance
72          */
73         virtual Tizen::Web::Controls::Web* OnWebWindowCreateRequested(void) = 0;
74
75
76         /**
77          * Called when a request for closing the window is received. @n
78          * This event is called from the parent window's listener that invoked the child window. @n
79          * The application must free the resource allocated for the Web Control.
80          *
81          * @since                2.0
82          *
83          * @param[in]   source          The source of the closing event
84          */
85         virtual void OnWebWindowCloseRequested(Tizen::Web::Controls::Web& source) = 0;
86
87         /**
88          * Called when the selected block of a page is updated.
89          *
90          * @since               2.0
91          *
92          * @param[in]   source          The source of the event
93          * @param[in]   startPoint              The starting point of the selected block
94          * @param[in]   endPoint                The ending point of the selected block
95          */
96         virtual void OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graphics::Point& startPoint, Tizen::Graphics::Point& endPoint) = 0;
97
98         /**
99          * Called just after the touch move event to determine whether the preventDefault() method is triggered or not. @n
100          * The application that wants to support W3C preventDefault() feature is recommended to use this callback and delay to handle the touch move event until this callback is received.
101          *
102          * @since               2.1
103          *
104          * @param[in]   source          The source of the event
105          * @param[in]   trigger         Set to @c true if the preventDefault() method is triggered, @n
106          *                                              else @c false
107          * @remarks                             This callback is always called just after the touch move event and returns @c true when preventDefault() is triggered on the touch start or touch move event.
108          */
109         virtual void OnWebPreventDefaultTriggered(Tizen::Web::Controls::Web& source, bool trigger) {};
110
111 protected:
112         //
113         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
114         //
115         // Gets the Impl instance.
116         //
117         // @since               2.0
118         //
119         virtual void IWebUiEventListener_Reserved1(void) {};
120
121         //
122         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
123         //
124         // Gets the Impl instance.
125         //
126         // @since               2.0
127         //
128         virtual void IWebUiEventListener_Reserved2(void) {};
129
130         //
131         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
132         //
133         // Gets the Impl instance.
134         //
135         // @since               2.0
136         //
137         virtual void IWebUiEventListener_Reserved3(void) {};
138
139         //
140         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
141         //
142         // Gets the Impl instance.
143         //
144         // @since               2.0
145         //
146         virtual void IWebUiEventListener_Reserved4(void) {};
147 }; // IWebUiEventListener
148
149 }}} // Tizen::Web::Controls
150 #endif // _FWEB_CTRL_IWEB_UI_EVENT_LISTENER_H_