Change WebView API
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / web-view / web-view.cpp
1 /*
2  * Copyright (c) 2018 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 // CLASS HEADER
19 #include <dali-toolkit/devel-api/controls/web-view/web-view.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/controls/web-view/web-view-impl.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 WebView::WebView()
31 {
32 }
33
34 WebView::WebView( const WebView& WebView )
35 : Control( WebView )
36 {
37 }
38
39 WebView& WebView::operator=( const WebView& view )
40 {
41   if( &view != this )
42   {
43     Control::operator=( view );
44   }
45
46   return *this;
47 }
48
49 WebView::~WebView()
50 {
51 }
52
53 WebView WebView::New()
54 {
55   return Internal::WebView::New();
56 }
57
58 WebView WebView::New( const std::string& locale, const std::string& timezoneId )
59 {
60   return Internal::WebView::New( locale, timezoneId );
61 }
62
63 WebView WebView::DownCast( BaseHandle handle )
64 {
65   return Control::DownCast< WebView, Internal::WebView >( handle );
66 }
67
68 void WebView::LoadUrl( const std::string& url )
69 {
70   Dali::Toolkit::GetImpl( *this ).LoadUrl( url );
71 }
72
73 const std::string& WebView::GetUrl()
74 {
75   return Dali::Toolkit::GetImpl( *this ).GetUrl();
76 }
77
78 void WebView::LoadHTMLString( const std::string& htmlString )
79 {
80   Dali::Toolkit::GetImpl( *this ).LoadHTMLString( htmlString );
81 }
82
83 void WebView::Reload()
84 {
85   Dali::Toolkit::GetImpl( *this ).Reload();
86 }
87
88 void WebView::StopLoading()
89 {
90   Dali::Toolkit::GetImpl( *this ).StopLoading();
91 }
92
93 bool WebView::CanGoForward()
94 {
95   return Dali::Toolkit::GetImpl( *this ).CanGoForward();
96 }
97
98 void WebView::GoForward()
99 {
100   Dali::Toolkit::GetImpl( *this ).GoForward();
101 }
102
103 bool WebView::CanGoBack()
104 {
105   return Dali::Toolkit::GetImpl( *this ).CanGoBack();
106 }
107
108 void WebView::GoBack()
109 {
110   Dali::Toolkit::GetImpl( *this ).GoBack();
111 }
112
113 void WebView::EvaluateJavaScript( const std::string& script )
114 {
115   Dali::Toolkit::GetImpl( *this ).EvaluateJavaScript( script );
116 }
117
118 void WebView::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler )
119 {
120   Dali::Toolkit::GetImpl( *this ).AddJavaScriptMessageHandler( exposedObjectName, handler );
121 }
122
123 void WebView::ClearHistory()
124 {
125   Dali::Toolkit::GetImpl( *this ).ClearHistory();
126 }
127
128 void WebView::ClearCache()
129 {
130   Dali::Toolkit::GetImpl( *this ).ClearCache();
131 }
132
133 WebView::WebViewSignalType& WebView::PageLoadStartedSignal()
134 {
135   return Dali::Toolkit::GetImpl( *this ).PageLoadStartedSignal();
136 }
137
138 WebView::WebViewSignalType& WebView::PageLoadFinishedSignal()
139 {
140   return Dali::Toolkit::GetImpl( *this ).PageLoadFinishedSignal();
141 }
142
143 WebView::WebView( Internal::WebView& implementation )
144 : Control( implementation )
145 {
146 }
147
148 WebView::WebView( Dali::Internal::CustomActor* internal )
149 : Control( internal )
150 {
151   VerifyCustomActorPointer< Internal::WebView >( internal );
152 }
153
154 } // namespace Toolkit
155
156 } // namespace Dali