-/** 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.
-*
-*/
+/*
+ * 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.
+ *
+ */
+using System;
+using System.Runtime.InteropServices;
+using Tizen.NUI.BaseComponents;
+using System.ComponentModel;
+using System.Collections.Generic;
namespace Tizen.NUI
{
-
- using System;
- using System.Runtime.InteropServices;
- using Tizen.NUI.BaseComponents;
-
/// <summary>
- /// The window class is used internally for drawing.<br>
- /// The window has an orientation and indicator properties.<br>
+ /// The window class is used internally for drawing.<br />
+ /// The window has an orientation and indicator properties.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class Window : BaseHandle
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private Layer _rootLayer;
private string _windowTitle;
+ private List<Layer> _childLayers = new List<Layer>();
+ internal List<Layer> LayersChildren
+ {
+ get
+ {
+ return _childLayers;
+ }
+ }
+
internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
/// <summary>
/// To make the window instance be disposed.
/// </summary>
+ /// Please DO NOT use! This will be deprecated!
+ /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, IMFManager, TtsPlayer, Window) is not required.
+ /// Because it is Sigletone, so it is alive for one thread until the NUI is terminated, so it never be disposed.
+ /// <since_tizen> 3 </since_tizen>
+ [Obsolete("Please do not use! This will be deprecated!")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
protected override void Dispose(DisposeTypes type)
{
- if(disposed)
+ if (disposed)
{
return;
}
- if(type == DisposeTypes.Explicit)
+ if (type == DisposeTypes.Explicit)
{
//Called by User
//Release your own managed resources here.
return ret;
}
- internal static bool IsInstalled()
- {
+ internal static bool IsInstalled()
+ {
bool ret = NDalicPINVOKE.Stage_IsInstalled();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
- }
+ }
/// <summary>
/// Sets whether the window accepts a focus or not.
/// </summary>
/// <param name="accept">If a focus is accepted or not. The default is true.</param>
+ /// <since_tizen> 3 </since_tizen>
public void SetAcceptFocus(bool accept)
{
NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
/// Returns whether the window accepts a focus or not.
/// </summary>
/// <returns>True if the window accepts a focus, false otherwise.</returns>
+ /// <since_tizen> 3 </since_tizen>
public bool IsFocusAcceptable()
{
bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
/// <summary>
/// Shows the window if it is hidden.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void Show()
{
NDalicPINVOKE.Show(swigCPtr);
/// <summary>
/// Hides the window if it is showing.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void Hide()
{
NDalicPINVOKE.Hide(swigCPtr);
/// Retrieves whether the window is visible or not.
/// </summary>
/// <returns>True if the window is visible.</returns>
+ /// <since_tizen> 3 </since_tizen>
public bool IsVisible()
{
bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
/// Gets the count of supported auxiliary hints of the window.
/// </summary>
/// <returns>The number of supported auxiliary hints.</returns>
- public uint GetSupportedAuxiliaryHintCount() {
+ /// <since_tizen> 3 </since_tizen>
+ public uint GetSupportedAuxiliaryHintCount()
+ {
uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// </summary>
/// <param name="index">The index of the supported auxiliary hint lists.</param>
/// <returns>The auxiliary hint string of the index.</returns>
- public string GetSupportedAuxiliaryHint(uint index) {
+ /// <since_tizen> 3 </since_tizen>
+ public string GetSupportedAuxiliaryHint(uint index)
+ {
string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// <param name="hint">The auxiliary hint string.</param>
/// <param name="value">The value string.</param>
/// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
- public uint AddAuxiliaryHint(string hint, string value) {
+ /// <since_tizen> 3 </since_tizen>
+ public uint AddAuxiliaryHint(string hint, string value)
+ {
uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// </summary>
/// <param name="id">The ID of the auxiliary hint.</param>
/// <returns>True if no error occurred, false otherwise.</returns>
- public bool RemoveAuxiliaryHint(uint id) {
+ /// <since_tizen> 3 </since_tizen>
+ public bool RemoveAuxiliaryHint(uint id)
+ {
bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// <param name="id">The auxiliary hint ID.</param>
/// <param name="value">The value string to be set.</param>
/// <returns>True if no error occurred, false otherwise.</returns>
- public bool SetAuxiliaryHintValue(uint id, string value) {
+ /// <since_tizen> 3 </since_tizen>
+ public bool SetAuxiliaryHintValue(uint id, string value)
+ {
bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// </summary>
/// <param name="id">The auxiliary hint ID.</param>
/// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
- public string GetAuxiliaryHintValue(uint id) {
+ /// <since_tizen> 3 </since_tizen>
+ public string GetAuxiliaryHintValue(uint id)
+ {
string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// </summary>
/// <param name="hint">The auxiliary hint string.</param>
/// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
- public uint GetAuxiliaryHintId(string hint) {
+ /// <since_tizen> 3 </since_tizen>
+ public uint GetAuxiliaryHintId(string hint)
+ {
uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// Sets a region to accept input events.
/// </summary>
/// <param name="inputRegion">The region to accept input events.</param>
- public void SetInputRegion(Rectangle inputRegion) {
+ /// <since_tizen> 3 </since_tizen>
+ public void SetInputRegion(Rectangle inputRegion)
+ {
NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Gets or sets a window type.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public WindowType Type
{
get
/// </summary>
/// <param name="level">The notification window level.</param>
/// <returns>True if no error occurred, false otherwise.</returns>
- public bool SetNotificationLevel(NotificationLevel level) {
+ /// <since_tizen> 3 </since_tizen>
+ public bool SetNotificationLevel(NotificationLevel level)
+ {
bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// Gets a priority level for the specified notification window.
/// </summary>
/// <returns>The notification window level.</returns>
- public NotificationLevel GetNotificationLevel() {
+ /// <since_tizen> 3 </since_tizen>
+ public NotificationLevel GetNotificationLevel()
+ {
NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
- /// Sets a transparent window's visual state to opaque.
+ /// Sets a transparent window's visual state to opaque. <br />
+ /// If a visual state of a transparent window is opaque, <br />
+ /// then the window manager could handle it as an opaque window when calculating visibility.
/// </summary>
/// <param name="opaque">Whether the window's visual state is opaque.</param>
- public void SetOpaqueState(bool opaque) {
+ /// <remarks>This will have no effect on an opaque window. <br />
+ /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
+ /// </remarks>
+ /// <since_tizen> 3 </since_tizen>
+ public void SetOpaqueState(bool opaque)
+ {
NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// Returns whether a transparent window's visual state is opaque or not.
/// </summary>
/// <returns>True if the window's visual state is opaque, false otherwise.</returns>
- public bool IsOpaqueState() {
+ /// <remarks> The return value has no meaning on an opaque window. </remarks>
+ /// <since_tizen> 3 </since_tizen>
+ public bool IsOpaqueState()
+ {
bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
- /// Sets a window's screen mode.
+ /// Sets a window's screen off mode.
/// </summary>
- /// <param name="screenMode">The screen mode.</param>
+ /// <param name="screenOffMode">The screen mode.</param>
/// <returns>True if no error occurred, false otherwise.</returns>
- public bool SetScreenMode(ScreenMode screenMode) {
- bool ret = NDalicPINVOKE.SetScreenMode(swigCPtr, (int)screenMode);
+ /// <since_tizen> 4 </since_tizen>
+ public bool SetScreenOffMode(ScreenOffMode screenOffMode)
+ {
+ bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Gets the screen mode of the window.
/// </summary>
- /// <returns>The screen mode.</returns>
- public ScreenMode GetScreenMode() {
- ScreenMode ret = (ScreenMode)NDalicPINVOKE.GetScreenMode(swigCPtr);
+ /// <returns>The screen off mode.</returns>
+ /// <since_tizen> 4 </since_tizen>
+ public ScreenOffMode GetScreenOffMode()
+ {
+ ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// </summary>
/// <param name="brightness">The preferred brightness (0 to 100).</param>
/// <returns>True if no error occurred, false otherwise.</returns>
- public bool SetBrightness(int brightness) {
+ /// <since_tizen> 3 </since_tizen>
+ public bool SetBrightness(int brightness)
+ {
bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// Gets the preferred brightness of the window.
/// </summary>
/// <returns>The preferred brightness.</returns>
- public int GetBrightness() {
+ /// <since_tizen> 3 </since_tizen>
+ public int GetBrightness()
+ {
int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
+ /// <summary>
+ /// The focus changed event argument.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class FocusChangedEventArgs : EventArgs
{
+ /// <summary>
+ /// FocusGained flag.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool FocusGained
{
get;
private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler;
+ /// <summary>
+ /// FocusChanged event.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public event EventHandler<FocusChangedEventArgs> FocusChanged
{
add
/// <summary>
/// Gets/Sets a window title.
/// </summary>
+ /// <since_tizen> 4 </since_tizen>
public string Title
{
get
set
{
_windowTitle = value;
- SetClass( _windowTitle, "" );
+ SetClass(_windowTitle, "");
}
}
/// </summary>
/// <param name="name">The name of the window.</param>
/// <param name="klass">The class of the window.</param>
+ /// <since_tizen> 4 </since_tizen>
public void SetClass(string name, string klass)
{
NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
/// <summary>
/// Raises the window to the top of the window stack.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void Raise()
{
NDalicPINVOKE.Window_Raise(swigCPtr);
/// <summary>
/// Lowers the window to the bottom of the window stack.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void Lower()
{
NDalicPINVOKE.Window_Lower(swigCPtr);
/// <summary>
/// Activates the window to the top of the window stack even it is iconified.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void Activate()
{
NDalicPINVOKE.Window_Activate(swigCPtr);
/// Gets the default ( root ) layer.
/// </summary>
/// <returns>The root layer.</returns>
+ /// <since_tizen> 3 </since_tizen>
public Layer GetDefaultLayer()
{
return this.GetRootLayer();
{
NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ LayersChildren.Add(layer);
}
internal void Remove(Layer layer)
{
NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ LayersChildren.Remove(layer);
}
+ /// <summary>
+ /// Add a child view to window.
+ /// </summary>
+ /// <param name="view">the child should be added to the window.</param>
+ /// <since_tizen> 3 </since_tizen>
public void Add(View view)
{
- NDalicPINVOKE.Stage_Add(stageCPtr, View.getCPtr(view));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ GetRootLayer()?.Add(view);
}
+ /// <summary>
+ /// Remove a child view from window.
+ /// </summary>
+ /// <param name="view">the child to be removed.</param>
+ /// <since_tizen> 3 </since_tizen>
public void Remove(View view)
{
- NDalicPINVOKE.Stage_Remove(stageCPtr, View.getCPtr(view));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ GetRootLayer()?.Remove(view);
}
internal Vector2 GetSize()
/// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
internal uint GetLayerCount()
{
- uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ if (LayersChildren == null || LayersChildren.Count < 0)
+ return 0;
+
+ return (uint) LayersChildren.Count;
}
+ /// <summary>
+ /// Retrieves the layer at a specified depth.
+ /// </summary>
+ /// <param name="depth">The layer's depth index.</param>
+ /// <returns>The layer found at the given depth.</returns>
+ /// <since_tizen> 3 </since_tizen>
public Layer GetLayer(uint depth)
{
- IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
- Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
-
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ if (depth < LayersChildren.Count)
+ {
+ Layer ret = LayersChildren[Convert.ToInt32(depth)];
+ return ret;
+ }
+ else
+ {
+ return null;
+ }
}
internal Layer GetRootLayer()
{
- if (_rootLayer == null)
+ // Window.IsInstalled() is actually true only when called from event thread and
+ // Core has been initialized, not when Stage is ready.
+ if (_rootLayer == null && Window.IsInstalled())
+ {
_rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
-
-
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ LayersChildren.Add(_rootLayer);
+ }
return _rootLayer;
}
/// Keep rendering for at least the given amount of time.
/// </summary>
/// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
+ /// <since_tizen> 3 </since_tizen>
public void KeepRendering(float durationSeconds)
{
NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
private static readonly Window instance = Application.Instance.GetWindow();
/// <summary>
- /// The stage instance property (read-only).<br>
- /// Gets the current window.<br>
+ /// The stage instance property (read-only).<br />
+ /// Gets the current window.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public static Window Instance
{
get
}
/// <summary>
- /// Grabs the key specified by a key for a window only when a window is the topmost window.<br>
- /// This function can be used for following example scenarios: <br>
- /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br>
+ /// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
+ /// This function can be used for following example scenarios: <br />
+ /// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
/// </summary>
/// <param name="DaliKey">The key code to grab.</param>
/// <returns>True if the grab succeeds.</returns>
+ /// <since_tizen> 3 </since_tizen>
public bool GrabKeyTopmost(int DaliKey)
{
bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
}
/// <summary>
- /// Ungrabs the key specified by a key for the window.<br>
- /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.<br>
+ /// Ungrabs the key specified by a key for the window.<br />
+ /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.<br />
/// </summary>
/// <param name="DaliKey">The key code to ungrab.</param>
/// <returns>True if the ungrab succeeds.</returns>
+ /// <since_tizen> 3 </since_tizen>
public bool UngrabKeyTopmost(int DaliKey)
{
bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
}
/// <summary>
- /// Grabs the key specified by a key for a window in a GrabMode. <br>
- /// Details: This function can be used for following example scenarios: <br>
- /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br>
- /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br>
- /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br>
+ /// Grabs the key specified by a key for a window in a GrabMode. <br />
+ /// Details: This function can be used for following example scenarios: <br />
+ /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
+ /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
+ /// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
/// </summary>
/// <param name="DaliKey">The key code to grab.</param>
/// <param name="GrabMode">The grab mode for the key.</param>
/// <returns>True if the grab succeeds.</returns>
+ /// <since_tizen> 3 </since_tizen>
public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
{
bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
}
/// <summary>
- /// Ungrabs the key specified by a key for a window.<br>
- /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event. <br>
+ /// Ungrabs the key specified by a key for a window.<br />
+ /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event. <br />
/// </summary>
/// <param name="DaliKey">The key code to ungrab.</param>
/// <returns>True if the ungrab succeeds.</returns>
+ /// <since_tizen> 3 </since_tizen>
public bool UngrabKey(int DaliKey)
{
bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
/// <summary>
/// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public enum WindowOrientation
{
+ /// <summary>
+ /// Portrait orientation. The height of the display area is greater than the width.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
Portrait = 0,
+ /// <summary>
+ /// Landscape orientation. A wide view area is needed.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
Landscape = 90,
+ /// <summary>
+ /// Portrait inverse orientation.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
PortraitInverse = 180,
+ /// <summary>
+ /// Landscape inverse orientation.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
LandscapeInverse = 270
}
/// <summary>
/// Enumeration for the key grab mode for platform-level APIs.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public enum KeyGrabMode
{
/// <summary>
/// <summary>
/// The touch event argument.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class TouchEventArgs : EventArgs
{
private Touch _touch;
/// <summary>
/// Touch.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Touch Touch
{
get
private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
/// <summary>
- /// This event is emitted when the screen is touched and when the touch ends.<br>
+ /// This event is emitted when the screen is touched and when the touch ends.<br />
/// If there are multiple touch points, then this will be emitted when the first touch occurs and
- /// then when the last finger is lifted.<br>
- /// An interrupted event will also be emitted (if it occurs).<br>
+ /// then when the last finger is lifted.<br />
+ /// An interrupted event will also be emitted (if it occurs).<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public event EventHandler<TouchEventArgs> TouchEvent
{
add
/// <summary>
/// Wheel event arguments.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class WheelEventArgs : EventArgs
{
private Wheel _wheel;
/// <summary>
/// Wheel.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Wheel Wheel
{
get
/// <summary>
/// This event is emitted when the wheel event is received.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public event EventHandler<WheelEventArgs> WheelEvent
{
add
/// <summary>
/// Key event arguments.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class KeyEventArgs : EventArgs
{
private Key _key;
/// <summary>
/// Key.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Key Key
{
get
/// <summary>
/// This event is emitted when the key event is received.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public event EventHandler<KeyEventArgs> KeyEvent
{
add
}
}
+ /// <summary>
+ /// This resized event arguments.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class ResizedEventArgs : EventArgs
{
Size2D _windowSize;
+ /// <summary>
+ /// This window size.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
public Size2D WindowSize
{
get
private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
+ /// <summary>
+ /// This event is emitted when the window resized.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public event EventHandler<ResizedEventArgs> Resized
{
add
internal void SetPosition(Position2D position)
{
- var val = new Uint16Pair( (uint)position.X, (uint)position.Y );
+ var val = new Uint16Pair((uint)position.X, (uint)position.Y);
NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
+ /// Sets whether the window is transparent or not.
+ /// </summary>
+ /// <param name="transparent">Whether the window is transparent.</param>
+ /// <since_tizen> 5 </since_tizen>
+ /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetTransparency(bool transparent)
+ {
+ NDalicManualPINVOKE.SetTransparency(swigCPtr, transparent);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
/// The window size property (read-only).
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Size2D Size
{
get
/// <summary>
/// The background color property.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Color BackgroundColor
{
set
}
/// <summary>
- /// The DPI property (read-only).<br>
- /// Retrieves the DPI of the display device to which the Window is connected.<br>
+ /// The DPI property (read-only).<br />
+ /// Retrieves the DPI of the display device to which the Window is connected.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector2 Dpi
{
get
}
/// <summary>
- /// The layer count property (read-only).<br>
- /// Queries the number of on-Window layers.<br>
+ /// The layer count property (read-only).<br />
+ /// Queries the number of on-Window layers.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public uint LayerCount
{
get
/// Adds a layer to the stage.
/// </summary>
/// <param name="layer">Layer to add.</param>
+ /// <since_tizen> 3 </since_tizen>
public void AddLayer(Layer layer)
{
NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ LayersChildren.Add(layer);
}
/// <summary>
/// Removes a layer from the stage.
/// </summary>
/// <param name="layer">Layer to remove.</param>
+ /// <since_tizen> 3 </since_tizen>
public void RemoveLayer(Layer layer)
{
NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ LayersChildren.Remove(layer);
}
- [Obsolete("Please do not use! this will be deprecated")]
+ /// <summary>
+ /// Please do not use! this will be deprecated
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ [Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " +
+ "Like: " +
+ "Window.Instance.FocusChanged = OnFocusChanged; " +
+ "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public class WindowFocusChangedEventArgs : EventArgs
{
+ /// <summary>
+ /// Please do not use! this will be deprecated
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool FocusGained
{
get;
private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler2;
- [Obsolete("Please do not use! this will be deprecated. Please use 'FocusChanged' event instead")]
+ /// <summary>
+ /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ /// Please do not use! this will be deprecated!
+ /// Instead please use FocusChanged.
+ [Obsolete("Please do not use! This will be deprecated! Please use FocusChanged instead! " +
+ "Like: " +
+ "Window.Instance.FocusChanged = OnFocusChanged; " +
+ "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
{
add
/// <summary>
/// Gets or sets a size of the window.
/// </summary>
+ /// <since_tizen> 4 </since_tizen>
public Size2D WindowSize
{
get
/// <summary>
/// Gets or sets a position of the window.
/// </summary>
+ /// <since_tizen> 4 </since_tizen>
public Position2D WindowPosition
{
get
/// <summary>
/// Feed a key-event into the window.
/// </summary>
+ /// <param name="keyEvent">The key event to feed.</param>
+ /// <since_tizen> 5 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void FeedKey(Key keyEvent)
+ {
+ NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Feed a key-event into the window.
+ /// </summary>
+ /// <param name="keyEvent">The key event to feed.</param>
+ /// <since_tizen> 4 </since_tizen>
+ [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
public static void FeedKeyEvent(Key keyEvent)
{
NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
/// Allows at least one more render, even when paused.
/// The window should be shown, not minimised.
/// </summary>
+ /// <since_tizen> 4 </since_tizen>
public void RenderOnce()
{
NDalicManualPINVOKE.Window_RenderOnce(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// <summary>
+ /// Contains and encapsulates Native Window handle.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public class SafeNativeWindowHandle : SafeHandle
+ {
+ /// <summary>
+ /// Contructor, Native window handle is set to handle.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public SafeNativeWindowHandle() : base(IntPtr.Zero, false)
+ {
+ SetHandle(Tizen.NUI.Window.Instance.GetNativeWindowHandler());
+ }
+ /// <summary>
+ /// Null check if the handle is valid or not.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public override bool IsInvalid
+ {
+ get
+ {
+ return this.handle == IntPtr.Zero;
+ }
+ }
+ /// <summary>
+ /// Release handle itself.
+ /// </summary>
+ /// <returns>true when released successfully.</returns>
+ /// <since_tizen> 4 </since_tizen>
+ protected override bool ReleaseHandle()
+ {
+ return true;
+ }
+ }
+
}
}