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