summaryrefslogtreecommitdiff
path: root/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs
diff options
context:
space:
mode:
authoryh106.jung <yh106.jung@samsung.com>2017-02-17 04:12:56 (GMT)
committeryh106.jung <yh106.jung@samsung.com>2017-03-17 05:39:14 (GMT)
commitaca675d31f77ab8373bc5487cd0ef8fc882cf831 (patch)
tree54a0f4146b2421c636c89fadfadc033d3a802bf5 /Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs
parentcea70b4434ca284d84beda6ecfc9639de441f499 (diff)
downloadwebview-accepted/tizen_ivi.zip
webview-accepted/tizen_ivi.tar.gz
webview-accepted/tizen_ivi.tar.bz2
This patch introduces Tizen.WebView project. Plus, Tizen.WebView.Test project is included in order to test basic functionality of Tizen.WebView. Change-Id: I79b01c2c18817f399f83a3e56cc5cd8ceae3322f Signed-off-by: yh106.jung <yh106.jung@samsung.com>
Diffstat (limited to 'Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs')
-rw-r--r--Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs127
1 files changed, 127 insertions, 0 deletions
diff --git a/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs b/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs
new file mode 100644
index 0000000..e507ca8
--- /dev/null
+++ b/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class ChromiumEwk
+ {
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern IntPtr ewk_view_add(IntPtr evas);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern IntPtr ewk_view_context_get(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ internal static extern IntPtr ewk_view_settings_get(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_url_set(IntPtr obj, string url);
+
+ [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_view_url_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _ewk_view_url_get(IntPtr obj);
+
+ internal static string ewk_view_url_get(IntPtr obj)
+ {
+ IntPtr ptr = _ewk_view_url_get(obj);
+ return Marshal.PtrToStringAnsi(ptr);
+ }
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_html_string_load(IntPtr obj, string html, string baseUrl, string unreachableUrl);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_reload(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_stop(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_back(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_forward(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_back_possible(IntPtr obj);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_forward_possible(IntPtr obj);
+
+ internal delegate void ScriptExcuteCallback(IntPtr obj, IntPtr resultValue, IntPtr userData);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_script_execute(IntPtr obj, string script, ScriptExcuteCallback callback, IntPtr userData);
+
+ [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_view_title_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _ewk_view_title_get(IntPtr obj);
+
+ internal static string ewk_view_title_get(IntPtr obj)
+ {
+ IntPtr ptr = _ewk_view_url_get(obj);
+ return Marshal.PtrToStringAnsi(ptr);
+ }
+
+ [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_view_user_agent_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _ewk_view_user_agent_get(IntPtr obj);
+
+ internal static string ewk_view_user_agent_get(IntPtr obj)
+ {
+ IntPtr ptr = _ewk_view_user_agent_get(obj);
+ return Marshal.PtrToStringAnsi(ptr);
+ }
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_user_agent_set(IntPtr obj, string userAgent);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_focus_set(IntPtr obj, bool focused);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_focus_get(IntPtr obj);
+
+ [StructLayout(LayoutKind.Sequential, CharSet =CharSet.Ansi)]
+ internal struct ScriptMessage
+ {
+ public IntPtr name;
+ public IntPtr body;
+ }
+
+ internal delegate void ScriptMessageCallback(IntPtr obj, ScriptMessage message);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_javascript_message_handler_add(IntPtr obj, ScriptMessageCallback callback, string name);
+
+ [DllImport(Libraries.ChromiumEwk)]
+ [return: MarshalAs(UnmanagedType.U1)]
+ internal static extern bool ewk_view_evaluate_javascript(IntPtr obj, string name, string result);
+ }
+}