# Auto-generated from csapi-tizenfx.spec.in by makespec.sh
%define TIZEN_NET_API_VERSION 11
-%define TIZEN_NET_RPM_VERSION 11.0.0.17999+nui22241
-%define TIZEN_NET_NUGET_VERSION 11.0.0.17999
+%define TIZEN_NET_RPM_VERSION 11.0.0.999+nui22243
+%define TIZEN_NET_NUGET_VERSION 11.0.0.99999
%define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
%define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
NUGET_VERSION=11.0.0.99999
# RPM Version Suffix
-RPM_VERSION_SUFFIX=nui22241
+RPM_VERSION_SUFFIX=nui22243
internal delegate void FrameLowBatteryCallback(IntPtr context, int status, IntPtr userData);
internal delegate void FrameLowMemoryCallback(IntPtr context, int status, IntPtr userData);
internal delegate void FrameSuspendedStateCallback(IntPtr context, int state, IntPtr userData);
+ internal delegate void FrameTimeZoneChangedCallback(IntPtr context, string timeZone, string timeZoneId, IntPtr userData);
internal struct FrameLifecycleCallbacks
{
public FrameLowBatteryCallback OnLowBattery;
public FrameLowMemoryCallback OnLowMemory;
public FrameSuspendedStateCallback OnSuspendedState;
+ public FrameTimeZoneChangedCallback OnTimeZoneChanged;
}
internal delegate bool ServiceCreateCallback(IntPtr context, IntPtr userData);
internal delegate void ServiceLowBatteryCallback(IntPtr context, int status, IntPtr userData);
internal delegate void ServiceLowMemoryCallback(IntPtr context, int status, IntPtr userData);
internal delegate void ServiceSuspendedStateCallback(IntPtr context, int state, IntPtr userData);
+ internal delegate void ServiceTimeZoneChangedCallback(IntPtr context, string timeZone, string timeZoneId, IntPtr userData);
internal struct ServiceLifecycleCallbacks
{
public ServiceLowBatteryCallback OnLowBattery;
public ServiceLowMemoryCallback OnLowMemory;
public ServiceSuspendedStateCallback OnSuspendedState;
+ public ServiceTimeZoneChangedCallback OnTimeZoneChanged;
}
internal delegate IntPtr WidgetCreateCallback(IntPtr context, int width, int height, IntPtr userData);
internal delegate void WidgetLowBatteryCallback(IntPtr context, int status, IntPtr userData);
internal delegate void WidgetLowMemoryCallback(IntPtr context, int status, IntPtr userData);
internal delegate void WidgetSuspendedStateCallback(IntPtr context, int state, IntPtr userData);
+ internal delegate void WidgetTimeZoneChangedCallback(IntPtr context, string timeZone, string timeZoneId, IntPtr userData);
internal struct WidgetLifecycleCallbacks
{
public WidgetLowBatteryCallback OnLowBattery;
public WidgetLowMemoryCallback OnLowMemory;
public WidgetSuspendedStateCallback OnSuspendedState;
+ public WidgetTimeZoneChangedCallback OnTimeZoneChanged;
}
internal delegate IntPtr BaseCreateCallback(IntPtr context, IntPtr userData);
internal delegate void BaseLowBatteryCallback(IntPtr context, int status, IntPtr userData);
internal delegate void BaseLowMemoryCallback(IntPtr context, int status, IntPtr userData);
internal delegate void BaseSuspendedStateCallback(IntPtr context, int state, IntPtr userData);
+ internal delegate void BaseTimeZoneChangedCallback(IntPtr context, string timeZone, string timeZoneId, IntPtr userData);
[DllImport(Libraries.CompCoreBase, EntryPoint = "component_based_app_base_main")]
internal static extern ErrorCode BaseMain(int argc, string[] argv, ref CBAppLifecycleCallbacks callback, IntPtr userData);
public event EventHandler<SuspendedStateEventArgs> SuspendedStateChanged;
/// <summary>
+ /// Occurs when the time zone is changed.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ public event EventHandler<TimeZoneChangedEventArgs> TimeZoneChanged;
+
+ /// <summary>
/// A component instance ID.
/// It will be created after OnCreate method is invoked.
/// </summary>
SuspendedStateChanged?.Invoke(this, new SuspendedStateEventArgs((SuspendedState)state));
}
+ internal void OnTimeZoneChangedCallback(string timeZone, string timeZoneId)
+ {
+ TimeZoneChanged?.Invoke(this, new TimeZoneChangedEventArgs(timeZone, timeZoneId));
+ }
+
/// <summary>
/// Sends the launch request asynchronously.
/// </summary>
}
}
+ protected void OnTimeZoneChangedCallback(IntPtr context, string timeZone, string timeZoneId, IntPtr userData)
+ {
+ foreach (BaseComponent com in ComponentInstances)
+ {
+ if (com.Handle == context)
+ {
+ com.OnTimeZoneChangedCallback(timeZone, timeZoneId);
+ }
+ }
+ }
+
protected void OnRestoreCallback(IntPtr context, IntPtr content, IntPtr userData)
{
foreach (BaseComponent com in ComponentInstances)
_callbacks.OnResume = new Interop.CBApplication.FrameResumeCallback(OnResumeCallback);
_callbacks.OnStart = new Interop.CBApplication.FrameStartCallback(OnStartCallback);
_callbacks.OnStop = new Interop.CBApplication.FrameStopCallback(OnStopCallback);
+ _callbacks.OnTimeZoneChanged = new Interop.CBApplication.FrameTimeZoneChangedCallback(OnTimeZoneChangedCallback);
Parent = parent;
}
{
if (fc.Handle == context)
{
- SafeAppControlHandle handle = new SafeAppControlHandle(appControl, false);
+ using SafeAppControlHandle handle = new SafeAppControlHandle(appControl, false);
AppControl control = new AppControl(handle);
fc.OnStart(control, restarted);
break;
_callbacks.OnCreate = new Interop.CBApplication.ServiceCreateCallback(OnCreateCallback);
_callbacks.OnDestroy = new Interop.CBApplication.ServiceDestroyCallback(OnDestroyCallback);
_callbacks.OnStart = new Interop.CBApplication.ServiceStartCommandCallback(OnStartCallback);
+ _callbacks.OnTimeZoneChanged = new Interop.CBApplication.ServiceTimeZoneChangedCallback(OnTimeZoneChangedCallback);
Parent = parent;
}
{
if (sc.Handle == context)
{
- SafeAppControlHandle handle = new SafeAppControlHandle(appControl, false);
+ using SafeAppControlHandle handle = new SafeAppControlHandle(appControl, false);
AppControl control = new AppControl(handle);
sc.OnStartCommand(control, restarted);
break;
_callbacks.OnResume = new Interop.CBApplication.WidgetResumeCallback(OnResumeCallback);
_callbacks.OnStart = new Interop.CBApplication.WidgetStartCallback(OnStartCallback);
_callbacks.OnStop = new Interop.CBApplication.WidgetStopCallback(OnStopCallback);
+ _callbacks.OnTimeZoneChanged = new Interop.CBApplication.WidgetTimeZoneChangedCallback(OnTimeZoneChangedCallback);
Parent = parent;
}
private void PopupStylePropertyChanged(object sender, PropertyChangedEventArgs e)
{
- if (e.PropertyName.Equals("LayoutDirection"))
+ if (e.PropertyName is var propName && propName != null && propName.Equals("LayoutDirection"))
{
btGroup.UpdateButton(buttonStyle);
}
private void TitlePropertyChanged(object sender, PropertyChangedEventArgs e)
{
- if (isFadeOutColorSet == false && e.PropertyName.Equals("BackgroundColor") )
+ if (isFadeOutColorSet == false && e.PropertyName is var propName && propName != null && propName.Equals("BackgroundColor") )
{
fadeOutColor = this.BackgroundColor;
UpdateImage();
public static extern global::System.IntPtr Get();
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Clipboard_SetData")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
public static extern bool SetData(global::System.Runtime.InteropServices.HandleRef clipboard, string mimeType, string data);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Clipboard_GetData")]
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Clipboard_DataReceivedSignal")]
public static extern global::System.IntPtr ClipboardDataReceivedSignal(global::System.Runtime.InteropServices.HandleRef clipboard);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Clipboard_DataSelectedSignal")]
+ public static extern global::System.IntPtr ClipboardDataSelectedSignal(global::System.Runtime.InteropServices.HandleRef clipboard);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ClipboardSignal_Empty")]
[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
public static extern bool ClipboardSignalEmpty(global::System.Runtime.InteropServices.HandleRef signal);
--- /dev/null
+/*
+ * Copyright(c) 2023 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 Tizen.NUI
+{
+ internal static partial class Interop
+ {
+ internal static partial class PointerConstraints
+ {
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_PointerConstraintsEvent__SWIG_0")]
+ public static extern global::System.IntPtr NewPointerConstraints(int x, int y, bool locked, bool confined);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_PointerConstraintsEvent")]
+ public static extern void DeletePointerConstraints(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PointerConstraintsEvent_x_get")]
+ public static extern int XGet(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PointerConstraintsEvent_y_get")]
+ public static extern int YGet(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PointerConstraintsEvent_locked_get")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+ public static extern bool LockedGet(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PointerConstraintsEvent_confined_get")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+ public static extern bool ConfinedGet(global::System.Runtime.InteropServices.HandleRef jarg1);
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright(c) 2023 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 Tizen.NUI
+{
+ internal static partial class Interop
+ {
+ internal static partial class WindowPointerConstraintsSignal
+ {
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowPointerConstraintsEventSignal")]
+ public static extern global::System.IntPtr GetSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowPointerConstraintsEventSignal_Empty")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+ public static extern bool Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowPointerConstraintsEventSignal_GetConnectionCount")]
+ public static extern uint GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowPointerConstraintsEventSignal_Connect")]
+ public static extern void Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowPointerConstraintsEventSignal_Disconnect")]
+ public static extern void Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowPointerConstraintsEventSignal_Emit")]
+ public static extern void Emit(global::System.Runtime.InteropServices.HandleRef signalType, global::System.Runtime.InteropServices.HandleRef window, global::System.Runtime.InteropServices.HandleRef mouseEvent);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_WindowPointerConstraintsEventSignal")]
+ public static extern global::System.IntPtr NewWindowPointerConstraintsSignal();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_WindowPointerConstraintsEventSignal")]
+ public static extern void DeleteWindowPointerConstraintsSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright(c) 2023 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.
+ *
+ */
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI
+{
+ internal class WindowPointerConstraintsSignal : Disposable
+ {
+ internal WindowPointerConstraintsSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ {
+ }
+
+ /// <summary>
+ /// Dispose
+ /// </summary>
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+ {
+ Interop.WindowPointerConstraintsSignal.DeleteWindowPointerConstraintsSignal(swigCPtr);
+ }
+
+ /// <summary>
+ /// Queries whether there are any connected slots.
+ /// </summary>
+ /// <returns>True if there are any slots connected to the signal</returns>
+ public bool Empty()
+ {
+ bool ret = Interop.WindowPointerConstraintsSignal.Empty(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Queries the number of slots.
+ /// </summary>
+ /// <returns>The number of slots connected to this signal</returns>
+ public uint GetConnectionCount()
+ {
+ uint ret = Interop.WindowPointerConstraintsSignal.GetConnectionCount(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// Connects a function.
+ /// </summary>
+ /// <param name="func">The function to connect</param>
+ public void Connect(System.Delegate func)
+ {
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
+ {
+ Interop.WindowPointerConstraintsSignal.Connect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// Disconnects a function.
+ /// </summary>
+ /// <param name="func">The function to disconnect</param>
+ public void Disconnect(System.Delegate func)
+ {
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
+ {
+ Interop.WindowPointerConstraintsSignal.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ /// <summary>
+ /// Emits the signal.
+ /// </summary>
+ /// <param name="window">The first value to pass to callbacks</param>
+ /// <param name="pointerConstraints">The second value to pass to callbacks</param>
+ public void Emit(Window window, PointerConstraints pointerConstraints)
+ {
+ Interop.WindowPointerConstraintsSignal.Emit(SwigCPtr, Window.getCPtr(window), PointerConstraints.getCPtr(pointerConstraints));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// The constructor.
+ /// </summary>
+ public WindowPointerConstraintsSignal(Window window) : this(Interop.WindowPointerConstraintsSignal.GetSignal(Window.getCPtr(window)), false)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+}
{
this.ClipboardDataReceivedSignal().Disconnect(clipboardDataReceivedCallback);
}
+
+ if (clipboardDataSelectedCallback != null)
+ {
+ this.ClipboardDataSelectedSignal().Disconnect(clipboardDataSelectedCallback);
+ }
}
base.Dispose(type);
}
/// <summary>
+ /// ClipboardDataSelectedEventArgs is a class to record clipboard selected event arguments which will be sent to user.<br/>
+ /// This is to catch data selection event.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ClipboardDataSelectedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// The mime type of clipboard selected data.
+ /// </summary>
+ public string MimeType { get; set; }
+ }
+
+ /// <summary>
/// ClipboardEventArgs is a class to record clipboard event arguments which will be sent to user.<br/>
/// This is for internal use only.
/// </summary>
private EventHandler<ClipboardEventArgs> clipboardDataReceivedEventHandler;
private ClipboardDataReceivedCallback clipboardDataReceivedCallback;
+ private EventHandler<ClipboardDataSelectedEventArgs> clipboardDataSelectedEventHandler;
+ private ClipboardDataSelectedCallback clipboardDataSelectedCallback;
+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void ClipboardDataReceivedCallback(uint id, string mimeType, string data);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ private delegate void ClipboardDataSelectedCallback(string mimeType);
+
+ /// <summary>
+ /// The DataSelected event is emitted when a copy event occurs somewhere.<br/>
+ /// In order for this event to operate normally,<br/>
+ /// the process using this event must be Secondary Selection.
+ /// </summary>
+ /// <example>
+ /// The following example demonstrates how to use the DataSelected.
+ /// <code>
+ /// kvmService.SetSecondarySelction(); // precondition
+ ///
+ /// Clipboard.Instance.DataSelected += (s, e) =>
+ /// {
+ /// string selectedType = e.MimeType;
+ /// };
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<ClipboardDataSelectedEventArgs> DataSelected
+ {
+ add
+ {
+ if (clipboardDataSelectedEventHandler == null)
+ {
+ clipboardDataSelectedCallback = (OnClipboardDataSelected);
+ ClipboardDataSelectedSignal().Connect(clipboardDataSelectedCallback);
+ }
+ clipboardDataSelectedEventHandler += value;
+ }
+ remove
+ {
+ clipboardDataSelectedEventHandler -= value;
+ if (clipboardDataSelectedEventHandler == null && ClipboardDataSelectedSignal().Empty() == false)
+ {
+ ClipboardDataSelectedSignal().Disconnect(clipboardDataSelectedCallback);
+ }
+ }
+ }
+
private event EventHandler<ClipboardEventArgs> ClipboardDataReceived
{
add
}
}
+ internal ClipboardSignal ClipboardDataSelectedSignal()
+ {
+ var ret = new ClipboardSignal(Interop.Clipboard.ClipboardDataSelectedSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ private void OnClipboardDataSelected(string mimeType)
+ {
+ var e = new ClipboardDataSelectedEventArgs();
+ e.MimeType = mimeType;
+ clipboardDataSelectedEventHandler?.Invoke(this, e);
+ }
+
internal ClipboardSignal ClipboardDataReceivedSignal()
{
var ret = new ClipboardSignal(Interop.Clipboard.ClipboardDataReceivedSignal(SwigCPtr), false);
--- /dev/null
+/*
+ * Copyright(c) 2023 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.
+ *
+ */
+using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI
+{
+ /// <summary>
+ /// PointerConstraints is used when pointer is locked/unlocked
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class PointerConstraints : Disposable
+ {
+
+ /// <summary>
+ /// The default constructor.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PointerConstraints() : this(Interop.PointerConstraints.NewPointerConstraints(0, 0, false, false), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// The constructor.
+ /// </summary>
+ /// <param name="x">The x coordinate relative to window where event happened.</param>
+ /// <param name="y">The y coordinate relative to window where event happened.</param>
+ /// <param name="locked">The status whether pointer is locked/unlocked.</param>
+ /// <param name="confined">The status whether pointer is confined/unconfined.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PointerConstraints(int x, int y, bool locked, bool confined): this(Interop.PointerConstraints.NewPointerConstraints(x, y, locked, confined), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ internal PointerConstraints(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ {
+ }
+
+ /// <summary>
+ /// Gets the x, y position,
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Position2D Position
+ {
+ get
+ {
+ return position;
+ }
+ }
+
+ /// <summary>
+ /// Gets the status whether pointer is locked/unlocked.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool Locked
+ {
+ get
+ {
+ return locked;
+ }
+ }
+
+ /// <summary>
+ /// Gets the status whether pointer is confined/unconfined.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool Confined
+ {
+ get
+ {
+ return confined;
+ }
+ }
+
+ private Position2D position
+ {
+ get
+ {
+ Position2D ret = new Position2D(Interop.PointerConstraints.XGet(SwigCPtr), Interop.PointerConstraints.YGet(SwigCPtr));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ }
+
+ private bool locked
+ {
+ get
+ {
+ bool ret = Interop.PointerConstraints.LockedGet(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ }
+
+ private bool confined
+ {
+ get
+ {
+ bool ret = Interop.PointerConstraints.ConfinedGet(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ }
+
+ internal static PointerConstraints GetPointerConstraintsFromPtr(global::System.IntPtr cPtr)
+ {
+ PointerConstraints ret = new PointerConstraints(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+ {
+ Interop.PointerConstraints.DeletePointerConstraints(swigCPtr);
+ }
+ }
+}
private MoveCompletedEventCallbackType moveCompletedEventCallback;
private ResizeCompletedEventCallbackType resizeCompletedEventCallback;
private InsetsChangedEventCallbackType insetsChangedEventCallback;
+ private WindowPointerConstraintsEventCallback windowPointerConstraintsEventCallback;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void WindowFocusChangedEventCallbackType(IntPtr window, bool focusGained);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void ResizeCompletedEventCallbackType(IntPtr window, IntPtr size);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void InsetsChangedEventCallbackType(int partType, int partState, IntPtr extents);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ private delegate void WindowPointerConstraintsEventCallback(IntPtr window, IntPtr constraintsEvent);
/// <summary>
}
}
+ /// <summary>
+ /// Emits the event when pointer is locked/unlocked<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<PointerConstraintsEventArgs> PointerConstraintsEvent
+ {
+ add
+ {
+ if (windowPointerConstraintsEventHandler == null)
+ {
+ windowPointerConstraintsEventCallback = OnWindowPointerConstraintsEvent;
+ using WindowPointerConstraintsSignal signal = new WindowPointerConstraintsSignal(Interop.WindowPointerConstraintsSignal.GetSignal(SwigCPtr), false);
+ signal?.Connect(windowPointerConstraintsEventCallback);
+ }
+ windowPointerConstraintsEventHandler += value;
+ }
+ remove
+ {
+ windowPointerConstraintsEventHandler -= value;
+ if (windowPointerConstraintsEventHandler == null && windowPointerConstraintsEventCallback != null)
+ {
+ using WindowPointerConstraintsSignal signal = new WindowPointerConstraintsSignal(Interop.WindowPointerConstraintsSignal.GetSignal(SwigCPtr), false);
+ signal?.Disconnect(windowMouseRelativeEventCallback);
+ windowPointerConstraintsEventCallback = null;
+ }
+ }
+ }
+
private event EventHandler<FocusChangedEventArgs> windowFocusChangedEventHandler;
private event EventHandler<TouchEventArgs> rootLayerTouchDataEventHandler;
private ReturnTypeEventHandler<object, TouchEventArgs, bool> rootLayerInterceptTouchDataEventHandler;
private event EventHandler<WindowMoveCompletedEventArgs> moveCompletedHandler;
private event EventHandler<WindowResizeCompletedEventArgs> resizeCompletedHandler;
private event EventHandler<InsetsChangedEventArgs> insetsChangedEventHandler;
+ private event EventHandler<PointerConstraintsEventArgs> windowPointerConstraintsEventHandler;
internal event EventHandler EventProcessingFinished
signal?.Disconnect(insetsChangedEventCallback);
insetsChangedEventCallback = null;
}
+
+ if (windowPointerConstraintsEventCallback != null)
+ {
+ using WindowPointerConstraintsSignal signal = new WindowPointerConstraintsSignal(Interop.WindowPointerConstraintsSignal.GetSignal(GetBaseHandleCPtrHandleRef), false);
+ signal?.Disconnect(windowPointerConstraintsEventCallback);
+ windowPointerConstraintsEventCallback = null;
+ }
}
private void OnWindowFocusedChanged(IntPtr window, bool focusGained)
}
}
+ private void OnWindowPointerConstraintsEvent(IntPtr view, IntPtr constraintsEvent)
+ {
+ if (constraintsEvent == global::System.IntPtr.Zero)
+ {
+ NUILog.Error("constraintsEvent should not be null!");
+ return;
+ }
+
+ if (windowPointerConstraintsEventHandler != null)
+ {
+ PointerConstraintsEventArgs e = new PointerConstraintsEventArgs();
+ e.PointerConstraints = Tizen.NUI.PointerConstraints.GetPointerConstraintsFromPtr(constraintsEvent);
+ windowPointerConstraintsEventHandler(this, e);
+ }
+ }
+
/// <summary>
/// The focus changed event argument.
/// </summary>
}
}
+
+ /// <summary>
+ /// PointerConstraints evnet arguments.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class PointerConstraintsEventArgs : EventArgs
+ {
+ private PointerConstraints constraintsEvent;
+
+ /// <summary>
+ /// PointerConstraints event.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PointerConstraints PointerConstraints
+ {
+ get
+ {
+ return constraintsEvent;
+ }
+ set
+ {
+ constraintsEvent = value;
+ }
+ }
+ }
+
/// <summary>
/// Do not use this, that will be deprecated.
/// </summary>
{
class Program : NUIApplication
{
- const string TAG = "NUIClipboard";
+ const string TAG = "clipboard";
+
+ // Below are the MIME Types used in Tizen World(NUI, EFL).
const string MIME_TYPE_PLAIN_TEXT = "text/plain;charset=utf-8";
- const string MIME_TYPE_TEXT_URI = "text/uri-list";
const string MIME_TYPE_HTML = "application/xhtml+xml";
+ const string MIME_TYPE_TEXT_URI = "text/uri-list";
TextField fieldCopy;
- TextField fieldPaste;
-
TextLabel labelType;
TextLabel labelData;
+ Button buttonCopy;
+ Button buttonPaste;
+ Button buttonCopyHtml;
+ Button buttonPasteHtml;
+ Button buttonCopyUri;
+ Button buttonPasteUri;
+
protected override void OnCreate()
{
base.OnCreate();
void Initialize()
{
- Window.Instance.WindowSize = new Size(900, 1080);
- Window.Instance.BackgroundColor = Color.White;
- View mainView = NewView(false);
- Window.Instance.GetDefaultLayer().Add(mainView);
+ GenerateUI(900, 1080);
- TextLabel title = NewTextLabel("Tizen.NUI.Clipboard Test", LayoutParamPolicies.MatchParent);
- title.HorizontalAlignment = HorizontalAlignment.Center;
- title.PointSize = 30.0f;
- mainView.Add(title);
-
- string descriptionText = "[Description]\n" +
- "* Copy : Copy the text entered in the TextField using the Clipboard's SetData() API.\n" +
- "* This sample uses the 'text/plain;charset=utf-8' MIME type to send and receive data.\n" +
- "* Paste : Paste the text using the Clipboard's GetData() API.\n" +
- "* Clear : Clear Information.";
+ // The API used by the application is Clipboard's SetData() and GetData() methods.
+ // Please refer to the code in the button Clicked event below.
- TextLabel description = NewTextLabel(descriptionText, LayoutParamPolicies.MatchParent);
- description.PointSize = 20.0f;
- mainView.Add(description);
-
- View vertView1 = NewView(true);
- mainView.Add(vertView1);
-
- fieldCopy = NewTextField("Enter text to copy", LayoutParamPolicies.MatchParent);
- vertView1.Add(fieldCopy);
-
- Button buttonCopy = NewButton("Copy");
- vertView1.Add(buttonCopy);
+ // TEXT type test : "text/plain;charset=utf-8"
buttonCopy.Clicked += (s, e) =>
{
string data = fieldCopy.Text;
+ Tizen.Log.Info(TAG, $"SetData type:{MIME_TYPE_PLAIN_TEXT}, data:{data}\n");
+
+ // Set "text/plain;charset=utf-8" type data on the clipboard.
Clipboard.Instance.SetData(MIME_TYPE_PLAIN_TEXT, data);
- Tizen.Log.Debug(TAG, $"SetData type:{MIME_TYPE_PLAIN_TEXT}, data:{data}");
};
-
- View vertView2 = NewView(true);
- mainView.Add(vertView2);
-
- Button buttonPaste = NewButton("Paste");
- vertView2.Add(buttonPaste);
buttonPaste.Clicked += (s, e) =>
{
+ Tizen.Log.Info(TAG, $"GetData request type:{MIME_TYPE_PLAIN_TEXT}\n");
+
+ // Request to receive "text/plain;charset=utf-8" type data from clipboard.
+ // The results can be received through the OnClipboardDataReceived callback.
Clipboard.Instance.GetData(MIME_TYPE_PLAIN_TEXT, OnClipboardDataReceived);
- Tizen.Log.Debug(TAG, $"GetData request type:{MIME_TYPE_PLAIN_TEXT}");
};
- Button buttonCopyClear = NewButton("Clear");
- vertView2.Add(buttonCopyClear);
- buttonCopyClear.Clicked += (s, e) =>
+ // HTML type test : "application/xhtml+xml"
+ buttonCopyHtml.Clicked += (s, e) =>
{
- fieldCopy.Text = "";
- labelType.Text = " ";
- labelData.Text = " ";
+ string data = fieldCopy.Text;
+ Tizen.Log.Info(TAG, $"SetData type:{MIME_TYPE_HTML}, data:{data}\n");
+ Clipboard.Instance.SetData(MIME_TYPE_HTML, data);
};
- View vertView3 = NewView(true);
- mainView.Add(vertView3);
-
- TextLabel pastedType = NewTextLabel("MIME type", 300);
- vertView3.Add(pastedType);
-
- labelType = NewTextLabel(" ", LayoutParamPolicies.MatchParent);
- vertView3.Add(labelType);
-
- View vertView4 = NewView(true);
- mainView.Add(vertView4);
+ buttonPasteHtml.Clicked += (s, e) =>
+ {
+ Tizen.Log.Info(TAG, $"GetData request type:{MIME_TYPE_HTML}\n");
+ Clipboard.Instance.GetData(MIME_TYPE_HTML, OnClipboardDataReceived);
+ };
- TextLabel pastedData = NewTextLabel("Data", 300);
- vertView4.Add(pastedData);
+ // URI type test : "text/uri-list"
+ buttonCopyUri.Clicked += (s, e) =>
+ {
+ string data = fieldCopy.Text;
+ Tizen.Log.Info(TAG, $"SetData type:{MIME_TYPE_TEXT_URI}, data:{data}\n");
+ Clipboard.Instance.SetData(MIME_TYPE_TEXT_URI, data);
+ };
- labelData = NewTextLabel(" ", LayoutParamPolicies.MatchParent);
- vertView4.Add(labelData);
+ buttonPasteUri.Clicked += (s, e) =>
+ {
+ Tizen.Log.Info(TAG, $"GetData request type:{MIME_TYPE_TEXT_URI}\n");
+ Clipboard.Instance.GetData(MIME_TYPE_TEXT_URI, OnClipboardDataReceived);
+ };
}
public void OnClipboardDataReceived(bool success, ClipEvent clipEvent)
{
if (!success)
{
- Tizen.Log.Debug(TAG, $"Data receive fail");
+ Tizen.Log.Error(TAG, $"Data receive fail");
return;
}
- Tizen.Log.Debug(TAG, $"OnClipboardDataReceived type:{clipEvent.MimeType}, data{clipEvent.Data}");
+ Tizen.Log.Info(TAG, $"OnClipboardDataReceived type:{clipEvent.MimeType}, data:{clipEvent.Data}\n");
// info update
labelType.Text = clipEvent.MimeType;
labelData.Text = clipEvent.Data;
}
+ // UI code
+ public void GenerateUI(int width, int height)
+ {
+ Window.Instance.WindowSize = new Size(width, height);
+ Window.Instance.BackgroundColor = Color.White;
+
+ // Top UI
+ View mainView = NewView(false);
+ Window.Instance.GetDefaultLayer().Add(mainView);
+
+ mainView.Add(NewTitle("Tizen.NUI.Clipboard Test"));
+ mainView.Add(NewPadding(5));
+ mainView.Add(NewInfo(" ▼ Description"));
+
+ string descriptionText = "* <u>Copy</u> : Copy the text entered in the TextField using the Clipboard's <u><i>SetData()</i></u> API.\n" +
+ "* <u>Paste</u> : Paste the text using the Clipboard's <u><i>GetData()</i></u> API.\n" +
+ "* <u>Clear</u> : Clear Information.\n" +
+ "* This sample uses three different <u><i>MIME types(TEXT, HTML, URI)</i></u> to send and receive data.\n" +
+ "* In order to send and receive data, the requested <u><i>MIME type must be the same.</i></u>\n" +
+ "* For example, if copy the TEXT type and try to paste the HTML type, may receive a failure callback.";
+
+ mainView.Add(NewInfo(descriptionText, true));
+ mainView.Add(NewPadding(5));
+ mainView.Add(NewInfo(" ▼ Enter the text you want copy into the TextField"));
+
+ View vertView1 = NewView(true);
+ mainView.Add(vertView1);
+
+ fieldCopy = NewTextField("Enter text to copy", LayoutParamPolicies.MatchParent);
+ vertView1.Add(fieldCopy);
+
+ Button buttonCopyClear = NewButton("Clear");
+ vertView1.Add(buttonCopyClear);
+ buttonCopyClear.Clicked += (s, e) =>
+ {
+ fieldCopy.Text = "";
+ labelType.Text = " ";
+ labelData.Text = " ";
+ };
+
+ //Copy & Paste Button
+ mainView.Add(NewPadding(5));
+ mainView.Add(NewInfo(" ▼ Select Copy or Paste with MIME type"));
+
+ // plain text
+ View vertView4 = NewView(true);
+ mainView.Add(vertView4);
+
+ vertView4.Add(NewTextLabel($"MIME type : {MIME_TYPE_PLAIN_TEXT}", LayoutParamPolicies.MatchParent));
+
+ buttonCopy = NewButton("Copy");
+ vertView4.Add(buttonCopy);
+
+ buttonPaste = NewButton("Paste");
+ vertView4.Add(buttonPaste);
+
+ // html
+ View vertView5 = NewView(true);
+ mainView.Add(vertView5);
+
+ vertView5.Add(NewTextLabel($"MIME type : {MIME_TYPE_HTML}", LayoutParamPolicies.MatchParent));
+
+ buttonCopyHtml = NewButton("Copy");
+ vertView5.Add(buttonCopyHtml);
+
+ buttonPasteHtml = NewButton("Paste");
+ vertView5.Add(buttonPasteHtml);
+
+ // text uri
+ View vertView6 = NewView(true);
+ mainView.Add(vertView6);
+
+ vertView6.Add(NewTextLabel($"MIME type : {MIME_TYPE_TEXT_URI}", LayoutParamPolicies.MatchParent));
+
+ buttonCopyUri = NewButton("Copy");
+ vertView6.Add(buttonCopyUri);
+
+ buttonPasteUri = NewButton("Paste");
+ vertView6.Add(buttonPasteUri);
+
+ // Bottom UI
+ mainView.Add(NewPadding(5));
+ mainView.Add(NewInfo(" ▼ Pasted information"));
+
+ // info type
+ View vertView2 = NewView(true);
+ mainView.Add(vertView2);
+
+ vertView2.Add(NewTextLabel("MIME type", 300));
+
+ labelType = NewTextLabel(" ", LayoutParamPolicies.MatchParent);
+ vertView2.Add(labelType);
+
+ // info data
+ View vertView3 = NewView(true);
+ mainView.Add(vertView3);
+
+ vertView3.Add(NewTextLabel("Data", 300));
+
+ labelData = NewTextLabel(" ", LayoutParamPolicies.MatchParent);
+ vertView3.Add(labelData);
+ }
+
public View NewView(bool horizontal)
{
var view = new View()
{
LinearOrientation = horizontal ? LinearLayout.Orientation.Horizontal : LinearLayout.Orientation.Vertical,
LinearAlignment = LinearLayout.Alignment.Begin,
- CellPadding = new Size2D(10, 20),
+ CellPadding = new Size2D(10, 10),
},
WidthSpecification = LayoutParamPolicies.MatchParent,
HeightSpecification = LayoutParamPolicies.WrapContent,
return view;
}
- public TextLabel NewTextLabel(string text, int width)
+ public View NewPadding(int height)
+ {
+ var view = new View()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = height,
+ };
+ return view;
+ }
+
+ public TextLabel NewTextLabel(string text, int width, bool borderLine = true)
{
var label = new TextLabel
{
MultiLine = true,
WidthSpecification = width,
HeightSpecification = LayoutParamPolicies.WrapContent,
- PointSize = 25.0f,
+ PointSize = 20.0f,
BackgroundColor = Color.White,
- BorderlineWidth = 1.0f,
+ BorderlineWidth = borderLine ? 1.0f : 0.0f,
+ EnableMarkup = true,
};
return label;
}
+ public TextLabel NewInfo(string text, bool borderLine = false)
+ {
+ var info = NewTextLabel(text, LayoutParamPolicies.MatchParent, borderLine);
+ info.PointSize = 16.0f;
+ return info;
+ }
+
+ public TextLabel NewTitle(string text)
+ {
+ var title = NewTextLabel(text, LayoutParamPolicies.MatchParent);
+ title.HorizontalAlignment = HorizontalAlignment.Center;
+ title.PointSize = 25.0f;
+ return title;
+ }
+
public TextField NewTextField(string placeholderText, int width)
{
var field = new TextField
PlaceholderTextFocused = placeholderText,
WidthSpecification = width,
HeightSpecification = LayoutParamPolicies.WrapContent,
- PointSize = 25.0f,
+ PointSize = 20.0f,
BackgroundColor = Color.White,
BorderlineWidth = 1.0f,
+ MaxLength = 1000,
};
return field;
}
var button = new Button(NewButtonStyle())
{
Text = text,
- PointSize = 25.0f,
+ PointSize = 20.0f,
WidthSpecification = 200,
HeightSpecification = LayoutParamPolicies.WrapContent,
+ ItemHorizontalAlignment = HorizontalAlignment.Center,
};
return button;
}
--- /dev/null
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.WindowSystem;
+
+/*
+ * This app has no UI.
+ * After the app is launched, it is hidden and the focus is skipped.
+ * This is a sample app that becomes SecondarySelection and catches the Copy event of another process.
+ * If there is another SecondarySelection already running on the device, this sample will not work properly.
+ */
+
+namespace NUIClipboardDataSelected
+{
+ class Program : NUIApplication
+ {
+ const string TAG = "clipboard";
+ const string MIME_TYPE_PLAIN_TEXT = "text/plain;charset=utf-8";
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ Window.Instance.WindowSize = new Size(1, 1);
+ Window.Instance.BackgroundColor = Color.White;
+
+ Tizen.NUI.WindowSystem.Shell.TizenShell tzShell;
+ tzShell = new Tizen.NUI.WindowSystem.Shell.TizenShell();
+ Window.Instance.SetAcceptFocus(false);
+
+ Tizen.NUI.WindowSystem.Shell.KVMService kvmService;
+ // Window that will act as KVM Service.
+ kvmService = new Tizen.NUI.WindowSystem.Shell.KVMService(tzShell, Window.Instance);
+ kvmService.SetSecondarySelction();
+
+ // This view has nothing to do with this test, just for easy debugging.
+ // If there is a view, it is exposed to the process monitor.
+ View view = NewView();
+ Window.Instance.GetDefaultLayer().Add(view);
+
+ // Register event handler.
+ Clipboard.Instance.DataSelected += OnClipboardDataSelected;
+
+ // Self copy test.
+ CopyTest();
+ }
+
+ // When copy occurs somewhere, this callback is invoked.
+ public void OnClipboardDataSelected(object sender, ClipboardDataSelectedEventArgs e)
+ {
+ // e.MimeType is the MIME type of the copy data that invoked this callback.
+ string selectedType = e.MimeType;
+ Tizen.Log.Info(TAG, $"OnClipboardDataSelected type:{selectedType}\n");
+
+ // Do something here.
+ // For example, MC app can call Clipboard's GetData() with the MIME type of the event argument.
+ Clipboard.Instance.GetData(selectedType, OnClipboardDataReceived);
+ }
+
+ // When call Clipboard's GetData(), the user callback is called.
+ public void OnClipboardDataReceived(bool success, ClipEvent clipEvent)
+ {
+ if (!success)
+ {
+ Tizen.Log.Error(TAG, $"Data receive fail");
+ return;
+ }
+
+ Tizen.Log.Info(TAG, $"OnClipboardDataReceived type:{clipEvent.MimeType}, data:{clipEvent.Data}\n");
+ }
+
+ public void CopyTest()
+ {
+ // Self copy test.
+ // * SetData() is called 5 seconds after app execution.
+ // * Observe the Log of OnClipboardDataSelected.
+ // * If the log is output, there is a problem somewhere.
+ // * DataSelected event should not be invoked
+ // * by the SetData() called within the SecondarySelection.
+ Timer timer = new Timer(5000);
+ timer.Tick += (s, e) =>
+ {
+ string data = "Lorem ipsum dolor sit amet consectetuer";
+ Tizen.Log.Info(TAG, $"SetData type:{MIME_TYPE_PLAIN_TEXT}, data:{data}\n");
+ Clipboard.Instance.SetData(MIME_TYPE_PLAIN_TEXT, data);
+ return false;
+ };
+ timer.Start();
+ }
+
+ public View NewView()
+ {
+ var view = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ LinearAlignment = LinearLayout.Alignment.Begin,
+ },
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.WrapContent,
+ BackgroundColor = Color.White,
+ };
+ return view;
+ }
+
+ static void Main(string[] args)
+ {
+ var app = new Program();
+ app.Run(args);
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>net6.0</TargetFramework>
+ </PropertyGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>portable</DebugType>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>None</DebugType>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.9" />
+ <ProjectReference Include="../../src/Tizen/Tizen.csproj" />
+ <ProjectReference Include="../../src/Tizen.NUI.Components/Tizen.NUI.Components.csproj" />
+ <ProjectReference Include="../../src/Tizen.NUI/Tizen.NUI.csproj" />
+ <ProjectReference Include="../../src/Tizen.NUI.WindowSystem/Tizen.NUI.WindowSystem.csproj" />
+ </ItemGroup>
+
+ <PropertyGroup>
+ <NeedInjection>True</NeedInjection>
+ </PropertyGroup>
+
+</Project>
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="org.tizen.example.NUIClipboardDataSelected" version="1.0.0">
+ <profile name="common" />
+ <ui-application appid="org.tizen.example.NUIClipboardDataSelected"
+ exec="NUIClipboardDataSelected.dll"
+ type="dotnet-nui"
+ multiple="false"
+ taskmanage="true"
+ nodisplay="false"
+ launch_mode="single"
+ >
+ <label>NUIClipboardDataSelected</label>
+ <icon>NUIClipboardDataSelected.png</icon>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ </ui-application>
+</manifest>