Class Window

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll
API Level:
3

The window class is used internally for drawing.
The window has an orientation and indicator properties.

C#
Copy
public class Window : BaseHandle, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable
Inheritance
System.Object
Tizen.NUI.Binding.Element
Window
Implements
System.ComponentModel.INotifyPropertyChanged
System.IDisposable

Constructors

View Source

Window(String, Rectangle, Boolean)

Creates a new Window with a specific name.
This creates an extra window in addition to the default main window

Declaration
C#
Copy
public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false)
Parameters
Type Name Description
System.String name

The name for extra window.

Rectangle windowPosition

The position and size of the Window.

Boolean isTranslucent

Whether Window is translucent.

Exceptions
Type Condition
System.NotSupportedException

The required feature is not supported.

API Level: 6
Feature: http://tizen.org/feature/opengles.surfaceless_context
View Source

Window(Rectangle, Boolean)

Creates a new Window.
This creates an extra window in addition to the default main window

Declaration
C#
Copy
public Window(Rectangle windowPosition = null, bool isTranslucent = false)
Parameters
Type Name Description
Rectangle windowPosition

The position and size of the Window.

Boolean isTranslucent

Whether Window is translucent.

Exceptions
Type Condition
System.NotSupportedException

The required feature is not supported.

API Level: 6
Feature: http://tizen.org/feature/opengles.surfaceless_context

Properties

View Source

BackgroundColor

The background color property.

Declaration
C#
Copy
public Color BackgroundColor { get; set; }
Property Value
Type Description
Color
API Level: 3
View Source

Dpi

The DPI property (read-only).
Retrieves the DPI of the display device to which the Window is connected.

Declaration
C#
Copy
public Vector2 Dpi { get; }
Property Value
Type Description
Vector2
API Level: 3
View Source

Instance

The stage instance property (read-only).
Gets the current window.

Declaration
C#
Copy
public static Window Instance { get; }
Property Value
Type Description
Window
API Level: 3
View Source

LayerCount

The layer count property (read-only).
Queries the number of on-Window layers.

Declaration
C#
Copy
public uint LayerCount { get; }
Property Value
Type Description
System.UInt32
API Level: 3
View Source

NativeHandle

Get Native Window handle. How to get Native Window handle

Copy
Window window = NUIApplication.GetDefaultWindow(); var handle = window.NativeHandle; if(handle.IsInvalid == false) { IntPtr nativeHandle = handle.DangerousGetHandle(); // do something with nativeHandle }

Declaration
C#
Copy
public SafeHandle NativeHandle { get; }
Property Value
Type Description
System.Runtime.InteropServices.SafeHandle
API Level: 9
View Source

RenderingBehavior

The rendering behavior of a Window.

Declaration
C#
Copy
public RenderingBehaviorType RenderingBehavior { get; set; }
Property Value
Type Description
RenderingBehaviorType
API Level: 5
View Source

Size

The window size property (read-only).

Declaration
C#
Copy
public Size2D Size { get; }
Property Value
Type Description
Size2D
API Level: 3
View Source

Title

Gets/Sets a window title.

Declaration
C#
Copy
public string Title { get; set; }
Property Value
Type Description
System.String
API Level: 4
View Source

Type

Gets or sets a window type. Most of window type can be set to use WindowType, except for IME type. IME type can be set to use one of NUIApplication's constrcutors.

Declaration
C#
Copy
public WindowType Type { get; set; }
Property Value
Type Description
WindowType
API Level: 3
View Source

WindowPosition

Gets or sets a position of the window.

Declaration
C#
Copy
public Position2D WindowPosition { get; set; }
Property Value
Type Description
Position2D
Exceptions
Type Condition
System.ArgumentNullException

Thrown when value is null.

API Level: 4
View Source

WindowSize

Gets or sets a size of the window.

Declaration
C#
Copy
public Size2D WindowSize { get; set; }
Property Value
Type Description
Size2D
Exceptions
Type Condition
System.ArgumentNullException

Thrown when value is null.

API Level: 4

Methods

View Source

Activate()

Activates the window to the top of the window stack even it is iconified.

Declaration
C#
Copy
public void Activate()
API Level: 3
View Source

Add(View)

Add a child view to window.

Declaration
C#
Copy
public void Add(View view)
Parameters
Type Name Description
View view

the child should be added to the window.

API Level: 3
View Source

AddAuxiliaryHint(String, String)

Creates an auxiliary hint of the window.

Declaration
C#
Copy
public uint AddAuxiliaryHint(string hint, string value)
Parameters
Type Name Description
System.String hint

The auxiliary hint string.

System.String value

The value string.

Returns
Type Description
System.UInt32

The ID of created auxiliary hint, or 0 on failure.

API Level: 3
View Source

AddAvailableOrientation(Window.WindowOrientation)

Adds an orientation to the list of available orientations.

Declaration
C#
Copy
public void AddAvailableOrientation(Window.WindowOrientation orientation)
Parameters
Type Name Description
Window.WindowOrientation orientation

The available orientation to add

API Level: 6
View Source

AddLayer(Layer)

Adds a layer to the stage.

Declaration
C#
Copy
public void AddLayer(Layer layer)
Parameters
Type Name Description
Layer layer

Layer to add.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when layer is null.

API Level: 3
View Source

FeedKey(Key)

Feeds a key event into the window.

Declaration
C#
Copy
public void FeedKey(Key keyEvent)
Parameters
Type Name Description
Key keyEvent

The key event to feed.

API Level: 5
View Source

FeedKeyEvent(Key)

Feed a key-event into the window.

Declaration
C#
Copy
[Obsolete("Do not use this, that will be deprecated. Use FeedKey(Key keyEvent) instead.")] public static void FeedKeyEvent(Key keyEvent)
Parameters
Type Name Description
Key keyEvent

The key event to feed.

API Level: 4
View Source

GetAuxiliaryHintId(String)

Gets an ID of the auxiliary hint string.

Declaration
C#
Copy
public uint GetAuxiliaryHintId(string hint)
Parameters
Type Name Description
System.String hint

The auxiliary hint string.

Returns
Type Description
System.UInt32

The ID of auxiliary hint string, or 0 on failure.

API Level: 3
View Source

GetAuxiliaryHintValue(UInt32)

Gets a value of the auxiliary hint.

Declaration
C#
Copy
public string GetAuxiliaryHintValue(uint id)
Parameters
Type Name Description
System.UInt32 id

The auxiliary hint ID.

Returns
Type Description
System.String

The string value of the auxiliary hint ID, or an empty string if none exists.

API Level: 3
View Source

GetBrightness()

Gets the preferred brightness of the window.

Declaration
C#
Copy
public int GetBrightness()
Returns
Type Description
Int32

The preferred brightness.

API Level: 3
View Source

GetDefaultLayer()

Gets the default ( root ) layer.

Declaration
C#
Copy
public Layer GetDefaultLayer()
Returns
Type Description
Layer

The root layer.

API Level: 3
View Source

GetKeyboardRepeatInfo(out Single, out Single)

Gets the keyboard repeat information.

Declaration
C#
Copy
public bool GetKeyboardRepeatInfo(out float rate, out float delay)
Parameters
Type Name Description
System.Single rate

The key repeat rate value in seconds.

System.Single delay

The key repeat delay value in seconds.

Returns
Type Description
Boolean

True if setting the keyboard repeat succeeds.

API Level: 5
View Source

GetLayer(UInt32)

Retrieves the layer at a specified depth.

Declaration
C#
Copy
public Layer GetLayer(uint depth)
Parameters
Type Name Description
System.UInt32 depth

The layer's depth index.

Returns
Type Description
Layer

The layer found at the given depth.

API Level: 3
View Source

GetNotificationLevel()

Gets a priority level for the specified notification window.

Declaration
C#
Copy
public NotificationLevel GetNotificationLevel()
Returns
Type Description
NotificationLevel

The notification window level.

API Level: 3
View Source

GetParent()

Gets parent window of the window.

Declaration
C#
Copy
public Window GetParent()
Returns
Type Description
Window

The parent window of the window.

Exceptions
Type Condition
System.NotSupportedException

The required feature is not supported.

API Level: 6
Feature: http://tizen.org/feature/opengles.surfaceless_context
View Source

GetPreferredOrientation()

Gets the preferred orientation.

Declaration
C#
Copy
public Window.WindowOrientation GetPreferredOrientation()
Returns
Type Description
Window.WindowOrientation

The preferred orientation if previously set, or none.

API Level: 6
View Source

GetScreenOffMode()

Gets the screen mode of the window.

Declaration
C#
Copy
public ScreenOffMode GetScreenOffMode()
Returns
Type Description
ScreenOffMode

The screen off mode.

API Level: 4
View Source

GetSupportedAuxiliaryHint(UInt32)

Gets the supported auxiliary hint string of the window.

Declaration
C#
Copy
public string GetSupportedAuxiliaryHint(uint index)
Parameters
Type Name Description
System.UInt32 index

The index of the supported auxiliary hint lists.

Returns
Type Description
System.String

The auxiliary hint string of the index.

API Level: 3
View Source

GetSupportedAuxiliaryHintCount()

Gets the count of supported auxiliary hints of the window.

Declaration
C#
Copy
public uint GetSupportedAuxiliaryHintCount()
Returns
Type Description
System.UInt32

The number of supported auxiliary hints.

API Level: 3
View Source

GrabKey(Int32, Window.KeyGrabMode)

Grabs the key specified by a key for a window in a GrabMode.
Details: This function can be used for following example scenarios:

  • TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app.
  • Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app.
  • Mobile - Using the volume up or down as zoom up or down in camera apps.
Declaration
C#
Copy
public bool GrabKey(int DaliKey, Window.KeyGrabMode GrabMode)
Parameters
Type Name Description
Int32 DaliKey

The key code to grab.

Window.KeyGrabMode GrabMode

The grab mode for the key.

Returns
Type Description
Boolean

True if the grab succeeds.

API Level: 3
View Source

GrabKeyTopmost(Int32)

Grabs the key specified by a key for a window only when a window is the topmost window.
This function can be used for following example scenarios:

  • Mobile - Using volume up or down as zoom up or down in camera apps.
Declaration
C#
Copy
public bool GrabKeyTopmost(int DaliKey)
Parameters
Type Name Description
Int32 DaliKey

The key code to grab.

Returns
Type Description
Boolean

True if the grab succeeds.

API Level: 3
View Source

Hide()

Hides the window if it is showing.

Declaration
C#
Copy
public void Hide()
API Level: 3
View Source

IsFocusAcceptable()

Returns whether the window accepts a focus or not.

Declaration
C#
Copy
public bool IsFocusAcceptable()
Returns
Type Description
Boolean

True if the window accepts a focus, false otherwise.

API Level: 3
View Source

IsOpaqueState()

Returns whether a transparent window's visual state is opaque or not.

Declaration
C#
Copy
public bool IsOpaqueState()
Returns
Type Description
Boolean

True if the window's visual state is opaque, false otherwise.

Remarks

The return value has no meaning on an opaque window.

API Level: 3
View Source

IsVisible()

Retrieves whether the window is visible or not.

Declaration
C#
Copy
public bool IsVisible()
Returns
Type Description
Boolean

True if the window is visible.

API Level: 3
View Source

KeepRendering(Single)

Keep rendering for at least the given amount of time.

Declaration
C#
Copy
public void KeepRendering(float durationSeconds)
Parameters
Type Name Description
System.Single durationSeconds

Time to keep rendering, 0 means render at least one more frame.

API Level: 3
View Source

Lower()

Lowers the window to the bottom of the window stack.

Declaration
C#
Copy
public void Lower()
API Level: 3
View Source

Raise()

Raises the window to the top of the window stack.

Declaration
C#
Copy
public void Raise()
API Level: 3
View Source

Remove(View)

Remove a child view from window.

Declaration
C#
Copy
public void Remove(View view)
Parameters
Type Name Description
View view

the child to be removed.

API Level: 3
View Source

RemoveAuxiliaryHint(UInt32)

Removes an auxiliary hint of the window.

Declaration
C#
Copy
public bool RemoveAuxiliaryHint(uint id)
Parameters
Type Name Description
System.UInt32 id

The ID of the auxiliary hint.

Returns
Type Description
Boolean

True if no error occurred, false otherwise.

API Level: 3
View Source

RemoveAvailableOrientation(Window.WindowOrientation)

Removes an orientation from the list of available orientations.

Declaration
C#
Copy
public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
Parameters
Type Name Description
Window.WindowOrientation orientation

The available orientation to remove.

API Level: 6
View Source

RemoveLayer(Layer)

Removes a layer from the stage.

Declaration
C#
Copy
public void RemoveLayer(Layer layer)
Parameters
Type Name Description
Layer layer

Layer to remove.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when layer is null.

API Level: 3
View Source

RenderOnce()

Allows at least one more render, even when paused. The window should be shown, not minimised.

Declaration
C#
Copy
public void RenderOnce()
API Level: 4
View Source

SetAcceptFocus(Boolean)

Sets whether the window accepts a focus or not.

Declaration
C#
Copy
public void SetAcceptFocus(bool accept)
Parameters
Type Name Description
Boolean accept

If a focus is accepted or not. The default is true.

API Level: 3
View Source

SetAuxiliaryHintValue(UInt32, String)

Changes a value of the auxiliary hint.

Declaration
C#
Copy
public bool SetAuxiliaryHintValue(uint id, string value)
Parameters
Type Name Description
System.UInt32 id

The auxiliary hint ID.

System.String value

The value string to be set.

Returns
Type Description
Boolean

True if no error occurred, false otherwise.

API Level: 3
View Source

SetBrightness(Int32)

Sets preferred brightness of the window.

Declaration
C#
Copy
public bool SetBrightness(int brightness)
Parameters
Type Name Description
Int32 brightness

The preferred brightness (0 to 100).

Returns
Type Description
Boolean

True if no error occurred, false otherwise.

API Level: 3
View Source

SetClass(String, String)

Sets the window name and the class string.

Declaration
C#
Copy
public void SetClass(string name, string klass)
Parameters
Type Name Description
System.String name

The name of the window.

System.String klass

The class of the window.

API Level: 4
View Source

SetInputRegion(Rectangle)

Sets a region to accept input events.

Declaration
C#
Copy
public void SetInputRegion(Rectangle inputRegion)
Parameters
Type Name Description
Rectangle inputRegion

The region to accept input events.

API Level: 3
View Source

SetKeyboardRepeatInfo(Single, Single)

Sets the keyboard repeat information.

Declaration
C#
Copy
public bool SetKeyboardRepeatInfo(float rate, float delay)
Parameters
Type Name Description
System.Single rate

The key repeat rate value in seconds.

System.Single delay

The key repeat delay value in seconds.

Returns
Type Description
Boolean

True if setting the keyboard repeat succeeds.

API Level: 5
View Source

SetNotificationLevel(NotificationLevel)

Sets a priority level for the specified notification window.

Declaration
C#
Copy
public bool SetNotificationLevel(NotificationLevel level)
Parameters
Type Name Description
NotificationLevel level

The notification window level.

Returns
Type Description
Boolean

True if no error occurred, false otherwise.

API Level: 3
View Source

SetOpaqueState(Boolean)

Sets a transparent window's visual state to opaque.
If a visual state of a transparent window is opaque,
then the window manager could handle it as an opaque window when calculating visibility.

Declaration
C#
Copy
public void SetOpaqueState(bool opaque)
Parameters
Type Name Description
Boolean opaque

Whether the window's visual state is opaque.

Remarks

This will have no effect on an opaque window.
It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.

API Level: 3
View Source

SetParent(Window)

Sets parent window of the window. After setting that, these windows do together when raise-up, lower and iconified/deiconified. Initially, the window is located on top of the parent. The window can go below parent by calling Lower(). If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.

Declaration
C#
Copy
public void SetParent(Window parent)
Parameters
Type Name Description
Window parent

The parent window.

Exceptions
Type Condition
System.NotSupportedException

The required feature is not supported.

API Level: 6
Feature: http://tizen.org/feature/opengles.surfaceless_context
View Source

SetPreferredOrientation(Window.WindowOrientation)

Sets a preferred orientation.

Declaration
C#
Copy
public void SetPreferredOrientation(Window.WindowOrientation orientation)
Parameters
Type Name Description
Window.WindowOrientation orientation

The preferred orientation.

API Level: 6
View Source

SetScreenOffMode(ScreenOffMode)

Sets a window's screen off mode.

Declaration
C#
Copy
public bool SetScreenOffMode(ScreenOffMode screenOffMode)
Parameters
Type Name Description
ScreenOffMode screenOffMode

The screen mode.

Returns
Type Description
Boolean

True if no error occurred, false otherwise.

API Level: 4
View Source

SetTransparency(Boolean)

Sets whether the window is transparent or not.

Declaration
C#
Copy
public void SetTransparency(bool transparent)
Parameters
Type Name Description
Boolean transparent

Whether the window is transparent or not.

API Level: 5
View Source

Show()

Shows the window if it is hidden.

Declaration
C#
Copy
public void Show()
API Level: 3
View Source

UngrabKey(Int32)

Ungrabs the key specified by a key for a window.
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.

Declaration
C#
Copy
public bool UngrabKey(int DaliKey)
Parameters
Type Name Description
Int32 DaliKey

The key code to ungrab.

Returns
Type Description
Boolean

True if the ungrab succeeds.

API Level: 3
View Source

UngrabKeyTopmost(Int32)

Ungrabs the key specified by a key for the window.
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.

Declaration
C#
Copy
public bool UngrabKeyTopmost(int DaliKey)
Parameters
Type Name Description
Int32 DaliKey

The key code to ungrab.

Returns
Type Description
Boolean

True if the ungrab succeeds.

API Level: 3
View Source

Unparent()

Unsets parent window of the window. After unsetting, the window is disconnected his parent window.

Declaration
C#
Copy
public void Unparent()
Exceptions
Type Condition
System.NotSupportedException

The required feature is not supported.

API Level: 6
Feature: http://tizen.org/feature/opengles.surfaceless_context

Events

View Source

FocusChanged

FocusChanged event.

Declaration
C#
Copy
public event EventHandler<Window.FocusChangedEventArgs> FocusChanged
Event Type
Type Description
System.EventHandler<Window.FocusChangedEventArgs>
API Level: 3
View Source

KeyEvent

Emits the event when the key event is received.

Declaration
C#
Copy
public event EventHandler<Window.KeyEventArgs> KeyEvent
Event Type
Type Description
System.EventHandler<Window.KeyEventArgs>
API Level: 3
View Source

Resized

Emits the event when the window resized.

Declaration
C#
Copy
public event EventHandler<Window.ResizedEventArgs> Resized
Event Type
Type Description
System.EventHandler<Window.ResizedEventArgs>
API Level: 3
View Source

TouchEvent

Emits the event when the screen is touched and when the touch ends.
If there are multiple touch points then it is emitted when the first touch occurs and when the last finger is lifted too.
Even though incoming events are interrupted, the event occurs.

Declaration
C#
Copy
public event EventHandler<Window.TouchEventArgs> TouchEvent
Event Type
Type Description
System.EventHandler<Window.TouchEventArgs>
API Level: 3
View Source

WheelEvent

Emits the event when the wheel event is received.

Declaration
C#
Copy
public event EventHandler<Window.WheelEventArgs> WheelEvent
Event Type
Type Description
System.EventHandler<Window.WheelEventArgs>
API Level: 3

Implements

System.ComponentModel.INotifyPropertyChanged
System.IDisposable