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