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