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