bba91c6a93f5f4c685e50a3409df05fee2f897a7
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / web-view / web-context.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 // CLASS HEADER
19 #include <dali-toolkit/devel-api/controls/web-view/web-context.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28 WebContext::WebContext(Dali::WebEngineContext& context)
29 : mWebEngineContext(context)
30 {
31 }
32
33 WebContext::~WebContext()
34 {
35 }
36
37 Dali::WebEngineContext::CacheModel WebContext::GetCacheModel() const
38 {
39   return mWebEngineContext.GetCacheModel();
40 }
41
42 void WebContext::SetCacheModel(Dali::WebEngineContext::CacheModel cacheModel)
43 {
44   mWebEngineContext.SetCacheModel(cacheModel);
45 }
46
47 void WebContext::SetProxyUri(const std::string& uri)
48 {
49   mWebEngineContext.SetProxyUri(uri);
50 }
51
52 std::string WebContext::GetProxyUri() const
53 {
54   return mWebEngineContext.GetProxyUri();
55 }
56
57 void WebContext::SetProxyBypassRule(const std::string& proxy, const std::string& bypass)
58 {
59   mWebEngineContext.SetProxyBypassRule(proxy, bypass);
60 }
61
62 std::string WebContext::GetProxyBypassRule() const
63 {
64   return mWebEngineContext.GetProxyBypassRule();
65 }
66
67 void WebContext::SetCertificateFilePath(const std::string& certificatePath)
68 {
69   mWebEngineContext.SetCertificateFilePath(certificatePath);
70 }
71
72 std::string WebContext::GetCertificateFilePath() const
73 {
74   return mWebEngineContext.GetCertificateFilePath();
75 }
76
77 void WebContext::SetDefaultProxyAuth(const std::string& username, const std::string& password)
78 {
79   mWebEngineContext.SetDefaultProxyAuth(username, password);
80 }
81
82 void WebContext::DeleteAllWebDatabase()
83 {
84   mWebEngineContext.DeleteAllWebDatabase();
85 }
86
87 bool WebContext::GetWebDatabaseOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
88 {
89   return mWebEngineContext.GetWebDatabaseOrigins(callback);
90 }
91
92 bool WebContext::DeleteWebDatabase(Dali::WebEngineSecurityOrigin& origin)
93 {
94   return mWebEngineContext.DeleteWebDatabase(origin);
95 }
96
97 bool WebContext::GetWebStorageOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
98 {
99   return mWebEngineContext.GetWebStorageOrigins(callback);
100 }
101
102 bool WebContext::GetWebStorageUsageForOrigin(Dali::WebEngineSecurityOrigin& origin, Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback callback)
103 {
104   return mWebEngineContext.GetWebStorageUsageForOrigin(origin, callback);
105 }
106
107 void WebContext::DeleteAllWebStorage()
108 {
109   mWebEngineContext.DeleteAllWebStorage();
110 }
111
112 bool WebContext::DeleteWebStorage(Dali::WebEngineSecurityOrigin& origin)
113 {
114   return mWebEngineContext.DeleteWebStorage(origin);
115 }
116
117 void WebContext::DeleteLocalFileSystem()
118 {
119   mWebEngineContext.DeleteLocalFileSystem();
120 }
121
122 void WebContext::ClearCache()
123 {
124   mWebEngineContext.ClearCache();
125 }
126
127 bool WebContext::DeleteApplicationCache(Dali::WebEngineSecurityOrigin& origin)
128 {
129   return mWebEngineContext.DeleteApplicationCache(origin);
130 }
131
132 void WebContext::GetFormPasswordList(Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback callback)
133 {
134   mWebEngineContext.GetFormPasswordList(callback);
135 }
136
137 void WebContext::RegisterDownloadStartedCallback(Dali::WebEngineContext::WebEngineDownloadStartedCallback callback)
138 {
139   mWebEngineContext.RegisterDownloadStartedCallback(callback);
140 }
141
142 void WebContext::RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback)
143 {
144   mWebEngineContext.RegisterMimeOverriddenCallback(callback);
145 }
146
147 void WebContext::RegisterRequestInterceptedCallback(Dali::WebEngineContext::WebEngineRequestInterceptedCallback callback)
148 {
149   mWebEngineContext.RegisterRequestInterceptedCallback(callback);
150 }
151
152 void WebContext::EnableCache(bool cacheEnabled)
153 {
154   mWebEngineContext.EnableCache(cacheEnabled);
155 }
156
157 bool WebContext::IsCacheEnabled() const
158 {
159   return mWebEngineContext.IsCacheEnabled();
160 }
161
162 void WebContext::SetAppId(const std::string& appId)
163 {
164   mWebEngineContext.SetAppId(appId);
165 }
166
167 bool WebContext::SetAppVersion(const std::string& appVersion)
168 {
169   return mWebEngineContext.SetAppVersion(appVersion);
170 }
171
172 void WebContext::SetApplicationType(const Dali::WebEngineContext::ApplicationType applicationType)
173 {
174   mWebEngineContext.SetApplicationType(applicationType);
175 }
176
177 void WebContext::SetTimeOffset(float timeOffset)
178 {
179   mWebEngineContext.SetTimeOffset(timeOffset);
180 }
181
182 void WebContext::SetTimeZoneOffset(float timeZoneOffset, float daylightSavingTime)
183 {
184   mWebEngineContext.SetTimeZoneOffset(timeZoneOffset, daylightSavingTime);
185 }
186
187 void WebContext::SetDefaultZoomFactor(float zoomFactor)
188 {
189   mWebEngineContext.SetDefaultZoomFactor(zoomFactor);
190 }
191
192 float WebContext::GetDefaultZoomFactor() const
193 {
194   return mWebEngineContext.GetDefaultZoomFactor();
195 }
196
197 void WebContext::RegisterUrlSchemesAsCorsEnabled(const std::vector<std::string>& schemes)
198 {
199   mWebEngineContext.RegisterUrlSchemesAsCorsEnabled(schemes);
200 }
201
202 void WebContext::RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeTypes)
203 {
204   mWebEngineContext.RegisterJsPluginMimeTypes(mimeTypes);
205 }
206
207 bool WebContext::DeleteAllApplicationCache()
208 {
209   return mWebEngineContext.DeleteAllApplicationCache();
210 }
211
212 bool WebContext::DeleteAllWebIndexedDatabase()
213 {
214   return mWebEngineContext.DeleteAllWebIndexedDatabase();
215 }
216
217 void WebContext::DeleteFormPasswordDataList(const std::vector<std::string>& list)
218 {
219   mWebEngineContext.DeleteFormPasswordDataList(list);
220 }
221
222 void WebContext::DeleteAllFormPasswordData()
223 {
224   mWebEngineContext.DeleteAllFormPasswordData();
225 }
226
227 void WebContext::DeleteAllFormCandidateData()
228 {
229   mWebEngineContext.DeleteAllFormCandidateData();
230 }
231
232 bool WebContext::FreeUnusedMemory()
233 {
234   return mWebEngineContext.FreeUnusedMemory();
235 }
236
237 } // namespace Toolkit
238 } // namespace Dali