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