DALi Version 2.0.16
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-web-engine.cpp
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #include "toolkit-timer.h"
19
20 #include <dali/devel-api/adaptor-framework/web-engine.h>
21 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
22 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
23 #include <dali/devel-api/adaptor-framework/web-engine-context.h>
24 #include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
25 #include <dali/devel-api/adaptor-framework/web-engine-settings.h>
26 #include <dali/public-api/adaptor-framework/native-image-source.h>
27 #include <dali/public-api/images/pixel-data.h>
28 #include <dali/public-api/object/any.h>
29 #include <dali/public-api/object/base-object.h>
30 #include <toolkit-application.h>
31
32 namespace Dali
33 {
34
35 namespace Internal
36 {
37
38 namespace Adaptor
39 {
40
41 class WebEngine;
42
43 namespace
44 {
45
46 // Generally only one WebEngine instance exists.
47 // If > 1, a new web engine has been created by CreateWindowSignal.
48 static WebEngine* gInstance = 0;
49 static int gInstanceCount = 0;
50
51 bool OnGoBack();
52 bool OnGoForward();
53 bool OnLoadUrl();
54 bool OnEvaluteJavaScript();
55 bool OnJavaScriptAlert();
56 bool OnJavaScriptConfirm();
57 bool OnJavaScriptPrompt();
58 bool OnScrollEdge();
59 bool OnClearHistory();
60
61 static void ConnectToGlobalSignal( bool ( *func )() )
62 {
63   Dali::Timer timer = Dali::Timer::New( 0 );
64   timer.TickSignal().Connect( func );
65 }
66
67 static void DisconnectFromGlobalSignal( bool ( *func )() )
68 {
69   Dali::Timer timer = Dali::Timer::New( 0 );
70   timer.TickSignal().Disconnect( func );
71 }
72 } // namespace anonymous
73
74 class MockWebEngineContext : public Dali::WebEngineContext
75 {
76 public:
77   MockWebEngineContext()
78     : mockModel( Dali::WebEngineContext::CacheModel::DOCUMENT_VIEWER )
79   {
80   }
81
82   Dali::WebEngineContext::CacheModel GetCacheModel() const override
83   {
84     return mockModel;
85   }
86
87   void SetCacheModel( Dali::WebEngineContext::CacheModel cacheModel ) override
88   {
89     mockModel = cacheModel;
90   }
91
92   void SetProxyUri( const std::string& uri ) override
93   {
94   }
95
96   void SetDefaultProxyAuth( const std::string& username, const std::string& password ) override
97   {
98   }
99
100   void SetCertificateFilePath( const std::string& certificatePath ) override
101   {
102   }
103
104   void DeleteWebDatabase() override
105   {
106   }
107
108   void DeleteWebStorage() override
109   {
110   }
111
112   void DeleteLocalFileSystem() override
113   {
114   }
115
116   void DisableCache( bool cacheDisabled ) override
117   {
118   }
119
120   void ClearCache() override
121   {
122   }
123
124 private:
125   Dali::WebEngineContext::CacheModel mockModel;
126 };
127
128 class MockWebEngineCookieManager : public Dali::WebEngineCookieManager
129 {
130 public:
131   MockWebEngineCookieManager()
132     : mockCookieAcceptPolicy( Dali::WebEngineCookieManager::CookieAcceptPolicy::NO_THIRD_PARTY )
133   {
134   }
135
136   void SetCookieAcceptPolicy( Dali::WebEngineCookieManager::CookieAcceptPolicy policy ) override
137   {
138     mockCookieAcceptPolicy = policy;
139   }
140
141   Dali::WebEngineCookieManager::CookieAcceptPolicy GetCookieAcceptPolicy() const override
142   {
143     return mockCookieAcceptPolicy;
144   }
145
146   void ClearCookies() override
147   {
148   }
149
150   void SetPersistentStorage( const std::string& path, Dali::WebEngineCookieManager::CookiePersistentStorage storage ) override
151   {
152   }
153
154 private:
155   Dali::WebEngineCookieManager::CookieAcceptPolicy mockCookieAcceptPolicy;
156 };
157
158 class MockWebEngineBackForwardListItem : public Dali::WebEngineBackForwardListItem
159 {
160 public:
161   MockWebEngineBackForwardListItem()
162     : mockUrl( "http://url" ),
163       mockTitle( "title" ),
164       mockOriginalUrl( "http://originalurl" )
165   {
166   }
167
168   std::string GetUrl() const override
169   {
170     return mockUrl;
171   }
172
173   std::string GetTitle() const override
174   {
175     return mockTitle;
176   }
177
178   std::string GetOriginalUrl() const override
179   {
180     return mockOriginalUrl;
181   }
182
183 private:
184   std::string mockUrl;
185   std::string mockTitle;
186   std::string mockOriginalUrl;
187 };
188
189 class MockWebEngineBackForwardList : public Dali::WebEngineBackForwardList
190 {
191 public:
192   MockWebEngineBackForwardList( )
193     : mockItem(),
194       pMockItem( &mockItem )
195   {
196   }
197
198   Dali::WebEngineBackForwardListItem& GetCurrentItem() const override
199   {
200     return *pMockItem;
201   }
202
203   Dali::WebEngineBackForwardListItem& GetItemAtIndex( uint32_t index ) const override
204   {
205     return *pMockItem;
206   }
207
208   uint32_t GetItemCount() const override
209   {
210     return 1;
211   }
212
213 private:
214   MockWebEngineBackForwardListItem mockItem;
215   WebEngineBackForwardListItem* pMockItem;
216 };
217
218 class MockWebEngineSettings : public WebEngineSettings
219 {
220 public:
221   MockWebEngineSettings()
222     : mockDefaultFontSize( 16 ),
223       mockJavaScriptEnabled( true ),
224       mockImageLoadedAutomatically( true ),
225       mockDefaultTextEncodingName()
226   {
227   }
228
229   uint32_t GetDefaultFontSize() const override
230   {
231     return mockDefaultFontSize;
232   }
233
234   void SetDefaultFontSize( uint32_t size ) override
235   {
236     mockDefaultFontSize = size;
237   }
238
239   bool IsJavaScriptEnabled() const override
240   {
241     return mockJavaScriptEnabled;
242   }
243
244   void EnableJavaScript( bool enabled ) override
245   {
246     mockJavaScriptEnabled = enabled;
247   }
248
249   bool AreImagesLoadedAutomatically() const override
250   {
251     return mockImageLoadedAutomatically;
252   }
253
254   void AllowImagesLoadAutomatically( bool automatic ) override
255   {
256     mockImageLoadedAutomatically = automatic;
257   }
258
259   std::string GetDefaultTextEncodingName() const override
260   {
261     return mockDefaultTextEncodingName;
262   }
263
264   void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName ) override
265   {
266     mockDefaultTextEncodingName = defaultTextEncodingName;
267   }
268
269   void AllowMixedContents( bool allowed ) override
270   {
271   }
272
273   void EnableSpatialNavigation( bool enabled ) override
274   {
275   }
276
277   void EnableWebSecurity( bool enabled ) override
278   {
279   }
280
281   void AllowFileAccessFromExternalUrl( bool allowed ) override
282   {
283   }
284
285   void AllowScriptsOpenWindows( bool allowed ) override
286   {
287   }
288
289 private:
290   int mockDefaultFontSize;
291   bool mockJavaScriptEnabled;
292   bool mockImageLoadedAutomatically;
293   std::string mockDefaultTextEncodingName;
294 };
295
296 class WebEngine: public Dali::BaseObject
297 {
298 public:
299
300   using JavaScriptEvaluatedResultCallback = std::function<void(const std::string&)>;
301   using JavaScriptAlertCallback = std::function<bool(const std::string&)>;
302   using JavaScriptConfirmCallback = std::function<bool(const std::string&)>;
303   using JavaScriptPromptCallback = std::function<bool(const std::string&, const std::string&)>;
304
305   WebEngine()
306     : mUrl()
307     , mCurrentPlusOnePos( 0 )
308     , mUserAgent()
309     , mEvaluating( false )
310     , mScrollPosition( 0, 0 )
311     , mScrollSize( 500, 500 )
312     , mContentSize( 500, 500 )
313   {
314     gInstanceCount++;
315     if ( gInstanceCount == 1 ) // only first web engine need be saved.
316     {
317       gInstance = this;
318     }
319
320     mockWebEngineSettings = new MockWebEngineSettings();
321     mockWebEngineContext = new MockWebEngineContext();
322     mockWebEngineCookieManager = new MockWebEngineCookieManager();
323     mockWebEngineBackForwardList = new MockWebEngineBackForwardList();
324   }
325
326   virtual ~WebEngine()
327   {
328     gInstanceCount--;
329     if( !gInstanceCount )
330     {
331       gInstance = 0;
332     }
333
334     delete mockWebEngineSettings;
335     delete mockWebEngineContext;
336     delete mockWebEngineCookieManager;
337     delete mockWebEngineBackForwardList;
338   }
339
340   Dali::WebEngineSettings& GetSettings() const
341   {
342     return *mockWebEngineSettings;
343   }
344
345   Dali::WebEngineContext& GetContext() const
346   {
347     return *mockWebEngineContext;
348   }
349
350   Dali::WebEngineCookieManager& GetCookieManager() const
351   {
352     return *mockWebEngineCookieManager;
353   }
354
355   Dali::WebEngineBackForwardList& GetBackForwardList() const
356   {
357     return *mockWebEngineBackForwardList;
358   }
359
360   void LoadUrl( const std::string& url )
361   {
362     mUrl = url;
363     ConnectToGlobalSignal( &OnLoadUrl );
364   }
365
366   const std::string& GetUrl() const
367   {
368     return mUrl;
369   }
370
371   std::string GetTitle() const
372   {
373     return std::string("title");
374   }
375
376   Dali::PixelData GetFavicon() const
377   {
378     uint8_t* faviconData = new uint8_t[ 16 ];
379
380     faviconData[ 0 ] = 0xff;
381     faviconData[ 1 ] = 0x00;
382     faviconData[ 2 ] = 0x00;
383     faviconData[ 3 ] = 0xff;
384     faviconData[ 4 ] = 0xff;
385     faviconData[ 5 ] = 0x00;
386     faviconData[ 6 ] = 0x00;
387     faviconData[ 7 ] = 0xff;
388     faviconData[ 8 ] = 0xff;
389     faviconData[ 9 ] = 0x00;
390     faviconData[ 10 ] = 0x00;
391     faviconData[ 11 ] = 0xff;
392     faviconData[ 12 ] = 0xff;
393     faviconData[ 13 ] = 0x00;
394     faviconData[ 14 ] = 0x00;
395     faviconData[ 15 ] = 0xff;
396
397     return Dali::PixelData::New( faviconData, 16, 2, 2,
398                                  Dali::Pixel::Format::RGBA8888,
399                                  Dali::PixelData::ReleaseFunction::DELETE_ARRAY );
400   }
401
402   bool CanGoForward() const
403   {
404     return mHistory.size() > mCurrentPlusOnePos;
405   }
406
407   void GoForward()
408   {
409     ConnectToGlobalSignal( &OnGoForward );
410   }
411
412   bool CanGoBack() const
413   {
414     return mCurrentPlusOnePos > 1;
415   }
416
417   void GoBack()
418   {
419     ConnectToGlobalSignal( &OnGoBack );
420   }
421
422   void EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
423   {
424     if( resultHandler )
425     {
426       if( !mEvaluating )
427       {
428         ConnectToGlobalSignal( &OnEvaluteJavaScript );
429       }
430       mResultCallbacks.push_back( resultHandler );
431     }
432   }
433
434   void RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
435   {
436     if ( callback )
437     {
438       ConnectToGlobalSignal( &OnJavaScriptAlert );
439       mJavaScriptAlertCallback = callback;
440     }
441   }
442
443   void RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
444   {
445     if ( callback )
446     {
447       ConnectToGlobalSignal( &OnJavaScriptConfirm );
448       mJavaScriptConfirmCallback = callback;
449     }
450   }
451
452   void RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
453   {
454     if ( callback )
455     {
456       ConnectToGlobalSignal( &OnJavaScriptPrompt );
457       mJavaScriptPromptCallback = callback;
458     }
459   }
460
461   void ClearHistory()
462   {
463     ConnectToGlobalSignal( &OnClearHistory );
464   }
465
466   const std::string& GetUserAgent() const
467   {
468     return mUserAgent;
469   }
470
471   void SetUserAgent( const std::string& userAgent )
472   {
473     mUserAgent = userAgent;
474   }
475
476   void ScrollBy( int dx, int dy )
477   {
478     mScrollPosition += Dali::Vector2( dx, dy );
479     if ( mScrollPosition.y + mScrollSize.height > mContentSize.height )
480     {
481       ConnectToGlobalSignal( &OnScrollEdge );
482     }
483   }
484
485   void SetScrollPosition( int x, int y )
486   {
487     mScrollPosition.x = x;
488     mScrollPosition.y = y;
489   }
490
491   Dali::Vector2 GetScrollPosition() const
492   {
493     return mScrollPosition;
494   }
495
496   Dali::Vector2 GetScrollSize() const
497   {
498     return mScrollSize;
499   }
500
501   Dali::Vector2 GetContentSize() const
502   {
503     return  mContentSize;
504   }
505
506   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadStartedSignal()
507   {
508     return mPageLoadStartedSignal;
509   }
510
511   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadInProgressSignal()
512   {
513     return mPageLoadInProgressSignal;
514   }
515
516   Dali::WebEnginePlugin::WebEnginePageLoadSignalType& PageLoadFinishedSignal()
517   {
518     return mPageLoadFinishedSignal;
519   }
520
521   Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& PageLoadErrorSignal()
522   {
523     return mPageLoadErrorSignal;
524   }
525
526   Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& ScrollEdgeReachedSignal()
527   {
528     return mScrollEdgeReachedSignal;
529   }
530
531   Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& UrlChangedSignal()
532   {
533     return mUrlChangedSignal;
534   }
535
536   std::string                                                mUrl;
537   std::vector< std::string >                                 mHistory;
538   size_t                                                     mCurrentPlusOnePos;
539   std::string                                                mUserAgent;
540   Dali::WebEnginePlugin::WebEnginePageLoadSignalType         mPageLoadStartedSignal;
541   Dali::WebEnginePlugin::WebEnginePageLoadSignalType         mPageLoadInProgressSignal;
542   Dali::WebEnginePlugin::WebEnginePageLoadSignalType         mPageLoadFinishedSignal;
543   Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType    mPageLoadErrorSignal;
544   std::vector<JavaScriptEvaluatedResultCallback>             mResultCallbacks;
545   bool                                                       mEvaluating;
546
547   Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType mScrollEdgeReachedSignal;
548   Dali::Vector2                                               mScrollPosition;
549   Dali::Vector2                                               mScrollSize;
550   Dali::Vector2                                               mContentSize;
551   WebEngineBackForwardList*                                   mockWebEngineBackForwardList;
552   WebEngineContext*                                           mockWebEngineContext;
553   WebEngineCookieManager*                                     mockWebEngineCookieManager;
554   WebEngineSettings*                                          mockWebEngineSettings;
555   Dali::WebEnginePlugin::WebEngineUrlChangedSignalType        mUrlChangedSignal;
556
557   JavaScriptAlertCallback                                     mJavaScriptAlertCallback;
558   JavaScriptConfirmCallback                                   mJavaScriptConfirmCallback;
559   JavaScriptPromptCallback                                    mJavaScriptPromptCallback;
560 };
561
562
563 namespace
564 {
565
566 bool OnGoBack()
567 {
568   DisconnectFromGlobalSignal( &OnGoBack );
569
570   if( gInstance && gInstance->CanGoBack() )
571   {
572     gInstance->mCurrentPlusOnePos--;
573   }
574   return false;
575 }
576
577 bool OnGoForward()
578 {
579   DisconnectFromGlobalSignal( &OnGoForward );
580
581   if( gInstance && gInstance->CanGoForward() )
582   {
583     gInstance->mCurrentPlusOnePos++;
584   }
585   return false;
586 }
587
588 bool OnLoadUrl()
589 {
590   DisconnectFromGlobalSignal( &OnLoadUrl );
591
592   if( gInstance )
593   {
594     if( gInstance->mHistory.size() > gInstance->mCurrentPlusOnePos )
595     {
596       gInstance->mHistory.erase( gInstance->mHistory.begin() + gInstance->mCurrentPlusOnePos, gInstance->mHistory.end() );
597     }
598     gInstance->mHistory.push_back( gInstance->mUrl );
599     gInstance->mCurrentPlusOnePos++;
600     gInstance->mPageLoadStartedSignal.Emit( gInstance->mUrl );
601     gInstance->mPageLoadInProgressSignal.Emit( gInstance->mUrl );
602     gInstance->mPageLoadFinishedSignal.Emit( gInstance->mUrl );
603     gInstance->mUrlChangedSignal.Emit( "http://new-test" );
604   }
605   return false;
606 }
607
608 bool OnScrollEdge()
609 {
610   DisconnectFromGlobalSignal( &OnScrollEdge );
611
612   if( gInstance )
613   {
614     gInstance->mScrollEdgeReachedSignal.Emit( Dali::WebEnginePlugin::ScrollEdge::BOTTOM );
615   }
616
617   return false;
618 }
619
620 bool OnEvaluteJavaScript()
621 {
622   DisconnectFromGlobalSignal( &OnEvaluteJavaScript );
623
624   if( gInstance )
625   {
626     for( auto& func : gInstance->mResultCallbacks )
627     {
628       func("undefined");
629     }
630     gInstance->mResultCallbacks.clear();
631   }
632   return false;
633 }
634
635 bool OnJavaScriptAlert()
636 {
637   DisconnectFromGlobalSignal( &OnJavaScriptAlert );
638   if ( gInstance )
639   {
640     gInstance->mJavaScriptAlertCallback( "this is an alert popup." );
641   }
642   return false;
643 }
644
645 bool OnJavaScriptConfirm()
646 {
647   DisconnectFromGlobalSignal( &OnJavaScriptConfirm );
648   if ( gInstance )
649   {
650     gInstance->mJavaScriptConfirmCallback( "this is a confirm popup." );
651   }
652   return false;
653 }
654
655 bool OnJavaScriptPrompt()
656 {
657   DisconnectFromGlobalSignal( &OnJavaScriptPrompt );
658   if ( gInstance )
659   {
660     gInstance->mJavaScriptPromptCallback( "this is a prompt pompt.", "" );
661   }
662   return false;
663 }
664
665 bool OnClearHistory()
666 {
667   DisconnectFromGlobalSignal( &OnClearHistory );
668
669   if( gInstance && gInstance->mCurrentPlusOnePos )
670   {
671     std::string url = gInstance->mHistory[ gInstance->mCurrentPlusOnePos - 1 ];
672     std::vector< std::string >().swap( gInstance->mHistory );
673     gInstance->mHistory.push_back( url );
674     gInstance->mCurrentPlusOnePos = 1;
675   }
676   return false;
677 }
678
679 } // namespace
680
681 inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )
682 {
683   DALI_ASSERT_ALWAYS( webEngine && "WebEngine handle is empty." );
684   BaseObject& handle = webEngine.GetBaseObject();
685   return static_cast< Internal::Adaptor::WebEngine& >( handle );
686 }
687
688 inline const WebEngine& GetImplementation( const Dali::WebEngine& webEngine )
689 {
690   DALI_ASSERT_ALWAYS( webEngine && "WebEngine handle is empty." );
691   const BaseObject& handle = webEngine.GetBaseObject();
692   return static_cast< const Internal::Adaptor::WebEngine& >( handle );
693 }
694
695 } // namespace Adaptor
696
697 } // namespace Internal
698
699 // Dali::WebEngine Implementation
700 WebEngine::WebEngine()
701 {
702 }
703
704 WebEngine::WebEngine( Internal::Adaptor::WebEngine* internal )
705 : BaseHandle( internal )
706 {
707 }
708
709 WebEngine::~WebEngine()
710 {
711 }
712
713 WebEngine WebEngine::New()
714 {
715   Internal::Adaptor::WebEngine* baseObject = new Internal::Adaptor::WebEngine();
716
717   return WebEngine( baseObject );
718 }
719
720 WebEngine::WebEngine( const WebEngine& WebEngine )
721 : BaseHandle( WebEngine )
722 {
723 }
724
725 WebEngine& WebEngine::operator=( const WebEngine& webEngine )
726 {
727   BaseHandle::operator=( webEngine );
728   return *this;
729 }
730
731 WebEngine WebEngine::DownCast( BaseHandle handle )
732 {
733   return WebEngine( dynamic_cast< Internal::Adaptor::WebEngine* >( handle.GetObjectPtr() ) );
734 }
735
736 void WebEngine::Create( int width, int height, const std::string& locale, const std::string& timezoneId )
737 {
738 }
739
740 void WebEngine::Create( int width, int height, int argc, char** argv )
741 {
742 }
743
744 void WebEngine::Destroy()
745 {
746 }
747
748 WebEngineSettings& WebEngine::GetSettings() const
749 {
750   return Internal::Adaptor::GetImplementation( *this ).GetSettings();
751 }
752
753 WebEngineContext& WebEngine::GetContext() const
754 {
755   return Internal::Adaptor::GetImplementation( *this ).GetContext();
756 }
757
758 WebEngineCookieManager& WebEngine::GetCookieManager() const
759 {
760   return Internal::Adaptor::GetImplementation( *this ).GetCookieManager();
761 }
762
763 WebEngineBackForwardList& WebEngine::GetBackForwardList() const
764 {
765   return Internal::Adaptor::GetImplementation( *this ).GetBackForwardList();
766 }
767
768 void WebEngine::LoadUrl( const std::string& url )
769 {
770   return Internal::Adaptor::GetImplementation( *this ).LoadUrl( url );
771 }
772
773 std::string WebEngine::GetTitle() const
774 {
775   return Internal::Adaptor::GetImplementation( *this ).GetTitle();
776 }
777
778 Dali::PixelData WebEngine::GetFavicon() const
779 {
780   return Internal::Adaptor::GetImplementation( *this ).GetFavicon();
781 }
782
783 const std::string& WebEngine::GetUrl()
784 {
785   return Internal::Adaptor::GetImplementation( *this ).GetUrl();
786 }
787
788 NativeImageInterfacePtr WebEngine::GetNativeImageSource()
789 {
790   Any source;
791   Dali::NativeImageSourcePtr sourcePtr = Dali::NativeImageSource::New( source );
792   return sourcePtr;
793 }
794
795 void WebEngine::LoadHtmlString( const std::string& htmlString )
796 {
797 }
798
799 void WebEngine::Reload()
800 {
801 }
802
803 void WebEngine::StopLoading()
804 {
805 }
806
807 void WebEngine::Suspend()
808 {
809 }
810
811 void WebEngine::Resume()
812 {
813 }
814
815 bool WebEngine::CanGoForward()
816 {
817   return Internal::Adaptor::GetImplementation( *this ).CanGoForward();
818 }
819
820 void WebEngine::GoForward()
821 {
822   Internal::Adaptor::GetImplementation( *this ).GoForward();
823 }
824
825 bool WebEngine::CanGoBack()
826 {
827   return Internal::Adaptor::GetImplementation( *this ).CanGoBack();
828 }
829
830 void WebEngine::GoBack()
831 {
832   Internal::Adaptor::GetImplementation( *this ).GoBack();
833 }
834
835 void WebEngine::EvaluateJavaScript( const std::string& script, std::function< void( const std::string& ) > resultHandler )
836 {
837   Internal::Adaptor::GetImplementation( *this ).EvaluateJavaScript( script, resultHandler );
838 }
839
840 void WebEngine::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void(const std::string&) > handler )
841 {
842 }
843
844 void WebEngine::RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
845 {
846   Internal::Adaptor::GetImplementation( *this ).RegisterJavaScriptAlertCallback( callback );
847 }
848
849 void WebEngine::JavaScriptAlertReply()
850 {
851 }
852
853 void WebEngine::RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
854 {
855   Internal::Adaptor::GetImplementation( *this ).RegisterJavaScriptConfirmCallback( callback );
856 }
857
858 void WebEngine::JavaScriptConfirmReply( bool confirmed )
859 {
860 }
861
862 void WebEngine::RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
863 {
864   Internal::Adaptor::GetImplementation( *this ).RegisterJavaScriptPromptCallback( callback );
865 }
866
867 void WebEngine::JavaScriptPromptReply( const std::string& result )
868 {
869 }
870
871 void WebEngine::ClearAllTilesResources()
872 {
873 }
874
875 void WebEngine::ClearHistory()
876 {
877   Internal::Adaptor::GetImplementation( *this ).ClearHistory();
878 }
879
880 const std::string& WebEngine::GetUserAgent() const
881 {
882   return Internal::Adaptor::GetImplementation( *this ).GetUserAgent();
883 }
884
885 void WebEngine::SetUserAgent( const std::string& userAgent )
886 {
887   Internal::Adaptor::GetImplementation( *this ).SetUserAgent( userAgent );
888 }
889
890 void WebEngine::ScrollBy( int dx, int dy )
891 {
892   Internal::Adaptor::GetImplementation( *this ).ScrollBy( dx, dy );
893 }
894
895 void WebEngine::SetScrollPosition( int x, int y )
896 {
897   Internal::Adaptor::GetImplementation( *this ).SetScrollPosition( x, y );
898 }
899
900 Dali::Vector2 WebEngine::GetScrollPosition() const
901 {
902   return Internal::Adaptor::GetImplementation( *this ).GetScrollPosition();
903 }
904
905 Dali::Vector2 WebEngine::GetScrollSize() const
906 {
907   return Internal::Adaptor::GetImplementation( *this ).GetScrollSize();
908 }
909
910 Dali::Vector2 WebEngine::GetContentSize() const
911 {
912   return Internal::Adaptor::GetImplementation( *this ).GetContentSize();
913 }
914
915 void WebEngine::SetSize( int width, int height )
916 {
917 }
918
919 bool WebEngine::SendTouchEvent( const TouchEvent& touch )
920 {
921   return true;
922 }
923
924 bool WebEngine::SendKeyEvent( const KeyEvent& event )
925 {
926   return true;
927 }
928
929 void WebEngine::SetFocus( bool focused )
930 {
931 }
932
933 void WebEngine::UpdateDisplayArea( Dali::Rect< int > displayArea )
934 {
935 }
936
937 void WebEngine::EnableVideoHole( bool enabled )
938 {
939 }
940
941 Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadStartedSignal()
942 {
943   return Internal::Adaptor::GetImplementation( *this ).PageLoadStartedSignal();
944 }
945
946 Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadInProgressSignal()
947 {
948   return Internal::Adaptor::GetImplementation( *this ).PageLoadInProgressSignal();
949 }
950
951 Dali::WebEnginePlugin::WebEnginePageLoadSignalType& WebEngine::PageLoadFinishedSignal()
952 {
953   return Internal::Adaptor::GetImplementation( *this ).PageLoadFinishedSignal();
954 }
955
956 Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType& WebEngine::PageLoadErrorSignal()
957 {
958   return Internal::Adaptor::GetImplementation( *this ).PageLoadErrorSignal();
959 }
960
961 Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType& WebEngine::ScrollEdgeReachedSignal()
962 {
963   return Internal::Adaptor::GetImplementation( *this ).ScrollEdgeReachedSignal();
964 }
965
966 Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& WebEngine::UrlChangedSignal()
967 {
968   return Internal::Adaptor::GetImplementation( *this ).UrlChangedSignal();
969 }
970
971 } // namespace Dali;
972