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