Init Tizen 2.2.1
[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. @n
49          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
50          *
51          * @since               2.0
52          */
53         virtual ~IWebUiEventListener(void) {}
54
55         /**
56          * Called when the layout of a page is updated. @n
57          * The application must call Tizen::Ui::Control::Show() if the screen needs to be updated.
58          *
59          * @since               2.0
60          *
61          * @param[in]   source          The source of the event
62          */
63         virtual void OnWebPageShowRequested(Tizen::Web::Controls::Web& source) = 0;
64
65
66         /**
67          * Called when a request for creating a new window is received. @n
68          * The returned %Web control instance must be constructed by using a child window's Construct() method.
69          *
70          * @since               2.0
71          *
72          * @return              A pointer to the new WebWindow instance
73          */
74         virtual Tizen::Web::Controls::Web* OnWebWindowCreateRequested(void) = 0;
75
76
77         /**
78          * Called when a request for closing the window is received. @n
79          * This event is called from the parent window's listener that invoked the child window. @n
80          * The application must free the resource allocated for the Web Control.
81          *
82          * @since                2.0
83          *
84          * @param[in]   source          The source of the closing event
85          */
86         virtual void OnWebWindowCloseRequested(Tizen::Web::Controls::Web& source) = 0;
87
88         /**
89          * Called when the selected block of a page is updated.
90          *
91          * @since               2.0
92          *
93          * @param[in]   source                  The source of the event
94          * @param[in]   startPoint              The starting point of the selected block
95          * @param[in]   endPoint                The ending point of the selected block
96          */
97         virtual void OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graphics::Point& startPoint, Tizen::Graphics::Point& endPoint) = 0;
98
99         /**
100          * Called just after the touch move event to determine whether the preventDefault() method is triggered or not. @n
101          * The application that wants to support the W3C preventDefault() feature is recommended to use this callback and delay the handling of the touch move event until this callback is received.
102          *
103          * @since               2.1
104          *
105          * @param[in]   source          The source of the event
106          * @param[in]   trigger         Set to @c true if the preventDefault() method is triggered, @n
107          *                                                  else @c false
108          * @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.
109          */
110         virtual void OnWebPreventDefaultTriggered(Tizen::Web::Controls::Web& source, bool trigger) {};
111
112 protected:
113         //
114         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
115         //
116         // Gets the Impl instance.
117         //
118         // @since               2.0
119         //
120         virtual void IWebUiEventListener_Reserved1(void) {};
121
122         //
123         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
124         //
125         // Gets the Impl instance.
126         //
127         // @since               2.0
128         //
129         virtual void IWebUiEventListener_Reserved2(void) {};
130
131         //
132         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
133         //
134         // Gets the Impl instance.
135         //
136         // @since               2.0
137         //
138         virtual void IWebUiEventListener_Reserved3(void) {};
139
140         //
141         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
142         //
143         // Gets the Impl instance.
144         //
145         // @since               2.0
146         //
147         virtual void IWebUiEventListener_Reserved4(void) {};
148 }; // IWebUiEventListener
149
150 }}} // Tizen::Web::Controls
151 #endif // _FWEB_CTRL_IWEB_UI_EVENT_LISTENER_H_