Add APIs for context menu into web view.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / web-view / web-view-impl.h
1 #ifndef DALI_TOOLKIT_INTERNAL_WEB_VIEW_H
2 #define DALI_TOOLKIT_INTERNAL_WEB_VIEW_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 <dali/devel-api/actors/actor-devel.h>
23 #include <dali/devel-api/adaptor-framework/web-engine.h>
24 #include <dali/public-api/images/image-operations.h>
25 #include <dali/public-api/object/property-notification.h>
26 #include <memory>
27
28 // INTERNAL INCLUDES
29 #include <dali-toolkit/devel-api/controls/web-view/web-view.h>
30 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
31 #include <dali-toolkit/public-api/controls/control-impl.h>
32 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
33
34 namespace Dali
35 {
36 namespace Toolkit
37 {
38 class KeyEvent;
39 class TouchEvent;
40 class WebBackForwardList;
41 class WebContext;
42 class WebCookieManager;
43 class WebSettings;
44 class WebView;
45
46 namespace Internal
47 {
48 class WebView : public Control
49 {
50 protected:
51   WebView();
52
53   WebView(const std::string& locale, const std::string& timezoneId);
54
55   WebView(int argc, char** argv);
56
57   virtual ~WebView();
58
59 public:
60   /**
61    * @copydoc Dali::Toolkit::WebView::New()
62    */
63   static Toolkit::WebView New();
64
65   /**
66    * @copydoc Dali::Toolkit::WebView::New( const std::string&, const std::string& )
67    */
68   static Toolkit::WebView New(const std::string& locale, const std::string& timezoneId);
69
70   /**
71    * @copydoc Dali::Toolkit::WebView::New( int, char** )
72    */
73   static Toolkit::WebView New(int argc, char** argv);
74
75   /**
76    * @brief Get settings of WebEngine.
77    */
78   Dali::Toolkit::WebSettings* GetSettings() const;
79
80   /**
81    * @brief Get context of WebEngine.
82    */
83   Dali::Toolkit::WebContext* GetContext() const;
84
85   /**
86    * @brief Get cookie manager of WebEngine.
87    */
88   Dali::Toolkit::WebCookieManager* GetCookieManager() const;
89
90   /**
91    * @brief Get WebBackForwardList of WebEngine.
92    */
93   Dali::Toolkit::WebBackForwardList* GetBackForwardList() const;
94
95   /**
96    * @brief Get Favicon of web page.
97    *
98    * @return Handle to a fav icon
99    */
100   Dali::Toolkit::ImageView& GetFavicon();
101
102   /**
103    * @copydoc Dali::Toolkit::WebView::LoadUrl()
104    */
105   void LoadUrl(const std::string& url);
106
107   /**
108    * @copydoc Dali::WebEngine::LoadHTMLString()
109    */
110   void LoadHtmlString(const std::string& htmlString);
111
112   /**
113    * @copydoc Dali::WebEngine::LoadHtmlStringOverrideCurrentEntry()
114    */
115   bool LoadHtmlStringOverrideCurrentEntry(const std::string& html, const std::string& basicUri, const std::string& unreachableUrl);
116
117   /**
118    * @copydoc Dali::WebEngine::LoadContents()
119    */
120   bool LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri);
121
122   /**
123    * @copydoc Dali::Toolkit::WebView::Reload()
124    */
125   void Reload();
126
127   /**
128    * @copydoc Dali::WebEngine::ReloadWithoutCache()
129    */
130   bool ReloadWithoutCache();
131
132   /**
133    * @copydoc Dali::Toolkit::WebView::StopLoading()
134    */
135   void StopLoading();
136
137   /**
138    * @copydoc Dali::Toolkit::WebView::StopLoading()
139    */
140   void Suspend();
141
142   /**
143    * @copydoc Dali::Toolkit::WebView::Resume()
144    */
145   void Resume();
146
147   /**
148    * @copydoc Dali::WebEngine::SuspendNetworkLoading()
149    */
150   void SuspendNetworkLoading();
151
152   /**
153    * @copydoc Dali::WebEngine::ResumeNetworkLoading()
154    */
155   void ResumeNetworkLoading();
156
157   /**
158    * @copydoc Dali::WebEngine::AddCustomHeader()
159    */
160   bool AddCustomHeader(const std::string& name, const std::string& value);
161
162   /**
163    * @copydoc Dali::WebEngine::RemoveCustomHeader()
164    */
165   bool RemoveCustomHeader(const std::string& name);
166
167   /**
168    * @copydoc Dali::WebEngine::StartInspectorServer()
169    */
170   uint32_t StartInspectorServer(uint32_t port);
171
172   /**
173    * @copydoc Dali::WebEngine::StopInspectorServer()
174    */
175   bool StopInspectorServer();
176
177   /**
178    * @copydoc Dali::Toolkit::WebView::ScrollBy()
179    */
180   void ScrollBy(int deltaX, int deltaY);
181
182   /**
183    * @copydoc Dali::WebEngine::ScrollEdgeBy()
184    */
185   bool ScrollEdgeBy(int deltaX, int deltaY);
186
187   /**
188    * @copydoc Dali::Toolkit::WebView::CanGoForward()
189    */
190   bool CanGoForward();
191
192   /**
193    * @copydoc Dali::Toolkit::WebView::GoForward()
194    */
195   void GoForward();
196
197   /**
198    * @copydoc Dali::Toolkit::WebView::CanGoBack()
199    */
200   bool CanGoBack();
201
202   /**
203    * @copydoc Dali::Toolkit::WebView::GoBack()
204    */
205   void GoBack();
206
207   /**
208    * @copydoc Dali::Toolkit::WebView::EvaluateJavaScript()
209    */
210   void EvaluateJavaScript(const std::string& script, std::function<void(const std::string&)> resultHandler);
211
212   /**
213    * @copydoc Dali::Toolkit::WebView::AddJavaScriptMessageHandler()
214    */
215   void AddJavaScriptMessageHandler(const std::string& exposedObjectName, std::function<void(const std::string&)> handler);
216
217   /**
218    * @copydoc Dali::Toolkit::WebView::RegisterJavaScriptAlertCallback()
219    */
220   void RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback);
221
222   /**
223    * @copydoc Dali::Toolkit::WebView::JavaScriptAlertReply()
224    */
225   void JavaScriptAlertReply();
226
227   /**
228    * @copydoc Dali::Toolkit::WebView::RegisterJavaScriptConfirmCallback()
229    */
230   void RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback);
231
232   /**
233    * @copydoc Dali::Toolkit::WebView::JavaScriptConfirmReply()
234    */
235   void JavaScriptConfirmReply(bool confirmed);
236
237   /**
238    * @copydoc Dali::Toolkit::WebView::RegisterJavaScriptPromptCallback()
239    */
240   void RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback);
241
242   /**
243    * @copydoc Dali::Toolkit::WebView::JavaScriptPromptReply()
244    */
245   void JavaScriptPromptReply(const std::string& result);
246
247   /**
248    * @copydoc Dali::Toolkit::WebView::ClearHistory()
249    */
250   void ClearHistory();
251
252   /**
253    * @copydoc Dali::Toolkit::WebView::ClearAllTilesResources()
254    */
255   void ClearAllTilesResources();
256
257   /**
258    * @copydoc Dali::Toolkit::WebView::SetScaleFactor()
259    */
260   void SetScaleFactor(float scaleFactor, Dali::Vector2 point);
261
262   /**
263    * @copydoc Dali::Toolkit::WebView::GetScaleFactor()
264    */
265   float GetScaleFactor() const;
266
267   /**
268    * @copydoc Dali::Toolkit::WebView::ActivateAccessibility()
269    */
270   void ActivateAccessibility(bool activated);
271
272   /**
273    * @copydoc Dali::Toolkit::WebView::HighlightText()
274    */
275   bool HighlightText(const std::string& text, Dali::WebEnginePlugin::FindOption options, uint32_t maxMatchCount);
276
277   /**
278    * @copydoc Dali::Toolkit::WebView::AddDynamicCertificatePath()
279    */
280   void AddDynamicCertificatePath(const std::string& host, const std::string& certPath);
281
282   /**
283    * @copydoc Dali::Toolkit::WebView::GetScreenshot()
284    */
285   Dali::Toolkit::ImageView GetScreenshot(Dali::Rect<int> viewArea, float scaleFactor);
286
287   /**
288    * @copydoc Dali::Toolkit::WebView::GetScreenshotAsynchronously()
289    */
290   bool GetScreenshotAsynchronously(Dali::Rect<int> viewArea, float scaleFactor, Dali::Toolkit::WebView::WebViewScreenshotCapturedCallback callback);
291
292   /**
293    * @copydoc Dali::Toolkit::WebView::CheckVideoPlayingAsynchronously()
294    */
295   bool CheckVideoPlayingAsynchronously(Dali::WebEnginePlugin::VideoPlayingCallback callback);
296
297   /**
298    * @copydoc Dali::Toolkit::WebView::RegisterGeolocationPermissionCallback()
299    */
300   void RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::GeolocationPermissionCallback callback);
301
302   /**
303    * @copydoc Dali::Toolkit::WebView::PageLoadStartedSignal()
304    */
305   Dali::Toolkit::WebView::WebViewPageLoadSignalType& PageLoadStartedSignal();
306
307   /**
308    * @copydoc Dali::Toolkit::WebView::PageLoadInProgressSignal()
309    */
310   Dali::Toolkit::WebView::WebViewPageLoadSignalType& PageLoadInProgressSignal();
311
312   /**
313    * @copydoc Dali::Toolkit::WebView::PageLoadFinishedSignal()
314    */
315   Dali::Toolkit::WebView::WebViewPageLoadSignalType& PageLoadFinishedSignal();
316
317   /**
318    * @copydoc Dali::Toolkit::WebView::PageLoadErrorSignal()
319    */
320   Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType& PageLoadErrorSignal();
321
322   /**
323    * @copydoc Dali::Toolkit::WebView::ScrollEdgeReachedSignal()
324    */
325   Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
326
327   /**
328    * @copydoc Dali::Toolkit::WebView::UrlChangedSignal()
329    */
330   Dali::Toolkit::WebView::WebViewUrlChangedSignalType& UrlChangedSignal();
331
332   /**
333    * @copydoc Dali::Toolkit::WebView::FormRepostDecisionSignal()
334    */
335   Dali::Toolkit::WebView::WebViewFormRepostDecisionSignalType& FormRepostDecisionSignal();
336
337   /**
338    * @copydoc Dali::Toolkit::WebView::FrameRenderedSignal()
339    */
340   Dali::Toolkit::WebView::WebViewFrameRenderedSignalType& FrameRenderedSignal();
341
342   /**
343    * @copydoc Dali::Toolkit::WebView::RequestInterceptorSignal()
344    */
345   Dali::Toolkit::WebView::WebViewRequestInterceptorSignalType& RequestInterceptorSignal();
346
347   /**
348    * @copydoc Dali::Toolkit::WebView::ConsoleMessageSignal()
349    */
350   Dali::Toolkit::WebView::WebViewConsoleMessageSignalType& ConsoleMessageSignal();
351
352   /**
353    * @copydoc Dali::Toolkit::WebView::PolicyDecisionSignal()
354    */
355   Dali::Toolkit::WebView::WebViewPolicyDecisionSignalType& PolicyDecisionSignal();
356
357   /**
358    * @copydoc Dali::Toolkit::WebView::CertificateConfirmSignal()
359    */
360   Dali::Toolkit::WebView::WebViewCertificateSignalType& CertificateConfirmSignal();
361
362   /**
363    * @copydoc Dali::Toolkit::WebView::SslCertificateChangedSignal()
364    */
365   Dali::Toolkit::WebView::WebViewCertificateSignalType& SslCertificateChangedSignal();
366
367   /**
368    * @copydoc Dali::Toolkit::WebView::HttpAuthHandlerSignal()
369    */
370   Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
371
372   /**
373    * @copydoc Dali::Toolkit::WebView::ContextMenuCustomizedSignal()
374    */
375   Dali::Toolkit::WebView::WebViewContextMenuCustomizedSignalType& ContextMenuCustomizedSignal();
376
377   /**
378    * @copydoc Dali::Toolkit::WebView::ContextMenuItemSelectedSignal()
379    */
380   Dali::Toolkit::WebView::WebViewContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal();
381
382 public: // Properties
383   /**
384    * @brief Called when a property of an object of this type is set.
385    *
386    * @param[in] object The object whose property is set.
387    * @param[in] index The property index.
388    * @param[in] value The new property value.
389    */
390   static void SetProperty(Dali::BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value);
391
392   /**
393    * @brief Called to retrieve a property of an object of this type.
394    *
395    * @param[in] object The object whose property is to be retrieved.
396    * @param[in] index The property index.
397    * @return The current value of the property.
398    */
399   static Dali::Property::Value GetProperty(Dali::BaseObject* object, Dali::Property::Index propertyIndex);
400
401   /**
402    * Connects a callback function with the object's signals.
403    * @param[in] object The object providing the signal.
404    * @param[in] tracker Used to disconnect the signal.
405    * @param[in] signalName The signal to connect to.
406    * @param[in] functor A newly allocated FunctorDelegate.
407    * @return True if the signal was connected.
408    * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the c
409    */
410   static bool DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor);
411
412 private: // From Control
413   /**
414    * @copydoc Toolkit::Control::OnInitialize()
415    */
416   void OnInitialize() override;
417
418   /**
419    * @copydoc Toolkit::Control::GetNaturalSize
420    */
421   Vector3 GetNaturalSize() override;
422
423   /**
424    * @copydoc Toolkit::Control::OnKeyEvent()
425    */
426   bool OnKeyEvent(const Dali::KeyEvent& event) override;
427
428   /**
429    * @copydoc Toolkit::Control::OnKeyInputFocusGained()
430    */
431   void OnKeyInputFocusGained() override;
432
433   /**
434    * @copydoc Toolkit::Control::OnKeyInputFocusLost()
435    */
436   void OnKeyInputFocusLost() override;
437
438   /**
439    * @copydoc Toolkit::Control::OnSceneConnection()
440    */
441   void OnSceneConnection(int depth) override;
442
443 private:
444   // Undefined
445   WebView(const WebView& webView);
446
447   WebView& operator=(const WebView& webView);
448
449   /**
450    * @brief Set an absolute scroll of the given view.
451    * @param[in] x The coordinate x of scroll
452    * @param[in] y The coordinate y of scroll
453    */
454   void SetScrollPosition(int x, int y);
455
456   /**
457    * @brief Gets the current scroll position of the given view.
458    * @param[out] x The coordinate x of scroll
459    * @param[out] y The coordinate y of scroll
460    */
461   Dali::Vector2 GetScrollPosition() const;
462
463   /**
464    * @brief Get the possible scroll size of the given view.
465    * @param[out] width The width of scroll size
466    * @param[out] height The height of scroll size
467    */
468   Dali::Vector2 GetScrollSize() const;
469
470   /**
471    * @brief Get the last known content's size.
472    * @param[out] width The width of content's size
473    * @param[out] height The height of content's size
474    */
475   Dali::Vector2 GetContentSize() const;
476
477   /**
478    * @brief Return the title of the Web.
479    *
480    * @return The title of web page
481    */
482   std::string GetTitle() const;
483
484   /**
485    * @brief Set the background color of web page.
486    * @param[in] color The value of background color.
487    */
488   void SetDocumentBackgroundColor(Dali::Vector4 color);
489
490   /**
491    * @brief Clear tiles when hidden.
492    *
493    * @param[in] cleared Whether tiles are cleared or not
494    */
495   void ClearTilesWhenHidden(bool cleared);
496
497   /**
498    * @brief Set multiplier of cover area of tile.
499    *
500    * @param[in] multiplier The multiplier of cover area
501    */
502   void SetTileCoverAreaMultiplier(float multiplier);
503
504   /**
505    * @brief Enable cursor by client.
506    * @param[in] enabled Whether cursor is enabled or not.
507    */
508   void EnableCursorByClient(bool enabled);
509
510   /**
511    * @brief Get the selected text.
512    * @return The selected text
513    */
514   std::string GetSelectedText() const;
515
516   /**
517    * @brief Get user agent string.
518    * @return The string value of user agent
519    */
520   const std::string& GetUserAgent() const;
521
522   /**
523    * @brief Set user agent string.
524    * @param[in] userAgent The string value of user agent
525    */
526   void SetUserAgent(const std::string& userAgent);
527
528   /**
529    * @brief Set zoom factor of the current page.
530    * @param[in] zoomFactor a new factor to be set.
531    */
532   void SetPageZoomFactor(float zoomFactor);
533
534   /**
535    * @brief Query the current zoom factor of the page。
536    * @return The current page zoom factor.
537    */
538   float GetPageZoomFactor() const;
539
540   /**
541    * @brief Set the current text zoom level。.
542    * @param[in] zoomFactor a new factor to be set.
543    */
544   void SetTextZoomFactor(float zoomFactor);
545
546   /**
547    * @brief Get the current text zoom level.
548    * @return The current text zoom factor.
549    */
550   float GetTextZoomFactor() const;
551
552   /**
553    * @brief Get the current load progress of the page.
554    * @return The load progress of the page.
555    */
556   float GetLoadProgressPercentage() const;
557
558   /**
559    * @brief Request to set the current page's visibility.
560    * @param[in] visible Visible or not.
561    *
562    * @return true if succeeded, false otherwise
563    */
564   bool SetVisibility(bool visible);
565
566   /**
567    * @brief Update display area of web view.
568    * @param[in] source The soource triggers Notification.
569    */
570   void UpdateDisplayArea(Dali::PropertyNotification& source);
571
572   /**
573    * @brief Enable/Disable video hole for video playing.
574    * @param[in] enabled True if video hole is enabled, false otherwise.
575    */
576   void EnableVideoHole(bool enabled);
577
578   /**
579    * @brief Enable blend mode.
580    * @param[in] blendEnabled True if turn on blend mode, false otherwise.
581    */
582   void EnableBlendMode(bool blendEnabled);
583
584   /**
585    * @brief Enable/disable mouse events. The default is enabled.
586    *
587    * @param[in] enabled True if mouse events are enabled, false otherwise
588    */
589   void EnableMouseEvents(bool enabled);
590
591   /**
592    * @brief Enable/disable key events. The default is enabled.
593    *
594    * @param[in] enabled True if key events enabled, false otherwise
595    */
596   void EnableKeyEvents(bool enabled);
597
598   /**
599    * @brief Create image view by pixel data.
600    * @param[in] pixel Pixel data
601    * @return The new image view
602    */
603   Dali::Toolkit::ImageView CreateImageView(Dali::PixelData pixel);
604
605   /**
606    * @brief Callback function to be called when page load started.
607    * @param[in] url The url currently being loaded
608    */
609   void OnPageLoadStarted(const std::string& url);
610
611   /**
612    * @brief Callback function to be called when page is loading in progress.
613    * @param[in] url The url currently being loaded
614    */
615   void OnPageLoadInProgress(const std::string& url);
616
617   /**
618    * @brief Callback function to be called when page load finished.
619    * @param[in] url The url currently being loaded
620    */
621   void OnPageLoadFinished(const std::string& url);
622
623   /**
624    * @brief Callback function to be called when there is an error in page loading.
625    * @param[in] url The url currently being loaded
626    * @param[in] errorCode The error code
627    */
628   void OnPageLoadError(std::shared_ptr<Dali::WebEngineLoadError> error);
629
630   /**
631    * @brief Callback function to be called when scroll edge is reached.
632    * @param[in] edge The scroll edge reached.
633    */
634   void OnScrollEdgeReached(Dali::WebEnginePlugin::ScrollEdge edge);
635
636   /**
637    * @brief Callback function to be called when url is changed.
638    * @param[in] url The url currently being loaded
639    */
640   void OnUrlChanged(const std::string& url);
641
642   /**
643    * Signal occurs when the Web View has been touched.
644    * @param[in] actor The Actor Touched
645    * @param[in] touch The Touch Data.
646    * @return Whether to consume event or not.
647    */
648   bool OnTouchEvent(Actor actor, const Dali::TouchEvent& touch);
649
650   /**
651    * Signal occurs when the Web View has been hovered.
652    * @param[in] actor The Actor Hovered
653    * @param[in] hover The Hover Data.
654    * @return Whether to consume event or not.
655    */
656   bool OnHoverEvent(Actor actor, const Dali::HoverEvent& hover);
657
658   /**
659    * Signal occurs when the Web View receives wheel event.
660    * @param[in] actor The Actor that receives Wheel event.
661    * @param[in] wheel The Wheel Data.
662    * @return Whether to consume event or not.
663    */
664   bool OnWheelEvent(Actor actor, const Dali::WheelEvent& wheel);
665
666   /**
667    * @brief Callback function to be called when form repost decision need be checked.
668    * @param[in] decision The new decision for form repost
669    */
670   void OnFormRepostDecision(std::shared_ptr<Dali::WebEngineFormRepostDecision> decision);
671
672   /**
673    * @brief Callback function to be called when frame is rendered.
674    */
675   void OnFrameRendered();
676
677   /**
678    * @brief Callback function to be called when visibility is changed.
679    * @param[in] actor The actor, or child of actor, whose visibility has changed
680    * @param[in] isVisible Whether the actor is now visible or not
681    * @param[in] type, Whether the actor's visible property has changed or a parent's
682    */
683   void OnVisibilityChanged(Actor actor, bool isVisible, Dali::DevelActor::VisibilityChange::Type type);
684
685   /**
686    * @brief callback for screen shot captured.
687    * @param[in] pixel Pixel data of screen shot.
688    */
689   void OnScreenshotCaptured(Dali::PixelData pixel);
690
691   /**
692    * @brief Callback function to be called when http request need be intercepted.
693    * @param [in] request The http request interceptor.
694    */
695   void OnInterceptRequest(std::shared_ptr<Dali::WebEngineRequestInterceptor> interceptor);
696
697   /**
698    * @brief Callback function to be called when console message will be logged.
699    * @param[in] message The message logged.
700    */
701   void OnConsoleMessage(std::shared_ptr<Dali::WebEngineConsoleMessage> message);
702
703   /**
704    * @brief Callback function to be called when policy need be decided.
705    * @param[in] decision The policy decided.
706    */
707   void OnPolicyDecisionRequest(std::shared_ptr<Dali::WebEnginePolicyDecision> decision);
708
709   /**
710    * @brief Callback function to be called when certificate need be confirmed.
711    * @param[in] certificate The certificate policy decision.
712    */
713   void OnCertificateConfirm(std::shared_ptr<Dali::WebEngineCertificate> certificate);
714
715   /**
716    * @brief Callback function to be called when ssl certificate is changed.
717    * @param[in] certificate The certificate information received.
718    */
719   void OnSslCertificateChanged(std::shared_ptr<Dali::WebEngineCertificate> certificate);
720
721   /**
722    * @brief Callback function to be called when http authentication need be confirmed.
723    * @param[in] handler The handler for http authentication
724    */
725   void OnHttpAuthenticationRequest(std::shared_ptr<Dali::WebEngineHttpAuthHandler> handler);
726
727   /**
728    * @brief Callback function to be called when context menu would be customized.
729    * @param[in] e The scroll edge reached.
730    */
731   void OnContextMenuCustomized(std::shared_ptr<Dali::WebEngineContextMenu> menu);
732
733   /**
734    * @brief Callback function to be called when context menu item is selected.
735    * @param[in] url The url currently being loaded
736    */
737   void OnContextMenuItemSelected(std::shared_ptr<Dali::WebEngineContextMenuItem> item);
738
739 private:
740   std::string                 mUrl;
741   Dali::Toolkit::Visual::Base mVisual;
742   Dali::Size                  mWebViewSize;
743   Dali::WebEngine             mWebEngine;
744
745   Dali::Toolkit::WebView::WebViewPageLoadSignalType                mPageLoadStartedSignal;
746   Dali::Toolkit::WebView::WebViewPageLoadSignalType                mPageLoadInProgressSignal;
747   Dali::Toolkit::WebView::WebViewPageLoadSignalType                mPageLoadFinishedSignal;
748   Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType           mPageLoadErrorSignal;
749   Dali::Toolkit::WebView::WebViewUrlChangedSignalType              mUrlChangedSignal;
750   Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType       mScrollEdgeReachedSignal;
751   Dali::Toolkit::WebView::WebViewFormRepostDecisionSignalType      mFormRepostDecisionSignal;
752   Dali::Toolkit::WebView::WebViewFrameRenderedSignalType           mFrameRenderedSignal;
753   Dali::Toolkit::WebView::WebViewRequestInterceptorSignalType      mRequestInterceptorSignal;
754   Dali::Toolkit::WebView::WebViewConsoleMessageSignalType          mConsoleMessageSignal;
755   Dali::Toolkit::WebView::WebViewPolicyDecisionSignalType          mPolicyDecisionSignal;
756   Dali::Toolkit::WebView::WebViewCertificateSignalType             mCertificateConfirmSignal;
757   Dali::Toolkit::WebView::WebViewCertificateSignalType             mSslCertificateChangedSignal;
758   Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType         mHttpAuthHandlerSignal;
759   Dali::Toolkit::WebView::WebViewContextMenuCustomizedSignalType   mContextMenuCustomizedSignal;
760   Dali::Toolkit::WebView::WebViewContextMenuItemSelectedSignalType mContextMenuItemSelectedSignal;
761
762   std::unique_ptr<Dali::Toolkit::WebContext>         mWebContext;
763   std::unique_ptr<Dali::Toolkit::WebCookieManager>   mWebCookieManager;
764   std::unique_ptr<Dali::Toolkit::WebSettings>        mWebSettings;
765   std::unique_ptr<Dali::Toolkit::WebBackForwardList> mWebBackForwardList;
766
767   Dali::Toolkit::ImageView mFaviconView;
768
769   Dali::PropertyNotification mPositionUpdateNotification;
770   Dali::PropertyNotification mSizeUpdateNotification;
771   Dali::PropertyNotification mScaleUpdateNotification;
772   Dali::Rect<int>            mWebViewArea;
773   bool                       mVideoHoleEnabled;
774   bool                       mMouseEventsEnabled;
775   bool                       mKeyEventsEnabled;
776
777   Dali::Toolkit::WebView::WebViewScreenshotCapturedCallback mScreenshotCapturedCallback;
778 };
779
780 } // namespace Internal
781
782 inline Toolkit::Internal::WebView& GetImpl(Toolkit::WebView& handle)
783 {
784   DALI_ASSERT_ALWAYS(handle);
785   Dali::RefObject& impl = handle.GetImplementation();
786   return static_cast<Toolkit::Internal::WebView&>(impl);
787 }
788
789 inline const Toolkit::Internal::WebView& GetImpl(const Toolkit::WebView& handle)
790 {
791   DALI_ASSERT_ALWAYS(handle);
792   const Dali::RefObject& impl = handle.GetImplementation();
793   return static_cast<const Toolkit::Internal::WebView&>(impl);
794 }
795
796 } // namespace Toolkit
797
798 } // namespace Dali
799
800 #endif // DALI_TOOLKIT_INTERNAL_WEB_VIEW_H