modify doxygen
[framework/osp/web.git] / inc / FWebCtrlWeb.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                FWebCtrlWeb.h
20  * @brief       This is the header file for the %Web class.
21  *
22  * This header file contains the declarations of the %Web class.
23  */
24 #ifndef _FWEB_CTRL_WEB_H_
25 #define _FWEB_CTRL_WEB_H_
26
27 #include <FBaseBuffer.h>
28 #include <FBaseResult.h>
29 #include <FBaseString.h>
30 #include <FUiContainer.h>
31
32 namespace Tizen { namespace Graphics
33 {
34 class Dimension;
35 class Point;
36 class Rectangle;
37 }} // Tizen::Graphics
38
39 namespace Tizen { namespace Net { namespace Http
40 {
41 class HttpHeader;
42 }}} // Tizen::Net::Http
43
44 namespace Tizen { namespace Web { namespace Controls
45 {
46 class IJavaScriptBridge;
47 class ILoadingListener;
48 class ITextSearchListener;
49 class IWebDownloadListener;
50 class IWebKeypadEventListener;
51 class IWebUiEventListener;
52 class IWebUiEventListenerF;
53 class IWebUiListener;
54 class HitElementResult;
55 class PageNavigationList;
56 class WebSetting;
57 class _WebImpl;
58 }}} // Tizen::Web::Controls
59
60 namespace Tizen { namespace Web { namespace Controls
61 {
62
63 /**
64  * @class               Web
65  * @brief               This class provides methods for embedding a browser in an application.
66  *
67  * @since               2.0
68  *
69  * The %Web class provides methods for embedding a browser in an application to load and render various types of %Web content. Similar to adding UI controls, the %Web content can be added to the application by adding a %Web control.
70  * @n
71  * For more information on the class features and %Web browser feature limitations, see <a href="../org.tizen.native.appprogramming/html/guide/web/controls_namespace.htm">Web Controls Guide</a> and <a href="../org.tizen.native.appprogramming/html/guide/web/supported_web_features.htm">Supported Features in the Web Control</a>.
72  *
73  * The following example demonstrates how to use the %Web class.
74  *      @code
75 // Sample code using Form for WebSample.h
76 #include <FUi.h>
77 #include <FWeb.h>
78
79 class WebSample :
80     public Tizen::Ui::Controls::Form
81 {
82 public:
83     WebSample(void) {};
84     virtual ~WebSample(void) {};
85
86 protected:
87     void LoadUrl(void);
88
89 private:
90     Tizen::Web::Controls::Web *__pWeb;
91
92 public:
93     virtual result OnInitializing(void);
94 };
95
96 // Sample code using Form for WebSample.cpp
97 #include "WebSample.h"
98
99 using namespace Tizen::Ui;
100 using namespace Tizen::Ui::Controls;
101 using namespace Tizen::Web::Controls;
102
103 result
104 WebSample::OnInitializing(void)
105 {
106     result r = E_SUCCESS;
107
108     // Constucts a Form
109     ...
110
111     __pWeb = new Web();
112     __pWeb->Construct(GetClientAreaBounds());
113     AddControl(__pWeb);
114
115     LoadUrl();
116
117     return r;
118 }
119
120 // Calls LoadUrl() with the URL of the Web content to display it on the Web control
121 void
122 WebSample::LoadUrl(void)
123 {
124     Tizen::Base::String url(L"http://www.tizen.org/about/");
125
126     __pWeb->LoadUrl(url);
127 }
128  *      @endcode
129  *
130  *      @code
131 // Sample code using Window for WebSample.h
132 #include <FApp.h>
133 #include <FUi.h>
134 #include <FWeb.h>
135
136 class WebSample :
137     public Tizen::Ui::Window
138 {
139 public:
140     WebSample(void) {};
141     virtual ~WebSample(void) {};
142
143 protected:
144     void LoadUrl(void);
145
146 private:
147     Tizen::Web::Controls::Web *__pWeb;
148
149 public:
150     virtual result OnInitializing(void);
151 };
152
153 // Sample code using Window for WebSample.cpp
154 #include "WebSample.h"
155
156 using namespace Tizen::App;
157 using namespace Tizen::Ui;
158 using namespace Tizen::Ui::Controls;
159 using namespace Tizen::Web::Controls;
160
161 result
162 WebSample::OnInitializing(void)
163 {
164     result r = E_SUCCESS;
165
166     // Constucts a Window
167     ...
168
169     Frame *pFrame = UiApp::GetInstance()->GetAppFrame()->GetFrame();
170     SetOwner(pFrame->GetCurrentForm());
171
172     __pWeb = new Web();
173     __pWeb->Construct(GetClientAreaBounds());
174     AddControl(__pWeb);
175
176     Show();
177     LoadUrl();
178
179     return r;
180 }
181
182 // Calls LoadUrl() with the URL of the Web content to display it on the Web control
183 void
184 WebSample::LoadUrl(void)
185 {
186     Tizen::Base::String url(L"http://www.tizen.org/about/");
187
188     __pWeb->LoadUrl(url);
189 }
190  *      @endcode
191  */
192 class _OSP_EXPORT_ Web
193         : public Tizen::Ui::Container
194 {
195 public:
196         /**
197          * The object is not fully constructed after this constructor is called.  @n
198          * For full construction, the Construct() method must be called right after calling this constructor.
199          *
200          * @since               2.0
201          */
202         Web(void);
203
204         /**
205          * This destructor overrides Tizen::Base::Object::~Object().
206          *
207          * @since               2.0
208          */
209         virtual ~Web(void);
210
211         /**
212          * Initializes this instance of the %Web control with the specified parameters.
213          *
214          * @since               2.0
215          * @privlevel   public
216          * @privilege   %http://tizen.org/privilege/web.service
217          *
218          * @return              An error code
219          * @param[in]   rect                    The rectangle size of the control
220          * @exception   E_SUCCESS                       The method is successful.
221          * @exception   E_SYSTEM                        The method has failed.
222          * @exception   E_INVALID_ARG           The specified @c rect is invalid.
223          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
224          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
225          */
226         result Construct(const Tizen::Graphics::Rectangle& rect);
227
228         /**
229          * Initializes this instance of the %Web control with the specified parameters.
230          *
231          * @since               2.1
232          * @privlevel   public
233          * @privilege   %http://tizen.org/privilege/web.service
234          *
235          * @return              An error code
236          * @param[in]   rect                    The rectangle size of the control
237          * @exception   E_SUCCESS                       The method is successful.
238          * @exception   E_SYSTEM                        The method has failed.
239          * @exception   E_INVALID_ARG           The specified @c rect is invalid.
240          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
241          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method.
242          */
243         result Construct(const Tizen::Graphics::FloatRectangle& rect);
244
245         /**
246          * Loads the resource specified by the URL.
247          *
248          * @since               2.0
249          * @privlevel   public
250          * @privilege   %http://tizen.org/privilege/web.service
251          *
252          * @param[in]   url                             The resource to load
253          * @exception   E_SUCCESS                       The method is successful.
254          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
255          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
256          * @remarks             The specific error code can be accessed using the GetLastResult() method.
257          */
258         void LoadUrl(const Tizen::Base::String& url);
259
260         /**
261          * Loads the resource specified by the URL with a given header of HTTP request.
262          *
263          * @since               2.0
264          * @privlevel   public
265          * @privilege   %http://tizen.org/privilege/web.service
266          *
267          * @return              An error code
268          * @param[in]   url                             The resource to load
269          * @param[in]   header                  The header of the HTTP request
270          * @exception   E_SUCCESS                       The method is successful.
271          * @exception   E_INVALID_HEADER        The header object does not contain any header fields.
272          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
273          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
274          */
275         result LoadUrl(const Tizen::Base::String& url, const Tizen::Net::Http::HttpHeader& header);
276
277         /**
278          * Loads the resource specified by the URL with a given header and body of HTTP request. @n
279          * The header must include content-type entity-header field that is needed to check mime-type of the message body.
280          *
281          * @since               2.0
282          * @privlevel   public
283          * @privilege   %http://tizen.org/privilege/web.service
284          *
285          * @return              An error code
286          * @param[in]   url                             The resource to load
287          * @param[in]   header                  The header of the HTTP request
288          * @param[in]   body                    The message body of the HTTP request
289          * @exception   E_SUCCESS                       The method is successful.
290          * @exception   E_INVALID_HEADER        The header object does not contain any header fields.
291          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
292          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
293          */
294         result LoadUrlWithPostRequest(const Tizen::Base::String& url, const Tizen::Net::Http::HttpHeader& header, const Tizen::Base::ByteBuffer& body);
295
296         /**
297          * Loads the content of the specified buffer.
298          *
299          * @since               2.0
300          * @privlevel   public
301          * @privilege   %http://tizen.org/privilege/web.service
302          *
303          * @param[in]   baseUrl                 The uniform resource locator (URL) of the content
304          * @param[in]   content                 The content
305          * @param[in]   mime                    The MIME type of the content
306          * @param[in]   encoding                The <a href= "../org.tizen.native.appprogramming/html/guide/web/supported_web_features.htm">text encoding</a> of the content
307          * @exception   E_SUCCESS                       The method is successful.
308          * @exception   E_INVALID_ARG           The content buffer is empty. @b Since: @b 2.1
309          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
310          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
311          * @remarks             The specific error code can be accessed using the GetLastResult() method.
312          */
313         void LoadData(const Tizen::Base::String& baseUrl, const Tizen::Base::ByteBuffer& content, const Tizen::Base::String& mime, const Tizen::Base::String& encoding = "UTF-8");
314
315         /**
316          * Stops the current loading operation.
317          *
318          * @since               2.0
319          * @privlevel   public
320          * @privilege   %http://tizen.org/privilege/web.service
321          *
322          * @exception   E_SUCCESS                       The method is successful.
323          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
324          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
325          * @remarks             The specific error code can be accessed using the GetLastResult() method.
326          */
327         void StopLoading(void);
328
329         /**
330          * Reloads the current page.
331          *
332          * @since               2.0
333          * @privlevel   public
334          * @privilege   %http://tizen.org/privilege/web.service
335          *
336          * @exception   E_SUCCESS                       The method is successful.
337          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
338          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
339          * @remarks             The specific error code can be accessed using the GetLastResult() method.
340          */
341         void Reload(void);
342
343         /**
344          * Checks whether the page is loading.
345          *
346          * @since               2.0
347          *
348          * @return              @c true if a page is loading, @n
349          *                                      else @c false
350          */
351         bool IsLoading(void) const;
352
353         /**
354          * Checks whether the current %Web control has a back history item.
355          *
356          * @since               2.0
357          *
358          * @return              @c true if a back history item exists, @n
359          *                                      else @c false
360          */
361         bool CanGoBack(void) const;
362
363         /**
364          * Checks whether the current %Web control has a forward history item.
365          *
366          * @since               2.0
367          *
368          * @return              @c true if a forward history item exists, @n
369          *                                      else @c false
370          */
371         bool CanGoForward(void) const;
372
373         /**
374          * Goes to the back history of the current %Web control.
375          *
376          * @since               2.0
377          * @privlevel   public
378          * @privilege   %http://tizen.org/privilege/web.service
379          *
380          * @exception   E_SUCCESS                       The method is successful.
381          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
382          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
383          * @remarks             The specific error code can be accessed using the GetLastResult() method.
384          */
385         void GoBack(void);
386
387         /**
388          * Goes to the forward history of the current %Web control.
389          *
390          * @since               2.0
391          * @privlevel   public
392          * @privilege   %http://tizen.org/privilege/web.service
393          *
394          * @exception   E_SUCCESS                       The method is successful.
395          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
396          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
397          * @remarks             The specific error code can be accessed using the GetLastResult() method.
398          */
399         void GoForward(void);
400
401         /**
402          * Gets the backward and forward navigation list of the %Web control.
403          *
404          * @since               2.0
405          *
406          * @return              A pointer to PageNavigationList containing the history items of the %Web control
407          * @exception   E_SUCCESS                       The method is successful.
408          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
409          * @remarks             The specific error code can be accessed using the GetLastResult() method.
410          */
411         Tizen::Web::Controls::PageNavigationList* GetBackForwardListN(void) const;
412
413         /**
414          * Searches for a word on the current page. @n
415          * When called again, it searches for the next instance of the word on the page. Set @c searchForward to @c false to search for the word in the backward
416          * direction.
417          *
418          * @since               2.0
419          *
420          * @return              @c true if the specified @c word is found, @n
421          *                                      else @c false
422          * @param[in]   word                    The string to search for
423          * @param[in]   searchForward   Set to @c true to search for the word in the forward direction from the current position, @n
424          *                                                                      else @c false to search for the word in the backward direction from the current position
425          */
426         bool SearchText(const Tizen::Base::String& word, bool searchForward = true);
427
428         /**
429          * Sets the new values for the default setting. @n
430          * It fails to change the setting during data load.
431          *
432          * @since               2.0
433          * @privlevel   public
434          * @privilege   %http://tizen.org/privilege/web.service
435          *
436          * @return              An error code
437          * @param[in]   setting                 The setting to update
438          * @exception   E_SUCCESS                       The method is successful.
439          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
440          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
441          */
442         result SetSetting(const Tizen::Web::Controls::WebSetting& setting);
443
444         /**
445          * Gets the setting of the %Web control.
446          *
447          * @since               2.0
448          *
449          * @return              An instance of WebSetting
450          */
451         Tizen::Web::Controls::WebSetting GetSetting(void) const;
452
453
454         /**
455          * Gets the information of the element pointed by the specified coordinates.
456          *
457          * @since               2.0
458          *
459          * @return              A HitElementResult of the pointed element
460          * @param[in]   point                   The x and y coordinates
461          * @exception   E_SUCCESS                       The method is successful.
462          * @exception   E_INVALID_ARG           The specified @c point is invalid.
463          * @exception   E_UNSUPPORTED_FORMAT    The image format is not supported.
464          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
465          * @remarks             The specific error code can be accessed using the GetLastResult() method.
466          */
467         Tizen::Web::Controls::HitElementResult* GetElementByPointN(const Tizen::Graphics::Point& point) const;
468
469         /**
470          * Gets the information of the element pointed by the specified coordinates.
471          *
472          * @since               2.1
473          *
474          * @return              A HitElementResult of the pointed element
475          * @param[in]   point                   The x and y coordinates
476          * @exception   E_SUCCESS                       The method is successful.
477          * @exception   E_INVALID_ARG           The specified @c point is invalid.
478          * @exception   E_UNSUPPORTED_FORMAT    The image format is not supported.
479          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
480          * @remarks             The specific error code can be accessed using the GetLastResult() method.
481          */
482         Tizen::Web::Controls::HitElementResult* GetElementByPointN(const Tizen::Graphics::FloatPoint& point) const;
483
484         /**
485          * Evaluates the JavaScript string and returns the result.
486          *
487          * @since               2.0
488          * @privlevel   public
489          * @privilege   %http://tizen.org/privilege/web.service
490          *
491          * @return              The result of the evaluated JavaScript, @n
492          *                                      else @c null if an error occurs
493          * @param[in]   scriptCode              The JavaScript code as string
494          * @exception   E_SUCCESS                       The method is successful.
495          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
496          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
497          * @remarks             The specific error code can be accessed using the GetLastResult() method.
498          */
499         Tizen::Base::String* EvaluateJavascriptN(const Tizen::Base::String& scriptCode);
500
501         /**
502          * Sets the zoom-out level as a ratio.
503          *
504          * @since               2.0
505          *
506          * @return              An error code
507          * @param[in]   level                   The zoom-out level @n
508          *                                                              The value ranges between @c 0.3 and @c 2.0. When the page view is at its original size, the level is @c 1.0. @n If the
509          *                                                              specified level is less than @c 1.0, the page view is reduced. @n If the specified level is greater than @c 1.0, the page view is
510          *                                                              magnified.
511          * @exception   E_SUCCESS                       The method is successful.
512          * @exception   E_OUT_OF_RANGE          The specified @c level is less than @c 0.3 or greater than @c 2.0.
513          */
514         result SetZoomLevel(float level);
515
516         /**
517          * Gets the zoom level of a page as a percentage.
518          *
519          * @since               2.0
520          *
521          * @return              The value ranges between @c 0.3 and @c 2.0
522          */
523         float GetZoomLevel(void) const;
524
525         /**
526          * Gets the title of the current page.
527          *
528          * @since               2.0
529          *
530          * @return              The title of the current page
531          */
532         Tizen::Base::String GetTitle(void) const;
533
534         /**
535          * Gets the URL of the current page.
536          *
537          * @since               2.0
538          *
539          * @return              The URL of the current page
540          */
541         Tizen::Base::String GetUrl(void) const;
542
543         /**
544          * Checks whether the specified multipurpose internet mail extensions (MIME) type is supported by %Tizen.
545          *
546          * @since               2.0
547          *
548          * @return              @c true if the specified MIME type is supported, @n
549          *                                      else @c false
550          * @param[in]   mime                    The MIME type
551          */
552         bool IsMimeSupported(const Tizen::Base::String& mime) const;
553
554         /**
555          * Sets a load event listener.
556          *
557          * @since               2.0
558          * @privlevel   public
559          * @privilege   %http://tizen.org/privilege/web.service
560          *
561          * @param[in]   pLoadingListener        The listener receives the events that occurs while loading the data
562          * @exception   E_SUCCESS                       The method is successful.
563          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
564          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
565          * @remarks             The specific error code can be accessed using the GetLastResult() method.
566          */
567         void SetLoadingListener(Tizen::Web::Controls::ILoadingListener* pLoadingListener);
568
569         /**
570          * Sets a download event listener.
571          *
572          * @since               2.0
573          * @privlevel   public
574          * @privilege   %http://tizen.org/privilege/web.service
575          *
576          * @param[in]   pDownLoadListener       The listener to receive the data from a network incrementally
577          * @exception   E_SUCCESS                       The method is successful.
578          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
579          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
580          * @remarks             The specific error code can be accessed using the GetLastResult() method.
581          */
582         void SetDownloadListener(Tizen::Web::Controls::IWebDownloadListener* pDownLoadListener);
583
584         /**
585          * Sets the starting point for the text selection block. @n
586          * It sets the selection block around the nearest word bound.
587          *
588          * @since               2.0
589          *
590          * @return              An error code
591          * @param[in]   startPoint              The starting point for the text selection block
592          * @exception   E_SUCCESS                       The method is successful.
593          * @exception   E_INVALID_ARG           There is nothing to select from the specified starting point.
594          */
595         result SetBlockSelectionPosition(const Tizen::Graphics::Point& startPoint);
596
597         /**
598          * Sets the starting point for the text selection block. @n
599          * It sets the selection block around the nearest word bound.
600          *
601          * @since               2.1
602          *
603          * @return              An error code
604          * @param[in]   startPoint              The starting point for the text selection block
605          * @exception   E_SUCCESS                       The method is successful.
606          * @exception   E_INVALID_ARG           There is nothing to select from the specified starting point.
607          */
608         result SetBlockSelectionPosition(const Tizen::Graphics::FloatPoint& startPoint);
609
610         /**
611          * Releases the currently selected block.
612          *
613          * @since               2.0
614          *
615          * @return              An error code
616          * @exception   E_SUCCESS                       The method is successful.
617          *
618          */
619         result ReleaseBlock(void);
620
621         /**
622          * Gets the starting point and the ending point of the selected text block. @n
623          * When the %GetBlockRange() method is called without the selection block, the @c startPoint and @c endPoint have (0,0) values for the x and y coordinates.
624          *
625          * @since               2.0
626          *
627          * @return              An error code
628          * @param[out]  startPoint              The starting point of the selected text block
629          * @param[out]  endPoint                The ending point of the selected text block
630          * @exception   E_SUCCESS                       The method is successful.
631          */
632         result GetBlockRange(Tizen::Graphics::Point& startPoint, Tizen::Graphics::Point& endPoint) const;
633
634         /**
635          * Gets the starting point and the ending point of the selected text block. @n
636          * When this method is called without the selection block, the startPoint and endPoint have (0.0,0.0) values for the x and y coordinates.
637          *
638          * @since               2.1
639          *
640          * @return              An error code
641          * @param[out]  startPoint              The starting point of the selected text block
642          * @param[out]  endPoint                The ending point of the selected text block
643          * @exception   E_SUCCESS                       The method is successful.
644          */
645         result GetBlockRange(Tizen::Graphics::FloatPoint& startPoint, Tizen::Graphics::FloatPoint& endPoint) const;
646
647
648         /**
649          * Gets the text of the selected text block.
650          *
651          * @since               2.0
652          *
653          * @return              The selected text, @n
654          *                                      else an empty string if there is no selection block
655          */
656         Tizen::Base::String GetTextFromBlock(void) const;
657
658         /**
659          * Enables or disables the vertical and horizontal scrolls.
660          *
661          * @since               2.0
662          *
663          * @param[in]   enable                  Set to @c true to enable the scrolling of the web page, @n
664          *                                                                      else @c false
665          * @exception   E_SUCCESS                       The method is successful.
666          * @remarks             This method does not affect javascript touch event.
667          */
668         result SetScrollEnabled(bool enable);
669
670
671         /**
672          * Checks whether the web page scroll is enabled.
673          *
674          * @since               2.0
675          *
676          * @return              @c true if the web page scroll is enabled, @n
677          *                                      else @c false
678          */
679         bool IsScrollEnabled(void) const;
680
681         /**
682          * Registers a user interface (UI) event listener.
683          *
684          * @since               2.0
685          *
686          * @param[in]   pUiEventListener        The listener to receive the user interface (UI) related events
687          */
688         void SetWebUiEventListener(Tizen::Web::Controls::IWebUiEventListener* pUiEventListener);
689
690         /**
691          * Registers a user interface (UI) event listener.
692          *
693          * @since               2.1
694          *
695          * @param[in]   pUiEventListener        The listener to receive the user interface (UI) related events
696          */
697         void SetWebUiEventListenerF(Tizen::Web::Controls::IWebUiEventListenerF* pUiEventListener);
698
699         /**
700          * Checks whether the %Web control uses private browsing.
701          *
702          * @since               2.0
703          *
704          * @return              @c true if private browsing is enabled, @n
705          *                      else @c false
706          */
707         bool IsPrivateBrowsingEnabled(void) const;
708
709         /**
710          * Sets the private browsing and returns the result.
711          *
712          * @since               2.0
713          * @privlevel   public
714          * @privilege   %http://tizen.org/privilege/web.service
715          *
716          * @return              The result of setting the private browsing
717          * @param[in]   enable                  Set to @c true to enable private browsing, @n
718          *                                                                      else @c false
719          * @exception   E_SUCCESS                       The method is successful.
720          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
721          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
722          */
723         result SetPrivateBrowsingEnabled(bool enable);
724
725         /**
726          * Clears the back and forward navigation list.
727          *
728          * @since               2.1
729          * @privlevel   public
730          * @privilege   %http://tizen.org/privilege/web.service
731          *
732          * @return              An error code
733          * @exception   E_SUCCESS                       The method is successful.
734          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
735          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method.
736          * @see CanGoBack()
737          * @see CanGoForward()
738          * @see GoBack()
739          * @see GoForward()
740          */
741         result ClearHistory(void);
742
743         /**
744          * Clears the application's cache.
745          *
746          * @since               2.0
747          * @privlevel   public
748          * @privilege   %http://tizen.org/privilege/web.service
749          *
750          * @return              An error code
751          * @exception   E_SUCCESS                       The method is successful.
752          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
753          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
754          */
755         result ClearCache(void);
756
757         /**
758          * Clears the application's cookie.
759          *
760          * @since               2.0
761          * @privlevel   public
762          * @privilege   %http://tizen.org/privilege/web.service
763          *
764          * @return              An error code
765          * @exception   E_SUCCESS                       The method is successful.
766          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
767          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
768          */
769         result ClearCookie(void);
770
771         /**
772          * Clears the application's all stored form datas.
773          *
774          * @since               2.1
775          * @privlevel   public
776          * @privilege   %http://tizen.org/privilege/web.service
777          *
778          * @return              An error code
779          * @exception   E_SUCCESS                       The method is successful.
780          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
781          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method.
782          */
783         result ClearFormData(void);
784
785         /**
786          * Clears the application's all stored ID/password datas.
787          *
788          * @since               2.1
789          * @privlevel   public
790          * @privilege   %http://tizen.org/privilege/web.service
791          *
792          * @return              An error code
793          * @exception   E_SUCCESS                       The method is successful.
794          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
795          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method.
796         */
797         result ClearLoginFormData(void);
798
799         /**
800          * Checks whether the %Web control allows cookie. @n
801          * Returns @c true if cookie is enabled.
802          *
803          * @since               2.0
804          *
805          * @return              @c true if cookie is allowed, @n
806          *                                      else @c false
807          */
808         bool IsCookieEnabled(void) const;
809
810         /**
811          * Enables or disables a cookie.
812          *
813          * @since               2.0
814          * @privlevel   public
815          * @privilege   %http://tizen.org/privilege/web.service
816          *
817          * @return              The result of enabling or disabling cookie
818          * @param[in]   enable                  Set to @c true if the web control allows a cookie, @n
819          *                                                                      else @c false
820          * @exception   E_SUCCESS                       The method is successful.
821          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
822          * @exception   E_USER_NOT_CONSENTED    The user blocks an application from calling this method. @b Since: @b 2.1
823          */
824         result SetCookieEnabled(bool enable);
825
826         /**
827          * Saves the current web page as a pdf file. @n The size parameter is used to set size of the pdf file using millimeter.
828          *
829          * @since               2.0
830          *
831          * @return              An error code
832          * @param[in]   filePath                The path of the pdf file that is created
833          * @param[in]   pSize                   The width and height of the pdf file in millimeter. The width and height must be greater than @c 0. @n
834          *                                                              If the parameter contains @c null, the method uses the default size of the web page that is shown on the screen.
835          * @exception   E_SUCCESS                       The method is successful.
836          * @exception   E_INVALID_ARG           Either of the following conditions has occurred: @n
837          *                                                                              - The specified path is invalid.
838          *                                                                              - The specified size is invalid.
839          * @exception   E_INACCESSIBLE_PATH     The file path is not allowed for the application to write.
840          */
841         result SavePageAsPdf(const Tizen::Base::String& filePath, const Tizen::Graphics::Dimension* pSize = null);
842
843         /**
844          * Adds a JavaScript bridge instance.
845          *
846          * @since               2.0
847          *
848          * @return              An error code
849          * @param[in]   jsBridge                The JavaScript bridge to add
850          * @exception   E_SUCCESS                       The method is successful.
851          * @exception   E_OBJ_ALREADY_EXIST     A JavaScript bridge with the same name already exists.
852          */
853         result AddJavaScriptBridge(const IJavaScriptBridge& jsBridge);
854
855         /**
856          * Removes a JavaScript bridge instance.
857          *
858          * @since               2.0
859          *
860          * @return              An error code
861          * @param[in]   jsBridge                The JavaScript bridge to remove
862          * @exception   E_SUCCESS                       The method is successful.
863          * @exception   E_OBJ_NOT_FOUND The specified element is not found.
864          */
865         result RemoveJavaScriptBridge(const IJavaScriptBridge& jsBridge);
866
867         /**
868          * Registers a keypad event listener. @n
869          * The registered listener is notified when the keypad associated with <input> tag or with <textarea> tag is opened or closed.
870          *
871          * @since               2.0
872          *
873          * @param[in]   pKeypadEventListener    The event listener to set
874          * @remarks             The interfaces of IWebKeypadEventListener are called only when the input style of the keypad is @c INPUT_STYLE_OVERLAY.
875          * @see WebSetting::SetInputStyle()
876          */
877         void SetWebKeypadEventListener(IWebKeypadEventListener* pKeypadEventListener);
878
879         /**
880          * Searches for all instances of the text on the current page and then highlights them. @n
881          * The current matched block will indicate the first match.
882          *
883          * @since               2.0
884          *
885          * @return              An error code
886          * @param[in]   text                    The string to search for
887          * @param[in]   caseSensitive   Set to @c true to search for the text with case-sensitive mode, @n
888          *                                                              else @c false to search for the text in the backward direction from the current position
889          * @exception   E_SUCCESS                       The method is successful.
890          * @exception   E_INVALID_ARG           The specified @c text is invalid.
891          * @remarks             This method operates asynchronously.
892          * @see Tizen::Web::Controls::ITextSearchListener::OnTextFound()
893          */
894         result SearchTextAllAsync(const Tizen::Base::String& text, bool caseSensitive);
895
896         /**
897          * Scrolls the current matched block to the next text matched by SearchTextAllAsync().
898          *
899          * @since               2.0
900          *
901          * @return              An error code
902          * @param[in]   searchForward   Set to @c true to search for the text in the forward direction from the current position, @n
903          * @exception   E_SUCCESS                       The method is successful.
904          * @exception   E_OBJ_NOT_FOUND         The next instance is not found.
905          * @exception   E_INVALID_OPERATION             The SearchTextAllAsync() method is not called.
906          * @remarks             This method operates asynchronously.
907          * @see Tizen::Web::Controls::ITextSearchListener::OnTextFound()
908          */
909         result SearchNextAsync(bool searchForward = true);
910
911         /**
912          * Sets a text search listener.
913          *
914          * @since               2.0
915          *
916          * @param[in]   pTextSearchListener             The result of the search operation made by asynchronous methods
917          */
918         void SetTextSearchListener(ITextSearchListener* pTextSearchListener);
919
920         /**
921          * Gets the favicon image from current page.
922          *       
923          * @since               2.0
924          *
925          * @return              The image
926          * @see Tizen::Web::Controls::ILoadingListener::OnFaviconReceived()
927          */
928         Tizen::Graphics::Bitmap* GetFaviconN(void) const;
929
930         /**
931          * Informs the browser engine to stop the screen operations such as updating a screen until %Web calls the Resume() method. @n
932          * It is useful when a %Web control is not visible and does not need to update its screen.
933          *
934          * @since               2.0
935          */
936         void    Pause(void);
937
938         /**
939          * Informs the browser engine to resume the handling of screen operations. 
940          *
941          * @since               2.0
942          */
943         void    Resume(void);
944
945         /**
946          * Scrolls the web page with the given coordinates.
947          *
948          * @since               2.1
949          *
950          * @param[in]   diff                    The x and y coordinates
951          */
952         void ScrollBy(const Tizen::Graphics::Point& diff);
953
954         /**
955          * Sets the scrolled position of the web page.
956          *
957          * @since               2.1
958          *
959          * @param[in]   dest                    The x and y coordinates
960          */
961         void ScrollTo(const Tizen::Graphics::Point& dest);
962
963         /**
964          * Gets the current scroll position of the web page.
965          *
966          * @since               2.1
967          *
968          * @return              The x and y coordinates
969          */
970         Tizen::Graphics::Point GetScrollPosition(void) const;
971
972         /**
973          * Gets the size of the current web page.
974          *
975          * @since               2.1
976          *
977          * @return      The size of the current web page
978          * @remarks             If an application want to get the displayed size, the return value should be multiplied by the zoom factor.
979          * @see GetZoomLevel()
980          */
981         Tizen::Graphics::Dimension GetPageSize(void) const;
982
983 private:
984         //
985         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
986         //
987         // @param[in]   item                    The instance of the %Web class to copy from
988         // @remarks             This constructor is hidden.
989         //
990         Web(const Web& item);
991
992         //
993         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
994         //
995         // @param[in]   item                    The instance of the %Web class to assign from
996         // @remarks             This operator is hidden.
997         //
998         Web& operator =(const Web& item);
999 }; // Web
1000
1001 }}} // Tizen::Web::Controls
1002 #endif // _FWEB_CTRL_WEB_H_