Use c-style string when webview loads contents.
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / web-engine / web-engine-plugin.h
1 #ifndef DALI_WEB_ENGINE_PLUGIN_H
2 #define DALI_WEB_ENGINE_PLUGIN_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/images/native-image-interface.h>
23 #include <dali/public-api/math/rect.h>
24 #include <functional>
25 #include <memory>
26
27 // INTERNAL INCLUDES
28 #include <dali/devel-api/adaptor-framework/accessibility.h>
29 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-hit-test.h>
30 #include <dali/devel-api/common/bitwise-enum.h>
31 #include <dali/public-api/adaptor-framework/native-image-source.h>
32
33 namespace Dali
34 {
35 class KeyEvent;
36 class PixelData;
37 class TouchEvent;
38 class WebEngineBackForwardList;
39 class WebEngineCertificate;
40 class WebEngineConsoleMessage;
41 class WebEngineContextMenu;
42 class WebEngineFormRepostDecision;
43 class WebEngineHitTest;
44 class WebEngineHttpAuthHandler;
45 class WebEngineLoadError;
46 class WebEnginePolicyDecision;
47 class WebEngineSettings;
48 class HoverEvent;
49 class WheelEvent;
50
51 /**
52  * @brief WebEnginePlugin is an abstract interface, used by dali-adaptor to access WebEngine plugin.
53  * A concrete implementation must be created for each platform and provided as dynamic library.
54  */
55 class WebEnginePlugin
56 {
57 public:
58   /**
59    * @brief WebEngine callback related with page loading.
60    */
61   using WebEnginePageLoadCallback = std::function<void(const std::string&)>;
62
63   /**
64    * @brief WebView callback related with page loading error.
65    */
66   using WebEnginePageLoadErrorCallback = std::function<void(std::unique_ptr<Dali::WebEngineLoadError>)>;
67
68   // forward declaration.
69   enum class ScrollEdge;
70
71   /**
72    * @brief WebView callback related with scroll edge reached.
73    */
74   using WebEngineScrollEdgeReachedCallback = std::function<void(const ScrollEdge)>;
75
76   /**
77    * @brief WebView callback related with page url changed.
78    */
79   using WebEngineUrlChangedCallback = std::function<void(const std::string&)>;
80
81   /**
82    * @brief WebView callback related with screen captured.
83    */
84   using ScreenshotCapturedCallback = std::function<void(Dali::PixelData)>;
85
86   /**
87    * @brief WebView callback related with geolocation permission.
88    *  Host and protocol of security origin will be provided when requesting
89    *  geolocation permission.
90    *  It returns true if a pop-up is created successfully, false otherwise.
91    */
92   using GeolocationPermissionCallback = std::function<bool(const std::string&, const std::string&)>;
93
94   /**
95    * @brief WebView callback related with video playing.
96    */
97   using VideoPlayingCallback = std::function<void(bool)>;
98
99   /**
100    * @brief WebView callback related with console message logged.
101    */
102   using WebEngineConsoleMessageReceivedCallback = std::function<void(std::unique_ptr<Dali::WebEngineConsoleMessage>)>;
103
104   /**
105    * @brief WebView callback related with certificate changed.
106    */
107   using WebEngineCertificateCallback = std::function<void(std::unique_ptr<Dali::WebEngineCertificate>)>;
108
109   /**
110    * @brief WebView callback related with http authentication.
111    */
112   using WebEngineHttpAuthHandlerCallback = std::function<void(std::unique_ptr<Dali::WebEngineHttpAuthHandler>)>;
113
114   /**
115    * @brief WebView callback related with context menu shown.
116    */
117   using WebEngineContextMenuShownCallback = std::function<void(std::unique_ptr<Dali::WebEngineContextMenu>)>;
118
119   /**
120    * @brief WebView callback related with context menu hidden.
121    */
122   using WebEngineContextMenuHiddenCallback = std::function<void(std::unique_ptr<Dali::WebEngineContextMenu>)>;
123
124   /**
125    * @brief Message result callback when JavaScript is executed with a message.
126    */
127   using JavaScriptMessageHandlerCallback = std::function<void(const std::string&)>;
128
129   /**
130    * @brief Alert callback when JavaScript alert is called with a message.
131    *  It returns true if a pop-up is created successfully, false otherwise.
132    */
133   using JavaScriptAlertCallback = std::function<bool(const std::string&)>;
134
135   /**
136    * @brief Confirm callback when JavaScript confirm is called with a message.
137    *  It returns true if a pop-up is created successfully, false otherwise.
138    */
139   using JavaScriptConfirmCallback = std::function<bool(const std::string&)>;
140
141   /**
142    * @brief Prompt callback when JavaScript prompt is called with a message
143    *  and an optional value that is the default value for the input field.
144    *  It returns true if a pop-up is created successfully, false otherwise.
145    */
146   using JavaScriptPromptCallback = std::function<bool(const std::string&, const std::string&)>;
147
148   /**
149    * @brief WebView callback related with form repost decision.
150    */
151   using WebEngineFormRepostDecidedCallback = std::function<void(std::unique_ptr<Dali::WebEngineFormRepostDecision>)>;
152
153   /**
154    * @brief WebView callback related with frame rendered.
155    */
156   using WebEngineFrameRenderedCallback = std::function<void(void)>;
157
158   /**
159    * @brief WebView callback related with response policy would be decided.
160    */
161   using WebEngineResponsePolicyDecidedCallback = std::function<void(std::unique_ptr<Dali::WebEnginePolicyDecision>)>;
162
163   /**
164    * @brief WebView callback related with navigation policy would be decided.
165    */
166   using WebEngineNavigationPolicyDecidedCallback = std::function<void(std::unique_ptr<Dali::WebEnginePolicyDecision>)>;
167
168   /**
169    * @brief WebView callback related with a new window would be created.
170    */
171   using WebEngineNewWindowCreatedCallback = std::function<void(Dali::WebEnginePlugin*&)>;
172
173   /**
174    * @brief Hit test callback called after hit test is created asynchronously.
175    */
176   using WebEngineHitTestCreatedCallback = std::function<bool(std::unique_ptr<Dali::WebEngineHitTest>)>;
177
178   /**
179    * @brief The callback to be called when the web engine received a plain text of current web page.
180    */
181   using PlainTextReceivedCallback = std::function<void(const std::string&)>;
182
183   /**
184    * @brief Enumeration for the scroll edge.
185    */
186   enum class ScrollEdge
187   {
188     LEFT,   ///< Left edge reached.
189     RIGHT,  ///< Right edge reached.
190     TOP,    ///< Top edge reached.
191     BOTTOM, ///< Bottom edge reached.
192   };
193
194   /**
195    * @brief Enumeration that provides the option to find text.
196    */
197   enum class FindOption
198   {
199     NONE                               = 0,      ///<  No search flags, this means a case sensitive, no wrap, forward only search
200     CASE_INSENSITIVE                   = 1 << 0, ///<  Case insensitive search
201     AT_WORD_STARTS                     = 1 << 1, ///<  Search text only at the beginning of the words
202     TREAT_MEDIAL_CAPITAL_AS_WORD_START = 1 << 2, ///<  Treat capital letters in the middle of words as word start
203     BACKWARDS                          = 1 << 3, ///<  Search backwards
204     WRAP_AROUND                        = 1 << 4, ///<  If not present the search stops at the end of the document
205     SHOW_OVERLAY                       = 1 << 5, ///<  Show overlay
206     SHOW_FIND_INDICATOR                = 1 << 6, ///<  Show indicator
207     SHOW_HIGHLIGHT                     = 1 << 7, ///<  Show highlight
208   };
209
210   /**
211    * @brief Constructor.
212    */
213   WebEnginePlugin() = default;
214
215   /**
216    * @brief Destructor.
217    */
218   virtual ~WebEnginePlugin() = default;
219
220   /**
221    * @brief Create WebEngine instance.
222    *
223    * @param [in] width The width of Web
224    * @param [in] height The height of Web
225    * @param [in] locale The locale of Web
226    * @param [in] timezoneId The timezoneID of Web
227    */
228   virtual void Create(uint32_t width, uint32_t height, const std::string& locale, const std::string& timezoneId) = 0;
229
230   /**
231    * @brief Create WebEngine instance.
232    *
233    * @param [in] width The width of Web
234    * @param [in] height The height of Web
235    * @param [in] argc The count of application arguments
236    * @param [in] argv The string array of application arguments
237    */
238   virtual void Create(uint32_t width, uint32_t height, uint32_t argc, char** argv) = 0;
239
240   /**
241    * @brief Destroy WebEngine instance.
242    */
243   virtual void Destroy() = 0;
244
245   /**
246    * @brief Get settings of WebEngine.
247    */
248   virtual WebEngineSettings& GetSettings() const = 0;
249
250   /**
251    * @brief Get back-forward list of WebEngine.
252    */
253   virtual WebEngineBackForwardList& GetBackForwardList() const = 0;
254
255   /**
256    * @brief Load a web page based on a given URL.
257    *
258    * @param [in] url The URL of the resource to load
259    */
260   virtual void LoadUrl(const std::string& url) = 0;
261
262   /**
263    * @brief Return the title of the Web.
264    *
265    * @return The title of web page
266    */
267   virtual std::string GetTitle() const = 0;
268
269   /**
270    * @brief Return the Favicon of the Web.
271    *
272    * @return Favicon of Dali::PixelData& type
273    */
274   virtual Dali::PixelData GetFavicon() const = 0;
275
276   /**
277    * @brief Get image to render.
278    */
279   virtual NativeImageSourcePtr GetNativeImageSource() = 0;
280
281   /**
282    * @brief Return the URL of the Web.
283    *
284    * @return Url of string type
285    */
286   virtual std::string GetUrl() const = 0;
287
288   /**
289    * @brief Load a given string as web contents.
290    *
291    * @param [in] htmlString The string to use as the contents of the web page
292    */
293   virtual void LoadHtmlString(const std::string& htmlString) = 0;
294
295   /**
296    * @brief Load the specified html string as the content of the view overriding current history entry
297    *
298    * @param[in] html HTML data to load
299    * @param[in] basicUri Base URL used for relative paths to external objects
300    * @param[in] unreachableUrl URL that could not be reached
301    *
302    * @return true if successfully loaded, false otherwise
303    */
304   virtual bool LoadHtmlStringOverrideCurrentEntry(const std::string& html, const std::string& basicUri, const std::string& unreachableUrl) = 0;
305
306   /**
307    * @brief Request loading the given contents by MIME type into the view object
308    *
309    * @param[in] contents The content to load
310    * @param[in] contentSize The size of contents (in bytes)
311    * @param[in] mimeType The type of contents, if 0 is given "text/html" is assumed
312    * @param[in] encoding The encoding for contents, if 0 is given "UTF-8" is assumed
313    * @param[in] baseUri The base URI to use for relative resources
314    *
315    * @return true if successfully request, false otherwise
316    */
317   virtual bool LoadContents(const int8_t* contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri) = 0;
318
319   /**
320    * @brief Reload the Web.
321    */
322   virtual void Reload() = 0;
323
324   /**
325    * @brief Reload the current page's document without cache
326    */
327   virtual bool ReloadWithoutCache() = 0;
328
329   /**
330    * @brief Stop loading web contents on the current page.
331    */
332   virtual void StopLoading() = 0;
333
334   /**
335    * @brief Suspend the operation associated with the view.
336    */
337   virtual void Suspend() = 0;
338
339   /**
340    * @brief Resume the operation associated with the view object after calling Suspend().
341    */
342   virtual void Resume() = 0;
343
344   /**
345    * @brief To suspend all url loading
346    */
347   virtual void SuspendNetworkLoading() = 0;
348
349   /**
350    * @brief To resume new url network loading
351    */
352   virtual void ResumeNetworkLoading() = 0;
353
354   /**
355    * @brief Add custom header
356    *
357    * @param[in] name custom header name to add the custom header
358    * @param[in] value custom header value to add the custom header
359    *
360    * @return true if succeeded, false otherwise
361    */
362   virtual bool AddCustomHeader(const std::string& name, const std::string& value) = 0;
363
364   /**
365    * @brief Remove custom header
366    *
367    * @param[in] name custom header name to remove the custom header
368    *
369    * @return true if succeeded, false otherwise
370    */
371   virtual bool RemoveCustomHeader(const std::string& name) = 0;
372
373   /**
374    * @brief Start the inspector server
375    *
376    * @param[in] port port number
377    *
378    * @return the port number
379    */
380   virtual uint32_t StartInspectorServer(uint32_t port) = 0;
381
382   /**
383    * @brief Stop the inspector server
384    *
385    * @return true if succeeded, false otherwise
386    */
387   virtual bool StopInspectorServer() = 0;
388
389   /**
390    * @brief Scroll web page of view by deltaX and deltaY.
391    *
392    * @param[in] deltaX horizontal offset to scroll
393    * @param[in] deltaY vertical offset to scroll
394    */
395   virtual void ScrollBy(int32_t deltaX, int32_t deltaY) = 0;
396
397   /**
398    * @brief Scroll edge of view by deltaX and deltaY.
399    *
400    * @param[in] deltaX horizontal offset to scroll
401    * @param[in] deltaY vertical offset to scroll
402    *
403    * @return true if succeeded, false otherwise
404    */
405   virtual bool ScrollEdgeBy(int32_t deltaX, int32_t deltaY) = 0;
406
407   /**
408    * @brief Scroll to the specified position of the given view.
409    */
410   virtual void SetScrollPosition(int32_t x, int32_t y) = 0;
411
412   /**
413    * @brief Get the current scroll position of the given view.
414    */
415   virtual Dali::Vector2 GetScrollPosition() const = 0;
416
417   /**
418    * @brief Get the possible scroll size of the given view.
419    */
420   virtual Dali::Vector2 GetScrollSize() const = 0;
421
422   /**
423    * @brief Get the last known content's size.
424    */
425   virtual Dali::Vector2 GetContentSize() const = 0;
426
427   /**
428    * @brief Return whether forward is possible.
429    *
430    * @return True if forward is possible, false otherwise
431    */
432   virtual bool CanGoForward() = 0;
433
434   /**
435    * @brief Go to forward.
436    */
437   virtual void GoForward() = 0;
438
439   /**
440    * @brief Return whether backward is possible.
441    *
442    * @return True if backward is possible, false otherwise
443    */
444   virtual bool CanGoBack() = 0;
445
446   /**
447    * @brief Go to back.
448    */
449   virtual void GoBack() = 0;
450
451   /**
452    * @brief Evaluate JavaScript code represented as a string.
453    *
454    * @param[in] script The JavaScript code
455    * @param[in] resultHandler The callback function to be called by the JavaScript runtime. This carries evaluation result.
456    */
457   virtual void EvaluateJavaScript(const std::string& script, JavaScriptMessageHandlerCallback resultHandler) = 0;
458
459   /**
460    * @brief Add a message handler into JavaScript.
461    *
462    * @param[in] exposedObjectName The name of exposed object
463    * @param[in] handler The callback function
464    */
465   virtual void AddJavaScriptMessageHandler(const std::string& exposedObjectName, JavaScriptMessageHandlerCallback handler) = 0;
466
467   /**
468    * @brief Register a callback for JavaScript alert.
469    *
470    * @param[in] callback The callback function
471    */
472   virtual void RegisterJavaScriptAlertCallback(JavaScriptAlertCallback callback) = 0;
473
474   /**
475    * @brief Reply for JavaScript alert.
476    */
477   virtual void JavaScriptAlertReply() = 0;
478
479   /**
480    * @brief Register a callback for JavaScript confirm.
481    *
482    * @param[in] callback The callback function
483    */
484   virtual void RegisterJavaScriptConfirmCallback(JavaScriptConfirmCallback callback) = 0;
485
486   /**
487    * @brief Reply for JavaScript confirm.
488    */
489   virtual void JavaScriptConfirmReply(bool confirmed) = 0;
490
491   /**
492    * @brief Register a callback for JavaScript prompt.
493    *
494    * @param[in] callback The callback function
495    */
496   virtual void RegisterJavaScriptPromptCallback(JavaScriptPromptCallback callback) = 0;
497
498   /**
499    * @brief Reply for JavaScript prompt.
500    */
501   virtual void JavaScriptPromptReply(const std::string& result) = 0;
502
503   /**
504    * @brief Create a new hit test.
505    *
506    * @param[in] x the horizontal position to query
507    * @param[in] y the vertical position to query
508    * @param[in] mode the mode of hit test
509    *
510    * @return a new hit test object.
511    */
512   virtual std::unique_ptr<Dali::WebEngineHitTest> CreateHitTest(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode) = 0;
513
514   /**
515    * @brief create a hit test asynchronously.
516    *
517    * @param[in] x the horizontal position to query
518    * @param[in] y the vertical position to query
519    * @param[in] mode the mode of hit test
520    * @param[in] callback The callback function
521    *
522    * @return true if succeeded, false otherwise
523    */
524   virtual bool CreateHitTestAsynchronously(int32_t x, int32_t y, Dali::WebEngineHitTest::HitTestMode mode, WebEngineHitTestCreatedCallback callback) = 0;
525
526   /**
527    * @brief Clear the history of Web.
528    */
529   virtual void ClearHistory() = 0;
530
531   /**
532    * @brief Clear all tiles resources of Web.
533    */
534   virtual void ClearAllTilesResources() = 0;
535
536   /**
537    * @brief Get user agent string.
538    *
539    * @return The string value of user agent
540    */
541   virtual std::string GetUserAgent() const = 0;
542
543   /**
544    * @brief Set user agent string.
545    *
546    * @param[in] userAgent The string value of user agent
547    */
548   virtual void SetUserAgent(const std::string& userAgent) = 0;
549
550   /**
551    * @brief Set size of Web Page.
552    */
553   virtual void SetSize(uint32_t width, uint32_t height) = 0;
554
555   /**
556    * @brief Set background color of web page.
557    *
558    * @param[in] color Background color
559    */
560   virtual void SetDocumentBackgroundColor(Dali::Vector4 color) = 0;
561
562   /**
563    * @brief Clear tiles when hidden.
564    *
565    * @param[in] cleared Whether tiles are cleared or not
566    */
567   virtual void ClearTilesWhenHidden(bool cleared) = 0;
568
569   /**
570    * @brief Set multiplier of cover area of tile.
571    *
572    * @param[in] multiplier The multiplier of cover area
573    */
574   virtual void SetTileCoverAreaMultiplier(float multiplier) = 0;
575
576   /**
577    * @brief Enable cursor by client.
578    *
579    * @param[in] enabled Whether cursor is enabled or not
580    */
581   virtual void EnableCursorByClient(bool enabled) = 0;
582
583   /**
584    * @brief Get the selected text.
585    *
586    * @return the selected text
587    */
588   virtual std::string GetSelectedText() const = 0;
589
590   /**
591    * @brief Send Touch Events.
592    */
593   virtual bool SendTouchEvent(const TouchEvent& touch) = 0;
594
595   /**
596    * @brief Send Key Events.
597    */
598   virtual bool SendKeyEvent(const KeyEvent& event) = 0;
599
600   /**
601    * @brief Support mouse events or not.
602    * @param[in] enabled True if enabled, false othewise.
603    */
604   virtual void EnableMouseEvents(bool enabled) = 0;
605
606   /**
607    * @brief Support key events or not.
608    * @param[in] enabled True if enabled, false othewise.
609    */
610   virtual void EnableKeyEvents(bool enabled) = 0;
611
612   /**
613    * @brief Set focus.
614    * @param[in] focused True if focus is gained, false lost.
615    */
616   virtual void SetFocus(bool focused) = 0;
617
618   /**
619    * @brief Set zoom factor of the current page.
620    * @param[in] zoomFactor a new factor to be set.
621    */
622   virtual void SetPageZoomFactor(float zoomFactor) = 0;
623
624   /**
625    * @brief Query the current zoom factor of the page。
626    * @return The current page zoom factor.
627    */
628   virtual float GetPageZoomFactor() const = 0;
629
630   /**
631    * @brief Set the current text zoom level。.
632    * @param[in] zoomFactor a new factor to be set.
633    */
634   virtual void SetTextZoomFactor(float zoomFactor) = 0;
635
636   /**
637    * @brief Get the current text zoom level.
638    * @return The current text zoom factor.
639    */
640   virtual float GetTextZoomFactor() const = 0;
641
642   /**
643    * @brief Get the current load progress of the page.
644    * @return The load progress of the page.
645    */
646   virtual float GetLoadProgressPercentage() const = 0;
647
648   /**
649    * @brief Scale the current page, centered at the given point.
650    * @param[in] scaleFactor a new factor to be scaled.
651    * @param[in] point a center coordinate.
652    */
653   virtual void SetScaleFactor(float scaleFactor, Dali::Vector2 point) = 0;
654
655   /**
656    * @brief Get the current scale factor of the page.
657    * @return The current scale factor.
658    */
659   virtual float GetScaleFactor() const = 0;
660
661   /**
662    * @brief Request to activate/deactivate the accessibility usage set by web app.
663    * @param[in] activated Activate accessibility or not.
664    */
665   virtual void ActivateAccessibility(bool activated) = 0;
666
667   /**
668    * @brief Get the accessibility address (bus and path) for embedding.
669    * @return Accessibility address of the root web content element.
670    */
671   virtual Accessibility::Address GetAccessibilityAddress() = 0;
672
673   /**
674    * @brief Request to set the current page's visibility.
675    * @param[in] visible Visible or not.
676    *
677    * @return true if succeeded, false otherwise
678    */
679   virtual bool SetVisibility(bool visible) = 0;
680
681   /**
682    * @brief Search and highlight the given string in the document.
683    * @param[in] text The text to find
684    * @param[in] options The options to find
685    * @param[in] maxMatchCount The maximum match count to find
686    *
687    * @return true if found & highlighted, false otherwise
688    */
689   virtual bool HighlightText(const std::string& text, FindOption options, uint32_t maxMatchCount) = 0;
690
691   /**
692    * @brief Add dynamic certificate path.
693    * @param[in] host host that required client authentication
694    * @param[in] certPath the file path stored certificate
695    */
696   virtual void AddDynamicCertificatePath(const std::string& host, const std::string& certPath) = 0;
697
698   /**
699    * @brief Get snapshot of the specified viewArea of page.
700    *
701    * @param[in] viewArea The rectangle of screen shot
702    * @param[in] scaleFactor The scale factor
703    *
704    * @return pixel data of screen shot
705    */
706   virtual Dali::PixelData GetScreenshot(Dali::Rect<int32_t> viewArea, float scaleFactor) = 0;
707
708   /**
709    * @brief Request to get snapshot of the specified viewArea of page asynchronously.
710    *
711    * @param[in] viewArea The rectangle of screen shot
712    * @param[in] scaleFactor The scale factor
713    * @param[in] callback The callback for screen shot
714    *
715    * @return true if requested successfully, false otherwise
716    */
717   virtual bool GetScreenshotAsynchronously(Dali::Rect<int32_t> viewArea, float scaleFactor, ScreenshotCapturedCallback callback) = 0;
718
719   /**
720    * @brief Asynchronously request to check if there is a video playing in the given view.
721    *
722    * @param[in] callback The callback called after checking if video is playing or not
723    *
724    * @return true if requested successfully, false otherwise
725    */
726   virtual bool CheckVideoPlayingAsynchronously(VideoPlayingCallback callback) = 0;
727
728   /**
729    * @brief Set callback which will be called upon geolocation permission request.
730    *
731    * @param[in] callback The callback for requesting geolocation permission
732    */
733   virtual void RegisterGeolocationPermissionCallback(GeolocationPermissionCallback callback) = 0;
734
735   /**
736    * @brief Update display area.
737    * @param[in] displayArea The display area need be updated.
738    */
739   virtual void UpdateDisplayArea(Dali::Rect<int32_t> displayArea) = 0;
740
741   /**
742    * @brief Enable video hole.
743    * @param[in] enabled True if enabled, false othewise.
744    */
745   virtual void EnableVideoHole(bool enabled) = 0;
746
747   /**
748    * @brief Send Hover Events.
749    * @param[in] event The hover event would be sent.
750    */
751   virtual bool SendHoverEvent(const HoverEvent& event) = 0;
752
753   /**
754    * @brief Send Wheel Events.
755    * @param[in] event The wheel event would be sent.
756    */
757   virtual bool SendWheelEvent(const WheelEvent& event) = 0;
758
759   /**
760    * @brief Callback to be called when frame would be rendered.
761    *
762    * @param[in] callback
763    */
764   virtual void RegisterFrameRenderedCallback(WebEngineFrameRenderedCallback callback) = 0;
765
766   /**
767    * @brief Callback to be called when page loading is started.
768    *
769    * @param[in] callback
770    */
771   virtual void RegisterPageLoadStartedCallback(WebEnginePageLoadCallback callback) = 0;
772
773   /**
774    * @brief Callback to be called when page loading is in progress.
775    *
776    * @param[in] callback
777    */
778   virtual void RegisterPageLoadInProgressCallback(WebEnginePageLoadCallback callback) = 0;
779
780   /**
781    * @brief Callback to be called when page loading is finished.
782    *
783    * @param[in] callback
784    */
785   virtual void RegisterPageLoadFinishedCallback(WebEnginePageLoadCallback callback) = 0;
786
787   /**
788    * @brief Callback to be called when an error occurs in page loading.
789    *
790    * @param[in] callback
791    */
792   virtual void RegisterPageLoadErrorCallback(WebEnginePageLoadErrorCallback callback) = 0;
793
794   /**
795    * @brief Callback to be called when scroll edge is reached.
796    *
797    * @param[in] callback
798    */
799   virtual void RegisterScrollEdgeReachedCallback(WebEngineScrollEdgeReachedCallback callback) = 0;
800
801   /**
802    * @brief Callback to be called when url is changed.
803    *
804    * @param[in] callback
805    */
806   virtual void RegisterUrlChangedCallback(WebEngineUrlChangedCallback callback) = 0;
807
808   /**
809    * @brief Callback to be called when form repost decision is requested.
810    *
811    * @param[in] callback
812    */
813   virtual void RegisterFormRepostDecidedCallback(WebEngineFormRepostDecidedCallback callback) = 0;
814
815   /**
816    * @brief Callback to be called when console message will be logged.
817    *
818    * @param[in] callback
819    */
820   virtual void RegisterConsoleMessageReceivedCallback(WebEngineConsoleMessageReceivedCallback callback) = 0;
821
822   /**
823    * @brief Callback to be called when response policy would be decided.
824    *
825    * @param[in] callback
826    */
827   virtual void RegisterResponsePolicyDecidedCallback(WebEngineResponsePolicyDecidedCallback callback) = 0;
828
829   /**
830    * @brief Callback to be called when navigation policy would be decided.
831    *
832    * @param[in] callback
833    */
834   virtual void RegisterNavigationPolicyDecidedCallback(WebEngineNavigationPolicyDecidedCallback callback) = 0;
835
836   /**
837    * @brief Callback to be called when a new window would be created.
838    *
839    * @param[in] callback
840    */
841   virtual void RegisterNewWindowCreatedCallback(WebEngineNewWindowCreatedCallback callback) = 0;
842
843   /**
844    * @brief Callback to be called when certificate need be confirmed.
845    *
846    * @param[in] callback
847    */
848   virtual void RegisterCertificateConfirmedCallback(WebEngineCertificateCallback callback) = 0;
849
850   /**
851    * @brief Callback to be called when ssl certificate is changed.
852    *
853    * @param[in] callback
854    */
855   virtual void RegisterSslCertificateChangedCallback(WebEngineCertificateCallback callback) = 0;
856
857   /**
858    * @brief Callback to be called when http authentication need be confirmed.
859    *
860    * @param[in] callback
861    */
862   virtual void RegisterHttpAuthHandlerCallback(WebEngineHttpAuthHandlerCallback callback) = 0;
863
864   /**
865    * @brief Callback to be called when context menu would be shown.
866    *
867    * @param[in] callback
868    */
869   virtual void RegisterContextMenuShownCallback(WebEngineContextMenuShownCallback callback) = 0;
870
871   /**
872    * @brief Callback to be called when context menu would be hidden.
873    *
874    * @param[in] callback
875    */
876   virtual void RegisterContextMenuHiddenCallback(WebEngineContextMenuHiddenCallback callback) = 0;
877
878   /**
879    * @brief Get a plain text of current web page asynchronously.
880    *
881    * @param[in] callback The callback function called asynchronously.
882    */
883   virtual void GetPlainTextAsynchronously(PlainTextReceivedCallback callback) = 0;
884 };
885
886 // specialization has to be done in the same namespace
887 template<>
888 struct EnableBitMaskOperators<WebEnginePlugin::FindOption>
889 {
890   static const bool ENABLE = true;
891 };
892
893 } // namespace Dali
894
895 #endif