From febab8fd533c0a4ec9d4297a18c79ebedbaba4ad Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Fri, 11 Aug 2017 11:22:53 +0900 Subject: [PATCH] Fix CRLF to LF in some files Change-Id: I2c9244bdc5c5dfa252a8d421f4f8d340b61817b9 --- .../Interop/Interop.WidgetViewerEvas.cs | 4 +- .../Tizen.Applications/WatchApplication.cs | 4 +- .../MediaController/MediaControllerMetadata.cs | 4 +- .../MediaController/MediaControllerPlayback.cs | 4 +- .../AudioDeviceConnectionChangedEventArgs.cs | 84 +-- .../AudioDeviceStateChangedEventArgs.cs | 84 +-- .../AudioManager/FocusStateChangedEventArgs.cs | 96 +-- .../StreamFocusStateChangedEventArgs.cs | 86 +-- .../AudioManager/VolumeChangedEventArgs.cs | 84 +-- src/Tizen.Multimedia/Interop/Interop.Device.cs | 6 +- .../Interop/Interop.StreamPolicy.cs | 4 +- src/Tizen.Multimedia/Interop/Interop.Volume.cs | 6 +- src/Tizen.NUI/src/internal/WeakEventHandler.cs | 64 +- .../src/internal/dotnetcore/AddedException.cs | 108 ++-- src/Tizen.NUI/src/internal/dotnetcore/HandleRef.cs | 110 ++-- .../Interop/Interop.Bluetooth.cs | 2 +- .../Tizen.Network.Smartcard/SmartcardChannel.cs | 4 +- .../Tizen.Network.Smartcard/SmartcardManager.cs | 94 +-- .../RuntimeInfo/RuntimeInformation.cs | 66 +- .../Interop/Interop.EinaList.cs | 68 +- .../AccessibilityStateChangedEventArgs.cs | 74 +-- .../DisplayLanaguageChangedEventArgs.cs | 74 +-- .../InputMethodExceptionFactory.cs | 166 ++--- .../ReturnKeyStateSetEventArgs.cs | 74 +-- .../Interop/Interop.InputMethodManager.cs | 114 ++-- .../InputMethodManager.cs | 314 +++++----- .../InputMethodManagerExceptionFactory.cs | 32 +- .../Interop/Interop.ChromiumEwk.Context.cs | 82 +-- .../Interop/Interop.ChromiumEwk.CookieManager.cs | 92 +-- .../Interop/Interop.ChromiumEwk.Error.cs | 98 +-- .../Interop/Interop.ChromiumEwk.Settings.cs | 120 ++-- .../Interop/Interop.ChromiumEwk.View.cs | 254 ++++---- src/Tizen.WebView/Interop/Interop.ChromiumEwk.cs | 58 +- src/Tizen.WebView/Interop/Interop.Elementary.cs | 72 +-- src/Tizen.WebView/Interop/Interop.Evas.cs | 54 +- src/Tizen.WebView/Interop/Interop.Libraries.cs | 48 +- src/Tizen.WebView/Tizen.WebView/Chromium.cs | 78 +-- src/Tizen.WebView/Tizen.WebView/Context.cs | 156 ++--- src/Tizen.WebView/Tizen.WebView/CookieManager.cs | 164 ++--- .../Tizen.WebView/JavaScriptMessage.cs | 208 +++---- src/Tizen.WebView/Tizen.WebView/Settings.cs | 188 +++--- .../Tizen.WebView/SmartCallbackArgs.cs | 186 +++--- .../Tizen.WebView/SmartCallbackLoadErrorArgs.cs | 300 ++++----- src/Tizen.WebView/Tizen.WebView/WebView.cs | 684 ++++++++++----------- test/Tizen.Tapitest/Tizen.Tapitest.csproj | 224 +++---- test/Tizen.Tapitest/Tizen.Tapitest.project.json | 52 +- test/Tizen.WebView.Test/Properties/AssemblyInfo.cs | 72 +-- 47 files changed, 2510 insertions(+), 2510 deletions(-) diff --git a/src/Tizen.Applications.RemoteView/Interop/Interop.WidgetViewerEvas.cs b/src/Tizen.Applications.RemoteView/Interop/Interop.WidgetViewerEvas.cs index cdc4066..30ca171 100755 --- a/src/Tizen.Applications.RemoteView/Interop/Interop.WidgetViewerEvas.cs +++ b/src/Tizen.Applications.RemoteView/Interop/Interop.WidgetViewerEvas.cs @@ -89,7 +89,7 @@ internal static partial class Interop internal static extern void DisablePreview(IntPtr widget); [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_disable_overlay_text")] - internal static extern void DisableOverlayText(IntPtr widget); - + internal static extern void DisableOverlayText(IntPtr widget); + } } diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchApplication.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchApplication.cs index 01939fb..f739b47 100755 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchApplication.cs +++ b/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchApplication.cs @@ -131,8 +131,8 @@ namespace Tizen.Applications protected virtual void OnTick(TimeEventArgs time) { TimeTick?.Invoke(this, time); - } - + } + /// /// Overrides this method if want to handle behavior when the time tick event comes in ambient mode. /// If base.OnAmbientTick() is not called, the event 'AmbientTick' will not be emitted. diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerMetadata.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerMetadata.cs index d570faf..1b0968b 100755 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerMetadata.cs +++ b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerMetadata.cs @@ -75,8 +75,8 @@ namespace Tizen.Multimedia.MediaController /// Set/Get the Author of media /// /// 3 - public string Author { get; set; } - + public string Author { get; set; } + /// /// Set/Get the Genre of media /// diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerPlayback.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerPlayback.cs index 293f58a..52143e5 100755 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerPlayback.cs +++ b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerPlayback.cs @@ -58,8 +58,8 @@ namespace Tizen.Multimedia.MediaController State = state; Position = position; - } - + } + /// /// Set/Get the State of playback information /// diff --git a/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs index b5a54dd..9369a99 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs @@ -1,42 +1,42 @@ - /* - * Copyright (c) 2016 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; - -namespace Tizen.Multimedia -{ - /// - /// Class extending EventArgs which contains parameters to be passed to event handler of DeviceConnected event - /// - public class AudioDeviceConnectionChangedEventArgs : EventArgs - { - internal AudioDeviceConnectionChangedEventArgs(AudioDevice device, bool isConnected) - { - Device = device; - IsConnected = isConnected; - } - - /// - /// The object of sound device - /// - public AudioDevice Device { get; } - - /// - /// The state of device connection: (true = connected, false = disconnected) - /// - public bool IsConnected { get; } - } -} + /* + * Copyright (c) 2016 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; + +namespace Tizen.Multimedia +{ + /// + /// Class extending EventArgs which contains parameters to be passed to event handler of DeviceConnected event + /// + public class AudioDeviceConnectionChangedEventArgs : EventArgs + { + internal AudioDeviceConnectionChangedEventArgs(AudioDevice device, bool isConnected) + { + Device = device; + IsConnected = isConnected; + } + + /// + /// The object of sound device + /// + public AudioDevice Device { get; } + + /// + /// The state of device connection: (true = connected, false = disconnected) + /// + public bool IsConnected { get; } + } +} diff --git a/src/Tizen.Multimedia/AudioManager/AudioDeviceStateChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/AudioDeviceStateChangedEventArgs.cs index 34bc165..41a5564 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioDeviceStateChangedEventArgs.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioDeviceStateChangedEventArgs.cs @@ -1,42 +1,42 @@ - /* - * Copyright (c) 2016 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; - -namespace Tizen.Multimedia -{ - /// - /// Class extending EventArgs which contains parameters to be passed to event handler of DeviceInformationChanged event - /// - public class AudioDeviceStateChangedEventArgs : EventArgs - { - internal AudioDeviceStateChangedEventArgs(AudioDevice device, AudioDeviceState changedState) - { - Device = device; - ChangedState = changedState; - } - - /// - /// The object of sound device - /// - public AudioDevice Device { get; } - - /// - /// The entry of sound device state - /// - public AudioDeviceState ChangedState { get; } - } -} + /* + * Copyright (c) 2016 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; + +namespace Tizen.Multimedia +{ + /// + /// Class extending EventArgs which contains parameters to be passed to event handler of DeviceInformationChanged event + /// + public class AudioDeviceStateChangedEventArgs : EventArgs + { + internal AudioDeviceStateChangedEventArgs(AudioDevice device, AudioDeviceState changedState) + { + Device = device; + ChangedState = changedState; + } + + /// + /// The object of sound device + /// + public AudioDevice Device { get; } + + /// + /// The entry of sound device state + /// + public AudioDeviceState ChangedState { get; } + } +} diff --git a/src/Tizen.Multimedia/AudioManager/FocusStateChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/FocusStateChangedEventArgs.cs index 63dc4b3..cf17aae 100644 --- a/src/Tizen.Multimedia/AudioManager/FocusStateChangedEventArgs.cs +++ b/src/Tizen.Multimedia/AudioManager/FocusStateChangedEventArgs.cs @@ -1,48 +1,48 @@ - /* - * Copyright (c) 2016 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; - -namespace Tizen.Multimedia -{ - /// - /// Class extending EventArgs and contains the necessary parameters to passed to FocusStateWatch event handler - /// - public class FocusStateChangedEventArgs : EventArgs - { - internal FocusStateChangedEventArgs(AudioStreamFocusState focusState, AudioStreamFocusChangedReason reason, string extraInformation) - { - FocusState = focusState; - FocusChangedReason = reason; - ExtraInformation = extraInformation; - } - - /// - /// The changed focus state - /// - public AudioStreamFocusState FocusState { get; } - - /// - /// The reason for state change of the focus - /// - public AudioStreamFocusChangedReason FocusChangedReason { get; } - - /// - /// The extra information - /// - public string ExtraInformation { get; } - } -} + /* + * Copyright (c) 2016 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; + +namespace Tizen.Multimedia +{ + /// + /// Class extending EventArgs and contains the necessary parameters to passed to FocusStateWatch event handler + /// + public class FocusStateChangedEventArgs : EventArgs + { + internal FocusStateChangedEventArgs(AudioStreamFocusState focusState, AudioStreamFocusChangedReason reason, string extraInformation) + { + FocusState = focusState; + FocusChangedReason = reason; + ExtraInformation = extraInformation; + } + + /// + /// The changed focus state + /// + public AudioStreamFocusState FocusState { get; } + + /// + /// The reason for state change of the focus + /// + public AudioStreamFocusChangedReason FocusChangedReason { get; } + + /// + /// The extra information + /// + public string ExtraInformation { get; } + } +} diff --git a/src/Tizen.Multimedia/AudioManager/StreamFocusStateChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/StreamFocusStateChangedEventArgs.cs index c0cee8c..225cbe4 100755 --- a/src/Tizen.Multimedia/AudioManager/StreamFocusStateChangedEventArgs.cs +++ b/src/Tizen.Multimedia/AudioManager/StreamFocusStateChangedEventArgs.cs @@ -1,43 +1,43 @@ - /* - * Copyright (c) 2016 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; - -namespace Tizen.Multimedia -{ - /// - /// Class extending EventArgs and contains the necessary parameters to passed to FocusStateChanged event handler - /// - public class StreamFocusStateChangedEventArgs : EventArgs - { - /* FIXME */ - internal StreamFocusStateChangedEventArgs(AudioStreamFocusChangedReason reason, string extraInformation) - { - FocusChangedReason = reason; - ExtraInformation = extraInformation; - } - - /// - /// The reason for state change of the focus - /// - public AudioStreamFocusChangedReason FocusChangedReason { get; } - - /// - /// The extra information - /// - public string ExtraInformation { get; } - } -} + /* + * Copyright (c) 2016 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; + +namespace Tizen.Multimedia +{ + /// + /// Class extending EventArgs and contains the necessary parameters to passed to FocusStateChanged event handler + /// + public class StreamFocusStateChangedEventArgs : EventArgs + { + /* FIXME */ + internal StreamFocusStateChangedEventArgs(AudioStreamFocusChangedReason reason, string extraInformation) + { + FocusChangedReason = reason; + ExtraInformation = extraInformation; + } + + /// + /// The reason for state change of the focus + /// + public AudioStreamFocusChangedReason FocusChangedReason { get; } + + /// + /// The extra information + /// + public string ExtraInformation { get; } + } +} diff --git a/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs index 891fdc1..1643976 100755 --- a/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs +++ b/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs @@ -1,42 +1,42 @@ - /* - * Copyright (c) 2016 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; - -namespace Tizen.Multimedia -{ - /// - /// Extnded EventArgs which contains the parameteres to be passed to the AudioVolume Changed event - /// - public class VolumeChangedEventArgs : EventArgs - { - internal VolumeChangedEventArgs(AudioVolumeType type, uint level) - { - Type = type; - Level = level; - } - - /// - /// The sound type of the changed volume - /// - public AudioVolumeType Type { get; } - - /// - /// The new volume value - /// - public uint Level { get; } - } -} + /* + * Copyright (c) 2016 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; + +namespace Tizen.Multimedia +{ + /// + /// Extnded EventArgs which contains the parameteres to be passed to the AudioVolume Changed event + /// + public class VolumeChangedEventArgs : EventArgs + { + internal VolumeChangedEventArgs(AudioVolumeType type, uint level) + { + Type = type; + Level = level; + } + + /// + /// The sound type of the changed volume + /// + public AudioVolumeType Type { get; } + + /// + /// The new volume value + /// + public uint Level { get; } + } +} diff --git a/src/Tizen.Multimedia/Interop/Interop.Device.cs b/src/Tizen.Multimedia/Interop/Interop.Device.cs index 7213ad0..c8ae644 100644 --- a/src/Tizen.Multimedia/Interop/Interop.Device.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Device.cs @@ -1,5 +1,5 @@ -using System; -using System.Runtime.InteropServices; +using System; +using System.Runtime.InteropServices; namespace Tizen.Multimedia { @@ -49,5 +49,5 @@ namespace Tizen.Multimedia [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_state_changed_cb")] internal static extern int RemoveDeviceStateChangedCallback(int id); } - } + } } \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs b/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs index 7f4dbec..9a7c59c 100644 --- a/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs +++ b/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs @@ -1,5 +1,5 @@ -using System; -using System.Runtime.InteropServices; +using System; +using System.Runtime.InteropServices; namespace Tizen.Multimedia { diff --git a/src/Tizen.Multimedia/Interop/Interop.Volume.cs b/src/Tizen.Multimedia/Interop/Interop.Volume.cs index abc017f..1b3f205 100644 --- a/src/Tizen.Multimedia/Interop/Interop.Volume.cs +++ b/src/Tizen.Multimedia/Interop/Interop.Volume.cs @@ -1,5 +1,5 @@ -using System; -using System.Runtime.InteropServices; +using System; +using System.Runtime.InteropServices; namespace Tizen.Multimedia { @@ -28,5 +28,5 @@ namespace Tizen.Multimedia [DllImportAttribute(Libraries.SoundManager, EntryPoint = "sound_manager_remove_volume_changed_cb")] internal static extern int RemoveVolumeChangedCallback(int id); } - } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/WeakEventHandler.cs b/src/Tizen.NUI/src/internal/WeakEventHandler.cs index 2504fdf..b273b60 100755 --- a/src/Tizen.NUI/src/internal/WeakEventHandler.cs +++ b/src/Tizen.NUI/src/internal/WeakEventHandler.cs @@ -1,32 +1,32 @@ -using System; -using System.Reflection; - -namespace Tizen.NUI -{ - internal sealed class WeakEventHandler where TEventArgs : EventArgs - { - private readonly WeakReference _targetReference; - private readonly MethodInfo _method; - - public WeakEventHandler(EventHandler callback) - { - _method = callback.GetMethodInfo(); - _targetReference = new WeakReference(callback.Target, true); - } - - public void Handler(object sender, TEventArgs e) - { - var target = _targetReference.Target; - if (target != null) - { - var callback = (Action)_method.CreateDelegate(typeof(Action), target); - if (callback != null) - { - callback(sender, e); - } - } - } -} - -} - +using System; +using System.Reflection; + +namespace Tizen.NUI +{ + internal sealed class WeakEventHandler where TEventArgs : EventArgs + { + private readonly WeakReference _targetReference; + private readonly MethodInfo _method; + + public WeakEventHandler(EventHandler callback) + { + _method = callback.GetMethodInfo(); + _targetReference = new WeakReference(callback.Target, true); + } + + public void Handler(object sender, TEventArgs e) + { + var target = _targetReference.Target; + if (target != null) + { + var callback = (Action)_method.CreateDelegate(typeof(Action), target); + if (callback != null) + { + callback(sender, e); + } + } + } +} + +} + diff --git a/src/Tizen.NUI/src/internal/dotnetcore/AddedException.cs b/src/Tizen.NUI/src/internal/dotnetcore/AddedException.cs index 5e05865..be7d0dd 100755 --- a/src/Tizen.NUI/src/internal/dotnetcore/AddedException.cs +++ b/src/Tizen.NUI/src/internal/dotnetcore/AddedException.cs @@ -1,54 +1,54 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ - -namespace System -{ - public class ApplicationException : Exception - { - public ApplicationException() - { - new global::System.ApplicationException(); - } - - public ApplicationException(string message) - { - new global::System.ApplicationException(message); - } - - public ApplicationException(string message, Exception innerException) - { - new global::System.ApplicationException(message, innerException); - } - } - - public class SystemException : Exception - { - public SystemException() - { - new global::System.SystemException(); - } - - public SystemException(string message) - { - new global::System.SystemException(message); - } - - public SystemException(string message, Exception innerException) - { - new global::System.SystemException(message, innerException); - } - } -} +/** Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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. +* +*/ + +namespace System +{ + public class ApplicationException : Exception + { + public ApplicationException() + { + new global::System.ApplicationException(); + } + + public ApplicationException(string message) + { + new global::System.ApplicationException(message); + } + + public ApplicationException(string message, Exception innerException) + { + new global::System.ApplicationException(message, innerException); + } + } + + public class SystemException : Exception + { + public SystemException() + { + new global::System.SystemException(); + } + + public SystemException(string message) + { + new global::System.SystemException(message); + } + + public SystemException(string message, Exception innerException) + { + new global::System.SystemException(message, innerException); + } + } +} diff --git a/src/Tizen.NUI/src/internal/dotnetcore/HandleRef.cs b/src/Tizen.NUI/src/internal/dotnetcore/HandleRef.cs index c83d431..db34d4a 100755 --- a/src/Tizen.NUI/src/internal/dotnetcore/HandleRef.cs +++ b/src/Tizen.NUI/src/internal/dotnetcore/HandleRef.cs @@ -1,55 +1,55 @@ -// ==++== -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// ==--== -namespace System.Runtime.InteropServices -{ - - using System; - - [System.Runtime.InteropServices.ComVisible(true)] - public struct HandleRef - { - - // ! Do not add or rearrange fields as the EE depends on this layout. - //------------------------------------------------------------------ - internal Object m_wrapper; - internal IntPtr m_handle; - //------------------------------------------------------------------ - - - public HandleRef(Object wrapper, IntPtr handle) - { - m_wrapper = wrapper; - m_handle = handle; - } - - public Object Wrapper - { - get - { - return m_wrapper; - } - } - - public IntPtr Handle - { - get - { - return m_handle; - } - } - - - public static explicit operator IntPtr(HandleRef value) - { - return value.m_handle; - } - - public static IntPtr ToIntPtr(HandleRef value) - { - return value.m_handle; - } - } -} +// ==++== +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// ==--== +namespace System.Runtime.InteropServices +{ + + using System; + + [System.Runtime.InteropServices.ComVisible(true)] + public struct HandleRef + { + + // ! Do not add or rearrange fields as the EE depends on this layout. + //------------------------------------------------------------------ + internal Object m_wrapper; + internal IntPtr m_handle; + //------------------------------------------------------------------ + + + public HandleRef(Object wrapper, IntPtr handle) + { + m_wrapper = wrapper; + m_handle = handle; + } + + public Object Wrapper + { + get + { + return m_wrapper; + } + } + + public IntPtr Handle + { + get + { + return m_handle; + } + } + + + public static explicit operator IntPtr(HandleRef value) + { + return value.m_handle; + } + + public static IntPtr ToIntPtr(HandleRef value) + { + return value.m_handle; + } + } +} diff --git a/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs b/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs index 86ac67e..87accbb 100755 --- a/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs +++ b/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs @@ -247,7 +247,7 @@ internal static partial class Interop [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_free_service_data_list")] public static extern int FreeServiceDataList(IntPtr serviceData, int count); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_appearance")] + [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_appearance")] public static extern int GetScanResultAppearance(ref BluetoothLeScanDataStruct scanData, BluetoothLePacketType packetType, out int appearance); diff --git a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs index 081823a..f77df6e 100644 --- a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs +++ b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs @@ -137,8 +137,8 @@ namespace Tizen.Network.Smartcard } //Free unmanaged objects disposed = true; - } - + } + /// /// Closes the given channel to the Secure Element. /// diff --git a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs index a711be1..7edf663 100755 --- a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs +++ b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs @@ -1,47 +1,47 @@ -/* - * Copyright (c) 2016 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.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Network.Smartcard -{ - /// - /// A class for Smartcard management. It allows applications to use Smartcard service. - /// - /// 3 - /// http://tizen.org/privilege/secureelement - static public class SmartcardManager - { - /// - /// Gets the list of available Secure Element readers. - /// - /// 3 - /// List of SmartcardReader objects. - static public IEnumerable GetReaders() - { - try - { - return SmartcardManagerImpl.Instance.GetReaders(); - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } -} +/* + * Copyright (c) 2016 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.Collections.Generic; +using System.Threading.Tasks; + +namespace Tizen.Network.Smartcard +{ + /// + /// A class for Smartcard management. It allows applications to use Smartcard service. + /// + /// 3 + /// http://tizen.org/privilege/secureelement + static public class SmartcardManager + { + /// + /// Gets the list of available Secure Element readers. + /// + /// 3 + /// List of SmartcardReader objects. + static public IEnumerable GetReaders() + { + try + { + return SmartcardManagerImpl.Instance.GetReaders(); + } + catch (TypeInitializationException e) + { + throw e.InnerException; + } + } + } +} diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs index 7611d0f..93c76c3 100755 --- a/src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs +++ b/src/Tizen.System.Information/RuntimeInfo/RuntimeInformation.cs @@ -145,8 +145,8 @@ namespace Tizen.System [RuntimeInformationKey.AudioJackConnector] = typeof(int) }; - internal static readonly Dictionary s_keyTVkeyMapping = new Dictionary - { + internal static readonly Dictionary s_keyTVkeyMapping = new Dictionary + { [RuntimeInformationKey.Bluetooth] = 5, [RuntimeInformationKey.WifiHotspot] = 6, [RuntimeInformationKey.BluetoothTethering] = 7, @@ -160,44 +160,44 @@ namespace Tizen.System [RuntimeInformationKey.Charger] = 26, [RuntimeInformationKey.AutoRotation] = 28, [RuntimeInformationKey.Gps] = 21, - [RuntimeInformationKey.AudioJackConnector] = 20 + [RuntimeInformationKey.AudioJackConnector] = 20 }; internal static int is_TV_product = -1; [EditorBrowsable(EditorBrowsableState.Never)] /// This function is for a TV product. It will be removed. - internal static RuntimeInformationKey ConvertKeyIfTvProduct(RuntimeInformationKey key) - { - bool is_key_existed = false; - string profile; + internal static RuntimeInformationKey ConvertKeyIfTvProduct(RuntimeInformationKey key) + { + bool is_key_existed = false; + string profile; int key_TV = -1; - if (is_TV_product == -1) - { - is_key_existed = SystemInfo.TryGetValue("http://com.samsung/build_config/product_type", out profile); - if (is_key_existed && String.Compare(profile, "TV") == 0) - { - is_TV_product = 1; - } - else - { - is_TV_product = 0; - } - } - - if (is_TV_product == 0) - { - return key; - } - else - { - if (!s_keyTVkeyMapping.TryGetValue(key, out key_TV)) - { - RuntimeInfoErrorFactory.ThrowException((int)RuntimeInfoError.InvalidParameter); - } - return (RuntimeInformationKey)key_TV; - } + if (is_TV_product == -1) + { + is_key_existed = SystemInfo.TryGetValue("http://com.samsung/build_config/product_type", out profile); + if (is_key_existed && String.Compare(profile, "TV") == 0) + { + is_TV_product = 1; + } + else + { + is_TV_product = 0; + } + } + + if (is_TV_product == 0) + { + return key; + } + else + { + if (!s_keyTVkeyMapping.TryGetValue(key, out key_TV)) + { + RuntimeInfoErrorFactory.ThrowException((int)RuntimeInfoError.InvalidParameter); + } + return (RuntimeInformationKey)key_TV; + } } [EditorBrowsable(EditorBrowsableState.Never)] @@ -267,7 +267,7 @@ namespace Tizen.System /// Thrown when I/O error occurs while reading from the system. /// Thrown when the feature related is not supported. public static T GetStatus(RuntimeInformationKey key) - { + { return (T)GetStatus(key); } diff --git a/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs b/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs index 9a8e1c1..50a64ad 100755 --- a/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs +++ b/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs @@ -1,35 +1,35 @@ -/* -* Copyright (c) 2016 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; -using Tizen.Uix.InputMethod; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - /// - /// EinaList Interop Class - /// - internal static class EinaList - { - [DllImport(Libraries.Eina, EntryPoint = "eina_list_append")] - internal static extern IntPtr EinaListAppend(IntPtr list, IntPtr data); - } +/* +* Copyright (c) 2016 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; +using Tizen.Uix.InputMethod; + +/// +/// Partial Interop Class +/// +internal static partial class Interop +{ + /// + /// EinaList Interop Class + /// + internal static class EinaList + { + [DllImport(Libraries.Eina, EntryPoint = "eina_list_append")] + internal static extern IntPtr EinaListAppend(IntPtr list, IntPtr data); + } } \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs index e668ea1..45277e4 100755 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs @@ -1,38 +1,38 @@ -/* -* Copyright (c) 2016 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to AccessibilityStateChanged Event - /// - public class AccessibilityStateChangedEventArgs - { - internal AccessibilityStateChangedEventArgs(bool state) - { - State = state; - } - - /// - /// Accessibility option state - /// - public bool State - { - get; - internal set; - } - } +/* +* Copyright (c) 2016 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. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to AccessibilityStateChanged Event + /// + public class AccessibilityStateChangedEventArgs + { + internal AccessibilityStateChangedEventArgs(bool state) + { + State = state; + } + + /// + /// Accessibility option state + /// + public bool State + { + get; + internal set; + } + } } \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs index 1b9df1f..b0712f3 100755 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs @@ -1,38 +1,38 @@ -/* -* Copyright (c) 2016 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to DisplayLanaguageChanged Event - /// - public class DisplayLanaguageChangedEventArgs - { - internal DisplayLanaguageChangedEventArgs(string langauage) - { - Langauage = langauage; - } - - /// - /// The language code - /// - public string Langauage - { - get; - internal set; - } - } +/* +* Copyright (c) 2016 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. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to DisplayLanaguageChanged Event + /// + public class DisplayLanaguageChangedEventArgs + { + internal DisplayLanaguageChangedEventArgs(string langauage) + { + Langauage = langauage; + } + + /// + /// The language code + /// + public string Langauage + { + get; + internal set; + } + } } \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs index 950ba68..b4ed8bf 100755 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs @@ -1,83 +1,83 @@ -/* -* Copyright (c) 2016 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 static Interop.InputMethod; - -namespace Tizen.Uix.InputMethod -{ - internal static class InputMethodExceptionFactory - { - internal static Exception CreateException(ErrorCode err) - { - Tizen.Log.Error(LogTag, "Error " + err); - Exception exp; - switch (err) - { - case ErrorCode.OutOfMemory: - { - exp = new InvalidOperationException("Out Of Memory"); - break; - } - - - case ErrorCode.InvalidParameter: - { - exp = new InvalidOperationException("Invalid Parameters Provided"); - break; - } - - - case ErrorCode.PermissionDenied: - { - exp = new InvalidOperationException("Permission Denied"); - break; - } - - - case ErrorCode.OperationFailed: - { - exp = new InvalidOperationException("Operation Failed"); - break; - } - - - case ErrorCode.NotRunning: - { - exp = new InvalidOperationException("IME main loop isn't started yet"); - break; - } - - case ErrorCode.NoCallbackFunction: - { - exp = new InvalidOperationException("Necessary callback/events is not set"); - break; - } - - default: - { - exp = new Exception(""); - break; - } - - } - - return exp; - - } - } -} +/* +* Copyright (c) 2016 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 static Interop.InputMethod; + +namespace Tizen.Uix.InputMethod +{ + internal static class InputMethodExceptionFactory + { + internal static Exception CreateException(ErrorCode err) + { + Tizen.Log.Error(LogTag, "Error " + err); + Exception exp; + switch (err) + { + case ErrorCode.OutOfMemory: + { + exp = new InvalidOperationException("Out Of Memory"); + break; + } + + + case ErrorCode.InvalidParameter: + { + exp = new InvalidOperationException("Invalid Parameters Provided"); + break; + } + + + case ErrorCode.PermissionDenied: + { + exp = new InvalidOperationException("Permission Denied"); + break; + } + + + case ErrorCode.OperationFailed: + { + exp = new InvalidOperationException("Operation Failed"); + break; + } + + + case ErrorCode.NotRunning: + { + exp = new InvalidOperationException("IME main loop isn't started yet"); + break; + } + + case ErrorCode.NoCallbackFunction: + { + exp = new InvalidOperationException("Necessary callback/events is not set"); + break; + } + + default: + { + exp = new Exception(""); + break; + } + + } + + return exp; + + } + } +} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs index 8234311..57894aa 100755 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs @@ -1,38 +1,38 @@ -/* -* Copyright (c) 2016 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to ReturnKeyStateSet Event - /// - public class ReturnKeyStateSetEventArgs - { - internal ReturnKeyStateSetEventArgs(bool state) - { - State = state; - } - - /// - /// The bool state to disable Return key. The Return key is enabled by default - /// - public bool State - { - get; - internal set; - } - } +/* +* Copyright (c) 2016 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. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to ReturnKeyStateSet Event + /// + public class ReturnKeyStateSetEventArgs + { + internal ReturnKeyStateSetEventArgs(bool state) + { + State = state; + } + + /// + /// The bool state to disable Return key. The Return key is enabled by default + /// + public bool State + { + get; + internal set; + } + } } \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs b/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs index 7f52165..d9a4347 100755 --- a/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs +++ b/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs @@ -1,58 +1,58 @@ -/* -* Copyright (c) 2016 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; - -/// -/// Partial interop class. -/// -internal static partial class Interop -{ - /// - /// InputMethodManager interop class. - /// - internal static class InputMethodManager - { - internal static string LogTag = "Tizen.Uix.InputMethodManager"; - - private const int ErrorInputMethodManager = -0x02F20000; - - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter */ - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, /**< Permission denied */ - OperationFailed = ErrorInputMethodManager | 0x0010, /**< Operation failed */ - }; - - [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_show_ime_list")] - internal static extern ErrorCode ImeManagerShowImeList(); - - [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_show_ime_selector")] - internal static extern ErrorCode ImeManagerShowImeSelector(); - - [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_is_ime_enabled")] - internal static extern ErrorCode ImeManagerIsImeEnabled(string appId, out bool isEnabled); - - [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_get_active_ime")] - internal static extern ErrorCode ImeManagerGetActiveIme(out string app_id); - - [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_get_enabled_ime_count")] - internal static extern int ImeManagerGetEnabledImeCount(); - } +/* +* Copyright (c) 2016 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; + +/// +/// Partial interop class. +/// +internal static partial class Interop +{ + /// + /// InputMethodManager interop class. + /// + internal static class InputMethodManager + { + internal static string LogTag = "Tizen.Uix.InputMethodManager"; + + private const int ErrorInputMethodManager = -0x02F20000; + + internal enum ErrorCode + { + None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ + InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter */ + PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, /**< Permission denied */ + OperationFailed = ErrorInputMethodManager | 0x0010, /**< Operation failed */ + }; + + [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_show_ime_list")] + internal static extern ErrorCode ImeManagerShowImeList(); + + [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_show_ime_selector")] + internal static extern ErrorCode ImeManagerShowImeSelector(); + + [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_is_ime_enabled")] + internal static extern ErrorCode ImeManagerIsImeEnabled(string appId, out bool isEnabled); + + [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_get_active_ime")] + internal static extern ErrorCode ImeManagerGetActiveIme(out string app_id); + + [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_get_enabled_ime_count")] + internal static extern int ImeManagerGetEnabledImeCount(); + } } \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs b/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs index 4166edd..f260b59 100755 --- a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs +++ b/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs @@ -1,158 +1,158 @@ -/* -* Copyright (c) 2016 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 static Interop.InputMethodManager; - -namespace Tizen.Uix.InputMethodManager -{ - /// - /// This class provides the function for launching the input method editor (IME) list and selector settings. A user can manage the installed IMEs in the system. - /// The input method editor (IME) is an input panel that lets users provide an input and the platform to receive the text data entered. - /// The manager is a module for managing the installed IMEs. - /// IME developers can use this module to open the installed IME list or the selector menu after their IME installation, and then guide to select the installed IME. - /// - public static class Manager - { - /// - /// Requests to open the installed IME list menu. - /// This API provides the installed IME list menu for IME developers who might want to open it to enable their IME. - /// - /// - /// http://tizen.org/privilege/imemanager - /// - /// - /// This exception can occur if: - /// 1) The application does not have the privilege to call this function. - /// 2) Operation failed. - /// - public static void ShowIMEList() - { - ErrorCode error = ImeManagerShowImeList(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "ShowIMEList Failed with error " + error); - throw InputMethodManagerExceptionFactory.CreateException(error); - } - } - - /// - /// Requests to open the IME selector menu. - /// This API provides the IME selector menu for the IME or other application developers who might want to change the default IME. - /// - /// - /// http://tizen.org/privilege/imemanager - /// - /// - /// This exception can occur if: - /// 1) The application does not have the privilege to call this function. - /// 2) Operation failed. - /// - public static void ShowIMESelector() - { - ErrorCode error = ImeManagerShowImeSelector(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "ShowIMESelector Failed with error " + error); - throw InputMethodManagerExceptionFactory.CreateException(error); - } - } - - /// - /// Checks if the specific IME is enabled or disabled in the system keyboard setting. - /// The IME developers can use this property to check if their IME is enabled or not. - /// - /// - /// http://tizen.org/privilege/imemanager - /// - /// The application ID of the IME. - /// The On (enabled) and Off (disabled) state of the IME. - /// - /// This exception can occur if an invalid parameter is provided. - /// - /// - /// This exception can occur if: - /// 1) The application does not have the privilege to call this function. - /// 2) Operation failed. - /// - public static bool IsIMEEnabled(string appId) - { - bool isIMEEnabled; - ErrorCode error = ImeManagerIsImeEnabled(appId, out isIMEEnabled); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "IsIMEEnabled Failed with error " + error); - throw InputMethodManagerExceptionFactory.CreateException(error); - } - - return isIMEEnabled; - } - - /// - /// Checks which IME is the current activated (selected) IME. - /// - /// - /// http://tizen.org/privilege/imemanager - /// - /// - /// The current activated (selected) IME. - /// - /// - /// This exception can occur if: - /// 1) The application does not have the privilege to call this function. - /// 2) Operation failed. - /// - public static string GetActiveIME() - { - string activeIME; - ErrorCode error = ImeManagerGetActiveIme(out activeIME); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetActiveIME Failed with error " + error); - throw InputMethodManagerExceptionFactory.CreateException(error); - } - - return activeIME; - } - - /// - /// Gets the number of IMEs that are enabled (usable). - /// - /// - /// http://tizen.org/privilege/imemanager - /// - /// - /// The number of enabled IMEs. - /// - /// - /// This exception can occur if: - /// 1) The application does not have the privilege to call this function. - /// 2) Operation failed. - /// - public static int GetEnabledIMECount() - { - int activeIME = ImeManagerGetEnabledImeCount(); - ErrorCode error = (ErrorCode)Tizen.Internals.Errors.ErrorFacts.GetLastResult(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetEnabledIMECount Failed with error " + error); - throw InputMethodManagerExceptionFactory.CreateException(error); - } - - return activeIME; - } - } +/* +* Copyright (c) 2016 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 static Interop.InputMethodManager; + +namespace Tizen.Uix.InputMethodManager +{ + /// + /// This class provides the function for launching the input method editor (IME) list and selector settings. A user can manage the installed IMEs in the system. + /// The input method editor (IME) is an input panel that lets users provide an input and the platform to receive the text data entered. + /// The manager is a module for managing the installed IMEs. + /// IME developers can use this module to open the installed IME list or the selector menu after their IME installation, and then guide to select the installed IME. + /// + public static class Manager + { + /// + /// Requests to open the installed IME list menu. + /// This API provides the installed IME list menu for IME developers who might want to open it to enable their IME. + /// + /// + /// http://tizen.org/privilege/imemanager + /// + /// + /// This exception can occur if: + /// 1) The application does not have the privilege to call this function. + /// 2) Operation failed. + /// + public static void ShowIMEList() + { + ErrorCode error = ImeManagerShowImeList(); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "ShowIMEList Failed with error " + error); + throw InputMethodManagerExceptionFactory.CreateException(error); + } + } + + /// + /// Requests to open the IME selector menu. + /// This API provides the IME selector menu for the IME or other application developers who might want to change the default IME. + /// + /// + /// http://tizen.org/privilege/imemanager + /// + /// + /// This exception can occur if: + /// 1) The application does not have the privilege to call this function. + /// 2) Operation failed. + /// + public static void ShowIMESelector() + { + ErrorCode error = ImeManagerShowImeSelector(); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "ShowIMESelector Failed with error " + error); + throw InputMethodManagerExceptionFactory.CreateException(error); + } + } + + /// + /// Checks if the specific IME is enabled or disabled in the system keyboard setting. + /// The IME developers can use this property to check if their IME is enabled or not. + /// + /// + /// http://tizen.org/privilege/imemanager + /// + /// The application ID of the IME. + /// The On (enabled) and Off (disabled) state of the IME. + /// + /// This exception can occur if an invalid parameter is provided. + /// + /// + /// This exception can occur if: + /// 1) The application does not have the privilege to call this function. + /// 2) Operation failed. + /// + public static bool IsIMEEnabled(string appId) + { + bool isIMEEnabled; + ErrorCode error = ImeManagerIsImeEnabled(appId, out isIMEEnabled); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "IsIMEEnabled Failed with error " + error); + throw InputMethodManagerExceptionFactory.CreateException(error); + } + + return isIMEEnabled; + } + + /// + /// Checks which IME is the current activated (selected) IME. + /// + /// + /// http://tizen.org/privilege/imemanager + /// + /// + /// The current activated (selected) IME. + /// + /// + /// This exception can occur if: + /// 1) The application does not have the privilege to call this function. + /// 2) Operation failed. + /// + public static string GetActiveIME() + { + string activeIME; + ErrorCode error = ImeManagerGetActiveIme(out activeIME); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetActiveIME Failed with error " + error); + throw InputMethodManagerExceptionFactory.CreateException(error); + } + + return activeIME; + } + + /// + /// Gets the number of IMEs that are enabled (usable). + /// + /// + /// http://tizen.org/privilege/imemanager + /// + /// + /// The number of enabled IMEs. + /// + /// + /// This exception can occur if: + /// 1) The application does not have the privilege to call this function. + /// 2) Operation failed. + /// + public static int GetEnabledIMECount() + { + int activeIME = ImeManagerGetEnabledImeCount(); + ErrorCode error = (ErrorCode)Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetEnabledIMECount Failed with error " + error); + throw InputMethodManagerExceptionFactory.CreateException(error); + } + + return activeIME; + } + } } \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManagerExceptionFactory.cs b/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManagerExceptionFactory.cs index 29a052d..283b633 100755 --- a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManagerExceptionFactory.cs +++ b/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManagerExceptionFactory.cs @@ -29,30 +29,30 @@ namespace Tizen.Uix.InputMethodManager switch (err) { - case ErrorCode.InvalidParameter: - { - exp = new ArgumentException("Invalid Parameters Provided"); - break; + case ErrorCode.InvalidParameter: + { + exp = new ArgumentException("Invalid Parameters Provided"); + break; } - case ErrorCode.PermissionDenied: - { - exp = new InvalidOperationException("Permission Denied"); - break; + case ErrorCode.PermissionDenied: + { + exp = new InvalidOperationException("Permission Denied"); + break; } - case ErrorCode.OperationFailed: - { - exp = new InvalidOperationException("Operation Failed"); - break; + case ErrorCode.OperationFailed: + { + exp = new InvalidOperationException("Operation Failed"); + break; } - default: - { - exp = new Exception(""); - break; + default: + { + exp = new Exception(""); + break; } } diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs index e073823..7930e1c 100644 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs +++ b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs @@ -1,41 +1,41 @@ -/* - * 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 - { - public enum CacheModel - { - DocumentViewer, - DocumentBrowser, - PrimaryWebBrowser - } - - [DllImport(Libraries.ChromiumEwk)] - internal static extern IntPtr ewk_context_cookie_manager_get(IntPtr context); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_context_cache_model_set(IntPtr context, CacheModel model); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern CacheModel ewk_context_cache_model_get(IntPtr context); - } -} +/* + * 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 + { + public enum CacheModel + { + DocumentViewer, + DocumentBrowser, + PrimaryWebBrowser + } + + [DllImport(Libraries.ChromiumEwk)] + internal static extern IntPtr ewk_context_cookie_manager_get(IntPtr context); + + [DllImport(Libraries.ChromiumEwk)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool ewk_context_cache_model_set(IntPtr context, CacheModel model); + + [DllImport(Libraries.ChromiumEwk)] + internal static extern CacheModel ewk_context_cache_model_get(IntPtr context); + } +} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs index 2c90553..23fb70e 100644 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs +++ b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs @@ -1,46 +1,46 @@ -/* - * 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 - { - public enum CookieAcceptPolicy - { - Always, - Never, - NoThirdParty - } - - public enum CookiePersistentStorage - { - Text, - SqlLite - } - - [DllImport(Libraries.ChromiumEwk)] - internal static extern void ewk_cookie_manager_accept_policy_set(IntPtr manager, CookieAcceptPolicy policy); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern void ewk_cookie_manager_cookies_clear(IntPtr manager); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern void ewk_cookie_manager_persistent_storage_set(IntPtr manager, string path, CookiePersistentStorage storage); - } -} +/* + * 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 + { + public enum CookieAcceptPolicy + { + Always, + Never, + NoThirdParty + } + + public enum CookiePersistentStorage + { + Text, + SqlLite + } + + [DllImport(Libraries.ChromiumEwk)] + internal static extern void ewk_cookie_manager_accept_policy_set(IntPtr manager, CookieAcceptPolicy policy); + + [DllImport(Libraries.ChromiumEwk)] + internal static extern void ewk_cookie_manager_cookies_clear(IntPtr manager); + + [DllImport(Libraries.ChromiumEwk)] + internal static extern void ewk_cookie_manager_persistent_storage_set(IntPtr manager, string path, CookiePersistentStorage storage); + } +} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs index 9234dc6..7d22a3d 100644 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs +++ b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs @@ -1,49 +1,49 @@ -/* - * 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, EntryPoint = "ewk_error_url_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _ewk_error_url_get(IntPtr error); - - internal static string ewk_error_url_get(IntPtr error) - { - IntPtr ptr = _ewk_error_url_get(error); - return Marshal.PtrToStringAnsi(ptr); - } - - [DllImport(Libraries.ChromiumEwk)] - internal static extern int ewk_error_code_get(IntPtr error); - - [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_error_description_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _ewk_error_description_get(IntPtr error); - - internal static string ewk_error_description_get(IntPtr error) - { - IntPtr ptr = _ewk_error_description_get(error); - return Marshal.PtrToStringAnsi(ptr); - } - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_error_cancellation_get(IntPtr error); - } -} +/* + * 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, EntryPoint = "ewk_error_url_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] + internal static extern IntPtr _ewk_error_url_get(IntPtr error); + + internal static string ewk_error_url_get(IntPtr error) + { + IntPtr ptr = _ewk_error_url_get(error); + return Marshal.PtrToStringAnsi(ptr); + } + + [DllImport(Libraries.ChromiumEwk)] + internal static extern int ewk_error_code_get(IntPtr error); + + [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_error_description_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] + internal static extern IntPtr _ewk_error_description_get(IntPtr error); + + internal static string ewk_error_description_get(IntPtr error) + { + IntPtr ptr = _ewk_error_description_get(error); + return Marshal.PtrToStringAnsi(ptr); + } + + [DllImport(Libraries.ChromiumEwk)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool ewk_error_cancellation_get(IntPtr error); + } +} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs index 2acd268..ab7a5ef 100644 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs +++ b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs @@ -1,60 +1,60 @@ -/* - * 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)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_javascript_enabled_set(IntPtr settings, bool enable); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_javascript_enabled_get(IntPtr settings); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_loads_images_automatically_set(IntPtr settings, bool enable); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_loads_images_automatically_get(IntPtr settings); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_default_text_encoding_name_set(IntPtr settings, string encoding); - - [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_settings_default_text_encoding_name_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _ewk_settings_default_text_encoding_name_get(IntPtr settings); - - internal static string ewk_settings_default_text_encoding_name_get(IntPtr settings) - { - IntPtr ptr = _ewk_settings_default_text_encoding_name_get(settings); - return Marshal.PtrToStringAnsi(ptr); - } - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_default_font_size_set(IntPtr settings, int size); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern int ewk_settings_default_font_size_get(IntPtr settings); - } -} +/* + * 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)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool ewk_settings_javascript_enabled_set(IntPtr settings, bool enable); + + [DllImport(Libraries.ChromiumEwk)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool ewk_settings_javascript_enabled_get(IntPtr settings); + + [DllImport(Libraries.ChromiumEwk)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool ewk_settings_loads_images_automatically_set(IntPtr settings, bool enable); + + [DllImport(Libraries.ChromiumEwk)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool ewk_settings_loads_images_automatically_get(IntPtr settings); + + [DllImport(Libraries.ChromiumEwk)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool ewk_settings_default_text_encoding_name_set(IntPtr settings, string encoding); + + [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_settings_default_text_encoding_name_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] + internal static extern IntPtr _ewk_settings_default_text_encoding_name_get(IntPtr settings); + + internal static string ewk_settings_default_text_encoding_name_get(IntPtr settings) + { + IntPtr ptr = _ewk_settings_default_text_encoding_name_get(settings); + return Marshal.PtrToStringAnsi(ptr); + } + + [DllImport(Libraries.ChromiumEwk)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool ewk_settings_default_font_size_set(IntPtr settings, int size); + + [DllImport(Libraries.ChromiumEwk)] + internal static extern int ewk_settings_default_font_size_get(IntPtr settings); + } +} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs index e507ca8..0f8a17c 100644 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs +++ b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs @@ -1,127 +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); - } -} +/* + * 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); + } +} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.cs index 47ca039..cd9ca31 100644 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.cs +++ b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.cs @@ -1,29 +1,29 @@ -/* - * 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 int ewk_init(); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern int ewk_shutdown(); - } -} +/* + * 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 int ewk_init(); + + [DllImport(Libraries.ChromiumEwk)] + internal static extern int ewk_shutdown(); + } +} diff --git a/src/Tizen.WebView/Interop/Interop.Elementary.cs b/src/Tizen.WebView/Interop/Interop.Elementary.cs index 09b9bc4..e981fe2 100644 --- a/src/Tizen.WebView/Interop/Interop.Elementary.cs +++ b/src/Tizen.WebView/Interop/Interop.Elementary.cs @@ -1,37 +1,37 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_layout_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool elm_layout_theme_set(IntPtr obj, string klass, string group, string style); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_focus_allow_set(IntPtr obj, bool enable); - } +/* + * 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 Elementary + { + [DllImport(Libraries.Elementary)] + internal static extern IntPtr elm_layout_add(IntPtr obj); + + [DllImport(Libraries.Elementary)] + [return: MarshalAs(UnmanagedType.U1)] + internal static extern bool elm_layout_theme_set(IntPtr obj, string klass, string group, string style); + + [DllImport(Libraries.Elementary)] + internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content); + + [DllImport(Libraries.Elementary)] + internal static extern void elm_object_focus_allow_set(IntPtr obj, bool enable); + } } \ No newline at end of file diff --git a/src/Tizen.WebView/Interop/Interop.Evas.cs b/src/Tizen.WebView/Interop/Interop.Evas.cs index a9e6d58..52eef2c 100644 --- a/src/Tizen.WebView/Interop/Interop.Evas.cs +++ b/src/Tizen.WebView/Interop/Interop.Evas.cs @@ -1,27 +1,27 @@ -/* - * 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 Evas - { - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_evas_get(IntPtr obj); - } -} +/* + * 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 Evas + { + [DllImport(Libraries.Evas)] + internal static extern IntPtr evas_object_evas_get(IntPtr obj); + } +} diff --git a/src/Tizen.WebView/Interop/Interop.Libraries.cs b/src/Tizen.WebView/Interop/Interop.Libraries.cs index 0d91a26..7dab1c4 100644 --- a/src/Tizen.WebView/Interop/Interop.Libraries.cs +++ b/src/Tizen.WebView/Interop/Interop.Libraries.cs @@ -1,24 +1,24 @@ -/* - * 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. - */ -internal static partial class Interop -{ - private static class Libraries - { - internal const string ChromiumEwk = "libchromium-ewk.so"; - internal const string Elementary = "libelementary.so.1"; - internal const string Evas = "libevas.so.1"; - } -} +/* + * 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. + */ +internal static partial class Interop +{ + private static class Libraries + { + internal const string ChromiumEwk = "libchromium-ewk.so"; + internal const string Elementary = "libelementary.so.1"; + internal const string Evas = "libevas.so.1"; + } +} diff --git a/src/Tizen.WebView/Tizen.WebView/Chromium.cs b/src/Tizen.WebView/Tizen.WebView/Chromium.cs index ab63379..8511dcd 100644 --- a/src/Tizen.WebView/Tizen.WebView/Chromium.cs +++ b/src/Tizen.WebView/Tizen.WebView/Chromium.cs @@ -1,39 +1,39 @@ -/* - * 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. - */ - -namespace Tizen.WebView -{ - public static class Chromium - { - /// - /// Initializes Chromium's instance - /// - /// A reference count of Chromium's instance - public static int Initialize() - { - return Interop.ChromiumEwk.ewk_init(); - } - - /// - /// Decreases a reference count of WebKit's instance, possibly destroying it - /// - /// A reference count of Chromium's instance - public static int Shutdown() - { - return Interop.ChromiumEwk.ewk_shutdown(); - } - } -} +/* + * 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. + */ + +namespace Tizen.WebView +{ + public static class Chromium + { + /// + /// Initializes Chromium's instance + /// + /// A reference count of Chromium's instance + public static int Initialize() + { + return Interop.ChromiumEwk.ewk_init(); + } + + /// + /// Decreases a reference count of WebKit's instance, possibly destroying it + /// + /// A reference count of Chromium's instance + public static int Shutdown() + { + return Interop.ChromiumEwk.ewk_shutdown(); + } + } +} diff --git a/src/Tizen.WebView/Tizen.WebView/Context.cs b/src/Tizen.WebView/Tizen.WebView/Context.cs index 0e1b5cc..6e58cad 100644 --- a/src/Tizen.WebView/Tizen.WebView/Context.cs +++ b/src/Tizen.WebView/Tizen.WebView/Context.cs @@ -1,78 +1,78 @@ -/* - * 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; - -namespace Tizen.WebView -{ - /// - /// Enumeration that contains option for cache model. - /// - public enum CacheModel - { - DocumentViewer, /* Use the smallest cache capacity */ - DocumentBrowser, /* Use bigger cache capacity than DocumentBrowser */ - PrimaryWebBrowser /* Use the biggest cache capacity. */ - } - - public class Context - { - private IntPtr _handle; - private CookieManager _cookieManager; - - internal Context(IntPtr handle) - { - _handle = handle; - } - - /// - /// The cache model. - /// - /// - /// The default cache model is DocumentViewer. - /// - public CacheModel CacheModel - { - get - { - return (CacheModel)Interop.ChromiumEwk.ewk_context_cache_model_get(_handle); - } - - set - { - Interop.ChromiumEwk.ewk_context_cache_model_set(_handle, (Interop.ChromiumEwk.CacheModel)value); - } - } - - /// - /// Gets the CookieManager object for this context. - /// - /// The CookieManager object - public CookieManager GetCookieManager() - { - if (_cookieManager == null) - { - IntPtr cookieManagerHandle = Interop.ChromiumEwk.ewk_context_cookie_manager_get(_handle); - if (cookieManagerHandle == IntPtr.Zero) - { - return null; - } - _cookieManager = new CookieManager(cookieManagerHandle); - } - return _cookieManager; - } - } -} +/* + * 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; + +namespace Tizen.WebView +{ + /// + /// Enumeration that contains option for cache model. + /// + public enum CacheModel + { + DocumentViewer, /* Use the smallest cache capacity */ + DocumentBrowser, /* Use bigger cache capacity than DocumentBrowser */ + PrimaryWebBrowser /* Use the biggest cache capacity. */ + } + + public class Context + { + private IntPtr _handle; + private CookieManager _cookieManager; + + internal Context(IntPtr handle) + { + _handle = handle; + } + + /// + /// The cache model. + /// + /// + /// The default cache model is DocumentViewer. + /// + public CacheModel CacheModel + { + get + { + return (CacheModel)Interop.ChromiumEwk.ewk_context_cache_model_get(_handle); + } + + set + { + Interop.ChromiumEwk.ewk_context_cache_model_set(_handle, (Interop.ChromiumEwk.CacheModel)value); + } + } + + /// + /// Gets the CookieManager object for this context. + /// + /// The CookieManager object + public CookieManager GetCookieManager() + { + if (_cookieManager == null) + { + IntPtr cookieManagerHandle = Interop.ChromiumEwk.ewk_context_cookie_manager_get(_handle); + if (cookieManagerHandle == IntPtr.Zero) + { + return null; + } + _cookieManager = new CookieManager(cookieManagerHandle); + } + return _cookieManager; + } + } +} diff --git a/src/Tizen.WebView/Tizen.WebView/CookieManager.cs b/src/Tizen.WebView/Tizen.WebView/CookieManager.cs index 3728201..487e88b 100644 --- a/src/Tizen.WebView/Tizen.WebView/CookieManager.cs +++ b/src/Tizen.WebView/Tizen.WebView/CookieManager.cs @@ -1,82 +1,82 @@ -/* - * 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; - -namespace Tizen.WebView -{ - /// - /// Enumeration that contains accept policies for the cookies. - /// - public enum CookieAcceptPolicy - { - Always, /* Accepts every cookie sent from any page */ - Never, /* Rejects all cookies */ - NoThirdParty /* Accepts only cookies set by the main document loaded */ - } - - /// - /// Enumeration that creates a type name for the storage of persistent cookies. - /// - public enum CookiePersistentStorage - { - Text, /* Cookies are stored in a text file in the Mozilla "cookies.txt" format */ - SqlLite /* Cookies are stored in a SQLite file in the current Mozilla format. */ - } - - public class CookieManager - { - private IntPtr _handle; - - internal CookieManager(IntPtr handle) - { - _handle = handle; - } - - /// - /// Sets the cookie acceptance policy. - /// - /// - /// By default, only cookies set by the main document loaded are accepted. - /// - /// The cookie acceptance policy - public void SetCookieAcceptPolicy(CookieAcceptPolicy policy) - { - Interop.ChromiumEwk.ewk_cookie_manager_accept_policy_set(_handle, (Interop.ChromiumEwk.CookieAcceptPolicy)policy); - } - - /// - /// Deletes all the cookies. - /// - public void ClearCookies() - { - Interop.ChromiumEwk.ewk_cookie_manager_cookies_clear(_handle); - } - - /// - /// Sets the storage where non-session cookies are stored persistently to read/write the cookies. - /// - /// - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// - /// The path where to read/write Cookies - /// The type of storage - public void SetPersistentStorage(string path, CookiePersistentStorage storage) - { - Interop.ChromiumEwk.ewk_cookie_manager_persistent_storage_set(_handle, path, (Interop.ChromiumEwk.CookiePersistentStorage)storage); - } - } -} +/* + * 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; + +namespace Tizen.WebView +{ + /// + /// Enumeration that contains accept policies for the cookies. + /// + public enum CookieAcceptPolicy + { + Always, /* Accepts every cookie sent from any page */ + Never, /* Rejects all cookies */ + NoThirdParty /* Accepts only cookies set by the main document loaded */ + } + + /// + /// Enumeration that creates a type name for the storage of persistent cookies. + /// + public enum CookiePersistentStorage + { + Text, /* Cookies are stored in a text file in the Mozilla "cookies.txt" format */ + SqlLite /* Cookies are stored in a SQLite file in the current Mozilla format. */ + } + + public class CookieManager + { + private IntPtr _handle; + + internal CookieManager(IntPtr handle) + { + _handle = handle; + } + + /// + /// Sets the cookie acceptance policy. + /// + /// + /// By default, only cookies set by the main document loaded are accepted. + /// + /// The cookie acceptance policy + public void SetCookieAcceptPolicy(CookieAcceptPolicy policy) + { + Interop.ChromiumEwk.ewk_cookie_manager_accept_policy_set(_handle, (Interop.ChromiumEwk.CookieAcceptPolicy)policy); + } + + /// + /// Deletes all the cookies. + /// + public void ClearCookies() + { + Interop.ChromiumEwk.ewk_cookie_manager_cookies_clear(_handle); + } + + /// + /// Sets the storage where non-session cookies are stored persistently to read/write the cookies. + /// + /// + /// http://tizen.org/privilege/mediastorage + /// http://tizen.org/privilege/externalstorage + /// + /// The path where to read/write Cookies + /// The type of storage + public void SetPersistentStorage(string path, CookiePersistentStorage storage) + { + Interop.ChromiumEwk.ewk_cookie_manager_persistent_storage_set(_handle, path, (Interop.ChromiumEwk.CookiePersistentStorage)storage); + } + } +} diff --git a/src/Tizen.WebView/Tizen.WebView/JavaScriptMessage.cs b/src/Tizen.WebView/Tizen.WebView/JavaScriptMessage.cs index 3b9c555..07454ed 100644 --- a/src/Tizen.WebView/Tizen.WebView/JavaScriptMessage.cs +++ b/src/Tizen.WebView/Tizen.WebView/JavaScriptMessage.cs @@ -1,104 +1,104 @@ -/* - * 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; -using System.Text; - -namespace Tizen.WebView -{ - public delegate void JavaScriptMessageHandler(JavaScriptMessage message); - - /// - /// A Script message contains information that sent from JavaScript runtime. - /// - public class JavaScriptMessage - { - private string _name; - private IntPtr _body; - - internal JavaScriptMessage(Interop.ChromiumEwk.ScriptMessage message) - { - _name = Marshal.PtrToStringAnsi(message.name); - _body = message.body; - } - - /// - /// Obect name in JavaScript. - /// - public string Name - { - get - { - return _name; - } - } - - /// - /// Gets the value of body as integer type. - /// - /// The value of body as integer type - public int GetBodyAsInteger() - { - if (_body == IntPtr.Zero) - { - return 0; - } - return Marshal.ReadInt32(_body, 0); - } - - /// - /// Gets the value of body as double type. - /// - /// The value of body as double type - public double GetBodyAsDouble() - { - if (_body == IntPtr.Zero) - { - return 0d; - } - double[] ret = new double[1] ; - Marshal.Copy(_body, ret, 0, 1); - return ret[0]; - } - - /// - /// Gets the value of body as boolean type. - /// - /// The value of body as boolean type - public bool GetBodyAsBoolean() - { - if (_body == IntPtr.Zero) - { - return false; - } - return Marshal.ReadByte(_body) != (byte)0; - } - - /// - /// Gets the value of body as string type. - /// - /// The value of body as string type - public string GetBodyAsString() - { - if (_body == IntPtr.Zero) - { - return string.Empty; - } - return Marshal.PtrToStringAnsi(_body); - } - } -} +/* + * 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; +using System.Text; + +namespace Tizen.WebView +{ + public delegate void JavaScriptMessageHandler(JavaScriptMessage message); + + /// + /// A Script message contains information that sent from JavaScript runtime. + /// + public class JavaScriptMessage + { + private string _name; + private IntPtr _body; + + internal JavaScriptMessage(Interop.ChromiumEwk.ScriptMessage message) + { + _name = Marshal.PtrToStringAnsi(message.name); + _body = message.body; + } + + /// + /// Obect name in JavaScript. + /// + public string Name + { + get + { + return _name; + } + } + + /// + /// Gets the value of body as integer type. + /// + /// The value of body as integer type + public int GetBodyAsInteger() + { + if (_body == IntPtr.Zero) + { + return 0; + } + return Marshal.ReadInt32(_body, 0); + } + + /// + /// Gets the value of body as double type. + /// + /// The value of body as double type + public double GetBodyAsDouble() + { + if (_body == IntPtr.Zero) + { + return 0d; + } + double[] ret = new double[1] ; + Marshal.Copy(_body, ret, 0, 1); + return ret[0]; + } + + /// + /// Gets the value of body as boolean type. + /// + /// The value of body as boolean type + public bool GetBodyAsBoolean() + { + if (_body == IntPtr.Zero) + { + return false; + } + return Marshal.ReadByte(_body) != (byte)0; + } + + /// + /// Gets the value of body as string type. + /// + /// The value of body as string type + public string GetBodyAsString() + { + if (_body == IntPtr.Zero) + { + return string.Empty; + } + return Marshal.PtrToStringAnsi(_body); + } + } +} diff --git a/src/Tizen.WebView/Tizen.WebView/Settings.cs b/src/Tizen.WebView/Tizen.WebView/Settings.cs index 083e773..8e1f349 100644 --- a/src/Tizen.WebView/Tizen.WebView/Settings.cs +++ b/src/Tizen.WebView/Tizen.WebView/Settings.cs @@ -1,94 +1,94 @@ -/* - * 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; - -namespace Tizen.WebView -{ - public class Settings - { - private IntPtr _handle; - - internal Settings(IntPtr handle) - { - _handle = handle; - } - - /// - /// Whether JavaScript can be executable. - /// - public bool JavaScriptEnabled - { - get - { - return Interop.ChromiumEwk.ewk_settings_javascript_enabled_get(_handle); - } - - set - { - Interop.ChromiumEwk.ewk_settings_javascript_enabled_set(_handle, value); - } - } - - /// - /// Whether images can be loaded automatically. - /// - public bool LoadImageAutomatically - { - get - { - return Interop.ChromiumEwk.ewk_settings_loads_images_automatically_get(_handle); - } - - set - { - Interop.ChromiumEwk.ewk_settings_loads_images_automatically_set(_handle, value); - } - } - - /// - /// The default text encoding name. - /// - public string DefaultTextEncodingName - { - get - { - return Interop.ChromiumEwk.ewk_settings_default_text_encoding_name_get(_handle); - } - - set - { - Interop.ChromiumEwk.ewk_settings_default_text_encoding_name_set(_handle, value); - } - } - - /// - /// The default font size of a pixel. - /// - public int DefaultFontSize - { - get - { - return Interop.ChromiumEwk.ewk_settings_default_font_size_get(_handle); - } - - set - { - Interop.ChromiumEwk.ewk_settings_default_font_size_set(_handle, value); - } - } - } -} +/* + * 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; + +namespace Tizen.WebView +{ + public class Settings + { + private IntPtr _handle; + + internal Settings(IntPtr handle) + { + _handle = handle; + } + + /// + /// Whether JavaScript can be executable. + /// + public bool JavaScriptEnabled + { + get + { + return Interop.ChromiumEwk.ewk_settings_javascript_enabled_get(_handle); + } + + set + { + Interop.ChromiumEwk.ewk_settings_javascript_enabled_set(_handle, value); + } + } + + /// + /// Whether images can be loaded automatically. + /// + public bool LoadImageAutomatically + { + get + { + return Interop.ChromiumEwk.ewk_settings_loads_images_automatically_get(_handle); + } + + set + { + Interop.ChromiumEwk.ewk_settings_loads_images_automatically_set(_handle, value); + } + } + + /// + /// The default text encoding name. + /// + public string DefaultTextEncodingName + { + get + { + return Interop.ChromiumEwk.ewk_settings_default_text_encoding_name_get(_handle); + } + + set + { + Interop.ChromiumEwk.ewk_settings_default_text_encoding_name_set(_handle, value); + } + } + + /// + /// The default font size of a pixel. + /// + public int DefaultFontSize + { + get + { + return Interop.ChromiumEwk.ewk_settings_default_font_size_get(_handle); + } + + set + { + Interop.ChromiumEwk.ewk_settings_default_font_size_set(_handle, value); + } + } + } +} diff --git a/src/Tizen.WebView/Tizen.WebView/SmartCallbackArgs.cs b/src/Tizen.WebView/Tizen.WebView/SmartCallbackArgs.cs index 9da498f..9e0f01d 100644 --- a/src/Tizen.WebView/Tizen.WebView/SmartCallbackArgs.cs +++ b/src/Tizen.WebView/Tizen.WebView/SmartCallbackArgs.cs @@ -1,93 +1,93 @@ -/* - * 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; - -namespace Tizen.WebView -{ - /// - /// Argument from the SmartCallback. - /// - public class SmartCallbackArgs : EventArgs - { - private IntPtr _arg; - - internal SmartCallbackArgs(IntPtr arg) - { - _arg = arg; - } - - /// - /// Gets argument as integer type. - /// - /// Argument as integer type - public int GetAsInteger() - { - if (_arg == IntPtr.Zero) - { - return 0; - } - return Marshal.ReadInt32(_arg, 0); - } - - /// - /// Gets argument as double type. - /// - /// Argument as double type - public double GetAsDouble() - { - if (_arg == IntPtr.Zero) - { - return 0d; - } - double[] ret = new double[1]; - Marshal.Copy(_arg, ret, 0, 1); - return ret[0]; - } - - /// - /// Gets argument as boolean type. - /// - /// Argument as boolean type - public bool GetAsBoolean() - { - if (_arg == IntPtr.Zero) - { - return false; - } - return Marshal.ReadByte(_arg) != (byte)0; - } - - /// - /// Gets argument as string type. - /// - /// Argument as string type - public string GetAsString() - { - if (_arg == IntPtr.Zero) - { - return string.Empty; - } - return Marshal.PtrToStringAnsi(_arg); - } - - internal static SmartCallbackArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - return new SmartCallbackArgs(info); - } - } -} +/* + * 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; + +namespace Tizen.WebView +{ + /// + /// Argument from the SmartCallback. + /// + public class SmartCallbackArgs : EventArgs + { + private IntPtr _arg; + + internal SmartCallbackArgs(IntPtr arg) + { + _arg = arg; + } + + /// + /// Gets argument as integer type. + /// + /// Argument as integer type + public int GetAsInteger() + { + if (_arg == IntPtr.Zero) + { + return 0; + } + return Marshal.ReadInt32(_arg, 0); + } + + /// + /// Gets argument as double type. + /// + /// Argument as double type + public double GetAsDouble() + { + if (_arg == IntPtr.Zero) + { + return 0d; + } + double[] ret = new double[1]; + Marshal.Copy(_arg, ret, 0, 1); + return ret[0]; + } + + /// + /// Gets argument as boolean type. + /// + /// Argument as boolean type + public bool GetAsBoolean() + { + if (_arg == IntPtr.Zero) + { + return false; + } + return Marshal.ReadByte(_arg) != (byte)0; + } + + /// + /// Gets argument as string type. + /// + /// Argument as string type + public string GetAsString() + { + if (_arg == IntPtr.Zero) + { + return string.Empty; + } + return Marshal.PtrToStringAnsi(_arg); + } + + internal static SmartCallbackArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) + { + return new SmartCallbackArgs(info); + } + } +} diff --git a/src/Tizen.WebView/Tizen.WebView/SmartCallbackLoadErrorArgs.cs b/src/Tizen.WebView/Tizen.WebView/SmartCallbackLoadErrorArgs.cs index 8ade295..8aa6704 100644 --- a/src/Tizen.WebView/Tizen.WebView/SmartCallbackLoadErrorArgs.cs +++ b/src/Tizen.WebView/Tizen.WebView/SmartCallbackLoadErrorArgs.cs @@ -1,150 +1,150 @@ -/* - * 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; - -namespace Tizen.WebView -{ - /// - /// Enumeration that provides an option to error codes. - /// - public enum LoadErrorCode - { - /// - /// Unknown - /// - Unknown = 0, - /// - /// User canceled - /// - Canceled, - /// - /// Can't show page for this MIME Type - /// - CantSupportMimetype, - /// - /// File IO error - /// - FailedFileIo, - /// - /// Cannot connect to network - /// - CantConnect, - /// - /// Fail to look up host from DNS - /// - CantLookupHost, - /// - /// Fail to SSL/TLS handshake - /// - FailedTlsHandshake, - /// - /// Received certificate is invalid - /// - InvalidCertificate, - /// - /// Connection timeout - /// - RequestTimeout, - /// - /// Too many redirects - /// - TooManyRedirects, - /// - /// Too many requests during this load - /// - TooManyRequests, - /// - /// Malformed url - /// - BadUrl, - /// - /// Unsupported scheme - /// - UnsupportedScheme, - /// - /// User authentication failed on server - /// - Authentication, - /// - /// Web server has internal server error - /// - InternalServer, - } - - /// - /// Argument from the LoadError SmartCallback. - /// - public class SmartCallbackLoadErrorArgs : EventArgs - { - IntPtr _handle; - - internal SmartCallbackLoadErrorArgs(IntPtr handle) - { - _handle = handle; - } - - /// - /// Failing URL for the error. - /// - public string Url - { - get - { - return Interop.ChromiumEwk.ewk_error_url_get(_handle); - } - } - - /// - /// The error code. - /// - public LoadErrorCode Code - { - get - { - return (LoadErrorCode)Interop.ChromiumEwk.ewk_error_code_get(_handle); - } - } - - /// - /// The description for the error. - /// - public string Description - { - get - { - return Interop.ChromiumEwk.ewk_error_description_get(_handle); - } - } - - /// - /// Whether the error should be treated as a cancellation. - /// - public bool Cancellation - { - get - { - return Interop.ChromiumEwk.ewk_error_cancellation_get(_handle); - } - } - - internal static SmartCallbackLoadErrorArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - return new SmartCallbackLoadErrorArgs(info); - } - } -} +/* + * 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; + +namespace Tizen.WebView +{ + /// + /// Enumeration that provides an option to error codes. + /// + public enum LoadErrorCode + { + /// + /// Unknown + /// + Unknown = 0, + /// + /// User canceled + /// + Canceled, + /// + /// Can't show page for this MIME Type + /// + CantSupportMimetype, + /// + /// File IO error + /// + FailedFileIo, + /// + /// Cannot connect to network + /// + CantConnect, + /// + /// Fail to look up host from DNS + /// + CantLookupHost, + /// + /// Fail to SSL/TLS handshake + /// + FailedTlsHandshake, + /// + /// Received certificate is invalid + /// + InvalidCertificate, + /// + /// Connection timeout + /// + RequestTimeout, + /// + /// Too many redirects + /// + TooManyRedirects, + /// + /// Too many requests during this load + /// + TooManyRequests, + /// + /// Malformed url + /// + BadUrl, + /// + /// Unsupported scheme + /// + UnsupportedScheme, + /// + /// User authentication failed on server + /// + Authentication, + /// + /// Web server has internal server error + /// + InternalServer, + } + + /// + /// Argument from the LoadError SmartCallback. + /// + public class SmartCallbackLoadErrorArgs : EventArgs + { + IntPtr _handle; + + internal SmartCallbackLoadErrorArgs(IntPtr handle) + { + _handle = handle; + } + + /// + /// Failing URL for the error. + /// + public string Url + { + get + { + return Interop.ChromiumEwk.ewk_error_url_get(_handle); + } + } + + /// + /// The error code. + /// + public LoadErrorCode Code + { + get + { + return (LoadErrorCode)Interop.ChromiumEwk.ewk_error_code_get(_handle); + } + } + + /// + /// The description for the error. + /// + public string Description + { + get + { + return Interop.ChromiumEwk.ewk_error_description_get(_handle); + } + } + + /// + /// Whether the error should be treated as a cancellation. + /// + public bool Cancellation + { + get + { + return Interop.ChromiumEwk.ewk_error_cancellation_get(_handle); + } + } + + internal static SmartCallbackLoadErrorArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) + { + return new SmartCallbackLoadErrorArgs(info); + } + } +} diff --git a/src/Tizen.WebView/Tizen.WebView/WebView.cs b/src/Tizen.WebView/Tizen.WebView/WebView.cs index 6b9e751..3b30cd8 100644 --- a/src/Tizen.WebView/Tizen.WebView/WebView.cs +++ b/src/Tizen.WebView/Tizen.WebView/WebView.cs @@ -1,342 +1,342 @@ -/* - * 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 ElmSharp; -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.WebView -{ - /// - /// A view used to render web contents. - /// - public class WebView: EvasObject - { - private static IDictionary _javaScriptMessageHandlerMap = new Dictionary(); - - private IntPtr _handle; - private IntPtr _realHandle; - private Context _context; - private Settings _settings; - - // focus dummy - private SmartEvent _focusIn; - private SmartEvent _focusOut; - - // Smart events - private SmartEvent _loadStarted; - private SmartEvent _loadFinished; - private SmartEvent _loadError; - private SmartEvent _titleChanged; - private SmartEvent _urlChanged; - - - - /// - /// Event that occurs when load started. - /// - public event EventHandler LoadStarted; - - /// - /// Event that occurs when load finished. - /// - public event EventHandler LoadFinished; - - /// - /// Event that occurs when load error. - /// - public event EventHandler LoadError; - - /// - /// Event that occurs when title of main frame was changed. - /// - public event EventHandler TitleChanged; - - /// - /// Event that occurs when URL of main frame was changed. - /// - public event EventHandler UrlChanged; - - /// - /// Current URL of the main frame. - /// - public string Url - { - get - { - return Interop.ChromiumEwk.ewk_view_url_get(_realHandle); - } - } - - /// - /// Current title of the main frame. - /// - public string Title - { - get - { - return Interop.ChromiumEwk.ewk_view_title_get(_realHandle); - } - } - - /// - /// Current user agent string of this view. - /// - public string UserAgent - { - get - { - return Interop.ChromiumEwk.ewk_view_user_agent_get(_realHandle); - } - - set - { - Interop.ChromiumEwk.ewk_view_user_agent_set(_realHandle, value); - } - } - - /// - /// Whether a view has the focus. - /// - public bool HasFocus - { - get - { - return Interop.ChromiumEwk.ewk_view_focus_get(_realHandle); - } - } - - /// - /// Create a WebView object. - /// - /// Parent object of WebView - public WebView(EvasObject parent) : base(parent) - { - InitializeSmartEvent(); - } - - /// - /// Gets the Context object of this view. - /// - /// The Context object of this view - public Context GetContext() - { - if (_context == null) - { - IntPtr contextHandle = Interop.ChromiumEwk.ewk_view_context_get(_realHandle); - if (contextHandle == IntPtr.Zero) - { - return null; - } - _context = new Context(contextHandle); - } - return _context; - } - - /// - /// Gets the Settings object of this view. - /// - /// The Settings object of this view - public Settings GetSettings() - { - if (_settings == null) - { - IntPtr settingsHandle = Interop.ChromiumEwk.ewk_view_settings_get(_realHandle); - if (settingsHandle == IntPtr.Zero) - { - return null; - } - _settings = new Settings(settingsHandle); - } - return _settings; - } - - /// - /// Asks the object to load the given URL. - /// - /// - /// You can only be sure that url changed after UrlChanged event. - /// - /// The uniform resource identifier to load - public void LoadUrl(string url) - { - Interop.ChromiumEwk.ewk_view_url_set(_realHandle, url); - } - - /// - /// Loads the specified html string as the content of the view. - /// - /// HTML data to load - /// Base URL used for relative paths to external objects - public void LoadHtml(string html, string baseUrl) - { - Interop.ChromiumEwk.ewk_view_html_string_load(_realHandle, html, baseUrl, null); - } - - /// - /// Asks the main frame to stop loading. - /// - public void StopLoading() - { - Interop.ChromiumEwk.ewk_view_stop(_realHandle); - } - - /// - /// Asks the main frame to reload the current document. - /// - public void Reload() - { - Interop.ChromiumEwk.ewk_view_reload(_realHandle); - } - - /// - /// Asks the main frame to navigate back in history. - /// - public void GoBack() - { - Interop.ChromiumEwk.ewk_view_back(_realHandle); - } - - /// - /// Asks the main frame to navigate forward in history. - /// - public void GoForward() - { - Interop.ChromiumEwk.ewk_view_forward(_realHandle); - } - - /// - /// Checks whether it is possible to navigate backwards one item in history. - /// - /// Whether it is possible to navigate backwards one item in history - public bool CanGoBack() - { - return Interop.ChromiumEwk.ewk_view_back_possible(_realHandle); - } - - /// - /// Checks whether it is possible to navigate forwards one item in history. - /// - /// Whether it is possible to navigate forwards one item in history - public bool CanGoForward() - { - return Interop.ChromiumEwk.ewk_view_forward_possible(_realHandle); - } - - /// - /// Injects the supplied javascript message handler into the view. - /// - /// The message callback - /// The name used to expose the object in JavaScript - /// 'true' on success, otherwise 'false' - public bool AddJavaScriptMessageHandler(string name, JavaScriptMessageHandler handler) - { - lock (_javaScriptMessageHandlerMap) - { - if (_javaScriptMessageHandlerMap.ContainsKey(name)) - { - return false; - } - _javaScriptMessageHandlerMap[name] = handler; - } - Interop.ChromiumEwk.ScriptMessageCallback callback = (handle, message) => - { - JavaScriptMessage convertedMessage = new JavaScriptMessage(message); - lock (_javaScriptMessageHandlerMap) - { - if (_javaScriptMessageHandlerMap.ContainsKey(convertedMessage.Name)) - { - _javaScriptMessageHandlerMap[convertedMessage.Name](convertedMessage); - } - } - }; - if (!Interop.ChromiumEwk.ewk_view_javascript_message_handler_add(_realHandle, callback, name)) - { - lock (_javaScriptMessageHandlerMap) - { - _javaScriptMessageHandlerMap.Remove(name); - return false; - } - } - return true; - } - - /// - /// Requests the execution of given name and result to the JavaScript runtime. - /// - /// The name used to expose the object in JavaScript - /// The result to the JavaScript runtime - public void EvalWithResult(string name, string result) - { - Interop.ChromiumEwk.ewk_view_evaluate_javascript(_realHandle, name, result); - } - - /// - /// Requests the execution of the given script. - /// - /// The JavaScript code string to execute - public void Eval(string script) - { - Interop.ChromiumEwk.ewk_view_script_execute(_realHandle, script, null, IntPtr.Zero); - } - - /// - /// Requests to set or unset a view as the currently focused one. - /// - /// 'true' to set the focus on the view, 'false' to remove the focus from the view - public void SetFocus(bool focused) - { - Interop.ChromiumEwk.ewk_view_focus_set(_realHandle, focused); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - // focus dummy - _handle = Interop.Elementary.elm_layout_add((IntPtr)parent); - Interop.Elementary.elm_layout_theme_set(_handle, "layout", "elm_widget", "default"); - Interop.Elementary.elm_object_focus_allow_set(_handle, true); - - IntPtr evas = Interop.Evas.evas_object_evas_get(parent); - _realHandle = Interop.ChromiumEwk.ewk_view_add(evas); - Interop.Elementary.elm_object_part_content_set(_handle, "elm.swallow.content", _realHandle); - - return _handle; - } - - private void InitializeSmartEvent() - { - // focus dummy - _focusIn = new SmartEvent(this, "focused"); - _focusOut = new SmartEvent(this, "unfocused"); - - _focusIn.On += (s, e) => { ((WebView)s).SetFocus(true); }; - _focusOut.On += (s, e) => { ((WebView)s).SetFocus(false); }; - - _loadStarted = new SmartEvent(this, _realHandle, "load,started"); - _loadFinished = new SmartEvent(this, _realHandle, "load,finished"); - _loadError = new SmartEvent(this, _realHandle, "load,error", SmartCallbackLoadErrorArgs.CreateFromSmartEvent); - _titleChanged = new SmartEvent(this, _realHandle, "title,changed", SmartCallbackArgs.CreateFromSmartEvent); - _urlChanged = new SmartEvent(this, _realHandle, "url,changed", SmartCallbackArgs.CreateFromSmartEvent); - - _loadStarted.On += (s, e) => { LoadStarted?.Invoke(this, EventArgs.Empty); }; - _loadFinished.On += (s, e) => { LoadFinished?.Invoke(this, EventArgs.Empty); }; - _loadError.On += (s, e) => { LoadError?.Invoke(this, e); }; - _titleChanged.On += (s, e) => { TitleChanged?.Invoke(this, e); }; - _urlChanged.On += (s, e) => { UrlChanged?.Invoke(this, e); }; - } - } -} +/* + * 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 ElmSharp; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace Tizen.WebView +{ + /// + /// A view used to render web contents. + /// + public class WebView: EvasObject + { + private static IDictionary _javaScriptMessageHandlerMap = new Dictionary(); + + private IntPtr _handle; + private IntPtr _realHandle; + private Context _context; + private Settings _settings; + + // focus dummy + private SmartEvent _focusIn; + private SmartEvent _focusOut; + + // Smart events + private SmartEvent _loadStarted; + private SmartEvent _loadFinished; + private SmartEvent _loadError; + private SmartEvent _titleChanged; + private SmartEvent _urlChanged; + + + + /// + /// Event that occurs when load started. + /// + public event EventHandler LoadStarted; + + /// + /// Event that occurs when load finished. + /// + public event EventHandler LoadFinished; + + /// + /// Event that occurs when load error. + /// + public event EventHandler LoadError; + + /// + /// Event that occurs when title of main frame was changed. + /// + public event EventHandler TitleChanged; + + /// + /// Event that occurs when URL of main frame was changed. + /// + public event EventHandler UrlChanged; + + /// + /// Current URL of the main frame. + /// + public string Url + { + get + { + return Interop.ChromiumEwk.ewk_view_url_get(_realHandle); + } + } + + /// + /// Current title of the main frame. + /// + public string Title + { + get + { + return Interop.ChromiumEwk.ewk_view_title_get(_realHandle); + } + } + + /// + /// Current user agent string of this view. + /// + public string UserAgent + { + get + { + return Interop.ChromiumEwk.ewk_view_user_agent_get(_realHandle); + } + + set + { + Interop.ChromiumEwk.ewk_view_user_agent_set(_realHandle, value); + } + } + + /// + /// Whether a view has the focus. + /// + public bool HasFocus + { + get + { + return Interop.ChromiumEwk.ewk_view_focus_get(_realHandle); + } + } + + /// + /// Create a WebView object. + /// + /// Parent object of WebView + public WebView(EvasObject parent) : base(parent) + { + InitializeSmartEvent(); + } + + /// + /// Gets the Context object of this view. + /// + /// The Context object of this view + public Context GetContext() + { + if (_context == null) + { + IntPtr contextHandle = Interop.ChromiumEwk.ewk_view_context_get(_realHandle); + if (contextHandle == IntPtr.Zero) + { + return null; + } + _context = new Context(contextHandle); + } + return _context; + } + + /// + /// Gets the Settings object of this view. + /// + /// The Settings object of this view + public Settings GetSettings() + { + if (_settings == null) + { + IntPtr settingsHandle = Interop.ChromiumEwk.ewk_view_settings_get(_realHandle); + if (settingsHandle == IntPtr.Zero) + { + return null; + } + _settings = new Settings(settingsHandle); + } + return _settings; + } + + /// + /// Asks the object to load the given URL. + /// + /// + /// You can only be sure that url changed after UrlChanged event. + /// + /// The uniform resource identifier to load + public void LoadUrl(string url) + { + Interop.ChromiumEwk.ewk_view_url_set(_realHandle, url); + } + + /// + /// Loads the specified html string as the content of the view. + /// + /// HTML data to load + /// Base URL used for relative paths to external objects + public void LoadHtml(string html, string baseUrl) + { + Interop.ChromiumEwk.ewk_view_html_string_load(_realHandle, html, baseUrl, null); + } + + /// + /// Asks the main frame to stop loading. + /// + public void StopLoading() + { + Interop.ChromiumEwk.ewk_view_stop(_realHandle); + } + + /// + /// Asks the main frame to reload the current document. + /// + public void Reload() + { + Interop.ChromiumEwk.ewk_view_reload(_realHandle); + } + + /// + /// Asks the main frame to navigate back in history. + /// + public void GoBack() + { + Interop.ChromiumEwk.ewk_view_back(_realHandle); + } + + /// + /// Asks the main frame to navigate forward in history. + /// + public void GoForward() + { + Interop.ChromiumEwk.ewk_view_forward(_realHandle); + } + + /// + /// Checks whether it is possible to navigate backwards one item in history. + /// + /// Whether it is possible to navigate backwards one item in history + public bool CanGoBack() + { + return Interop.ChromiumEwk.ewk_view_back_possible(_realHandle); + } + + /// + /// Checks whether it is possible to navigate forwards one item in history. + /// + /// Whether it is possible to navigate forwards one item in history + public bool CanGoForward() + { + return Interop.ChromiumEwk.ewk_view_forward_possible(_realHandle); + } + + /// + /// Injects the supplied javascript message handler into the view. + /// + /// The message callback + /// The name used to expose the object in JavaScript + /// 'true' on success, otherwise 'false' + public bool AddJavaScriptMessageHandler(string name, JavaScriptMessageHandler handler) + { + lock (_javaScriptMessageHandlerMap) + { + if (_javaScriptMessageHandlerMap.ContainsKey(name)) + { + return false; + } + _javaScriptMessageHandlerMap[name] = handler; + } + Interop.ChromiumEwk.ScriptMessageCallback callback = (handle, message) => + { + JavaScriptMessage convertedMessage = new JavaScriptMessage(message); + lock (_javaScriptMessageHandlerMap) + { + if (_javaScriptMessageHandlerMap.ContainsKey(convertedMessage.Name)) + { + _javaScriptMessageHandlerMap[convertedMessage.Name](convertedMessage); + } + } + }; + if (!Interop.ChromiumEwk.ewk_view_javascript_message_handler_add(_realHandle, callback, name)) + { + lock (_javaScriptMessageHandlerMap) + { + _javaScriptMessageHandlerMap.Remove(name); + return false; + } + } + return true; + } + + /// + /// Requests the execution of given name and result to the JavaScript runtime. + /// + /// The name used to expose the object in JavaScript + /// The result to the JavaScript runtime + public void EvalWithResult(string name, string result) + { + Interop.ChromiumEwk.ewk_view_evaluate_javascript(_realHandle, name, result); + } + + /// + /// Requests the execution of the given script. + /// + /// The JavaScript code string to execute + public void Eval(string script) + { + Interop.ChromiumEwk.ewk_view_script_execute(_realHandle, script, null, IntPtr.Zero); + } + + /// + /// Requests to set or unset a view as the currently focused one. + /// + /// 'true' to set the focus on the view, 'false' to remove the focus from the view + public void SetFocus(bool focused) + { + Interop.ChromiumEwk.ewk_view_focus_set(_realHandle, focused); + } + + protected override IntPtr CreateHandle(EvasObject parent) + { + // focus dummy + _handle = Interop.Elementary.elm_layout_add((IntPtr)parent); + Interop.Elementary.elm_layout_theme_set(_handle, "layout", "elm_widget", "default"); + Interop.Elementary.elm_object_focus_allow_set(_handle, true); + + IntPtr evas = Interop.Evas.evas_object_evas_get(parent); + _realHandle = Interop.ChromiumEwk.ewk_view_add(evas); + Interop.Elementary.elm_object_part_content_set(_handle, "elm.swallow.content", _realHandle); + + return _handle; + } + + private void InitializeSmartEvent() + { + // focus dummy + _focusIn = new SmartEvent(this, "focused"); + _focusOut = new SmartEvent(this, "unfocused"); + + _focusIn.On += (s, e) => { ((WebView)s).SetFocus(true); }; + _focusOut.On += (s, e) => { ((WebView)s).SetFocus(false); }; + + _loadStarted = new SmartEvent(this, _realHandle, "load,started"); + _loadFinished = new SmartEvent(this, _realHandle, "load,finished"); + _loadError = new SmartEvent(this, _realHandle, "load,error", SmartCallbackLoadErrorArgs.CreateFromSmartEvent); + _titleChanged = new SmartEvent(this, _realHandle, "title,changed", SmartCallbackArgs.CreateFromSmartEvent); + _urlChanged = new SmartEvent(this, _realHandle, "url,changed", SmartCallbackArgs.CreateFromSmartEvent); + + _loadStarted.On += (s, e) => { LoadStarted?.Invoke(this, EventArgs.Empty); }; + _loadFinished.On += (s, e) => { LoadFinished?.Invoke(this, EventArgs.Empty); }; + _loadError.On += (s, e) => { LoadError?.Invoke(this, e); }; + _titleChanged.On += (s, e) => { TitleChanged?.Invoke(this, e); }; + _urlChanged.On += (s, e) => { UrlChanged?.Invoke(this, e); }; + } + } +} diff --git a/test/Tizen.Tapitest/Tizen.Tapitest.csproj b/test/Tizen.Tapitest/Tizen.Tapitest.csproj index c10f988..7d0d739 100755 --- a/test/Tizen.Tapitest/Tizen.Tapitest.csproj +++ b/test/Tizen.Tapitest/Tizen.Tapitest.csproj @@ -1,124 +1,124 @@ - - - - 14.0 - Debug - AnyCPU - 8.0.30703 - 2.0 - {2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {BC2C461D-A67A-47FF-8AAA-D584BD379226} - Exe - Properties - Tizen.Tapitest - Tizen.Tapitest - 512 - en-US - - - .NETCoreApp - v1.0 - false - .NETCoreApp,Version=v1.0 - .NETCoreApp,Version=v1.0 - true - $(NoWarn);1701 - false - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - {5bf0618d-32ca-4356-b25b-11bdfd0e6119} - Tizen.Tapi - - - - + + + + 14.0 + Debug + AnyCPU + 8.0.30703 + 2.0 + {2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {BC2C461D-A67A-47FF-8AAA-D584BD379226} + Exe + Properties + Tizen.Tapitest + Tizen.Tapitest + 512 + en-US + + + .NETCoreApp + v1.0 + false + .NETCoreApp,Version=v1.0 + .NETCoreApp,Version=v1.0 + true + $(NoWarn);1701 + false + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + {5bf0618d-32ca-4356-b25b-11bdfd0e6119} + Tizen.Tapi + + + + - + --> + + --> - <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) - <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) - true - - - - $(MSBuildExtensionsPath)\Tizen - $(TizenBuildPath)\bin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + --> + <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) + <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) + true + + + + $(MSBuildExtensionsPath)\Tizen + $(TizenBuildPath)\bin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Tizen.Tapitest/Tizen.Tapitest.project.json b/test/Tizen.Tapitest/Tizen.Tapitest.project.json index 857f342..d6b7a9b 100755 --- a/test/Tizen.Tapitest/Tizen.Tapitest.project.json +++ b/test/Tizen.Tapitest/Tizen.Tapitest.project.json @@ -1,27 +1,27 @@ -{ - "buildOptions": { - "emitEntryPoint": true, - "debugType": "portable", - "platform": "AnyCPU", - "preserveCompilationContext": true - }, - "dependencies": { - "ElmSharp": "1.2.0-beta-001", - "Microsoft.NETCore.App": "1.1.1", - "Tizen.Applications.UI": "1.5.8", - "Xamarin.Forms": "2.3.5.239-pre3", - "Xamarin.Forms.Platform.Tizen": "2.3.5-r233-008" - }, - "runtimes": { - "win": {}, - "linux": {} - }, - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "portable-net45+wp80+win81+wpa81", - "netstandard1.6" - ] - } - } +{ + "buildOptions": { + "emitEntryPoint": true, + "debugType": "portable", + "platform": "AnyCPU", + "preserveCompilationContext": true + }, + "dependencies": { + "ElmSharp": "1.2.0-beta-001", + "Microsoft.NETCore.App": "1.1.1", + "Tizen.Applications.UI": "1.5.8", + "Xamarin.Forms": "2.3.5.239-pre3", + "Xamarin.Forms.Platform.Tizen": "2.3.5-r233-008" + }, + "runtimes": { + "win": {}, + "linux": {} + }, + "frameworks": { + "netcoreapp1.0": { + "imports": [ + "portable-net45+wp80+win81+wpa81", + "netstandard1.6" + ] + } + } } \ No newline at end of file diff --git a/test/Tizen.WebView.Test/Properties/AssemblyInfo.cs b/test/Tizen.WebView.Test/Properties/AssemblyInfo.cs index 6200996..193c2d8 100644 --- a/test/Tizen.WebView.Test/Properties/AssemblyInfo.cs +++ b/test/Tizen.WebView.Test/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Tizen.WebView.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Samsung Electronics")] -[assembly: AssemblyProduct("Tizen.WebView.Test")] -[assembly: AssemblyCopyright("Copyright © Samsung Electronics 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b57dafa3-b566-4ebf-a6f0-ecd2224a748d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tizen.WebView.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Samsung Electronics")] +[assembly: AssemblyProduct("Tizen.WebView.Test")] +[assembly: AssemblyCopyright("Copyright © Samsung Electronics 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b57dafa3-b566-4ebf-a6f0-ecd2224a748d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] -- 2.7.4