Tizen Native API  5.5
Dali::Window Class Reference

The window class is used internally for drawing. More...

Inheritance diagram for Dali::Window:
Dali::BaseHandle

Classes

struct  NotificationLevel
 An enum of screen mode. More...
struct  ScreenOffMode
 An enum of screen mode. More...

Public Types

enum  WindowOrientation
 Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing. More...
enum  IndicatorBgOpacity
 Enumeration for opacity of the indicator. More...
enum  IndicatorVisibleMode
 Enumeration for visible mode of the indicator. More...
enum  Type
 An enum of Window types. More...
typedef Uint16Pair WindowSize
 Window size type.
typedef Uint16Pair WindowPosition
 Window position type.
typedef Signal< void(bool) > IndicatorSignalType
 Indicator state signal type.
typedef Signal< void(bool) > FocusSignalType
 Window focus signal type.
typedef Signal< void(WindowSize) > ResizedSignalType
 Window resized signal type.
typedef Signal< void(Window,
bool) > 
FocusChangeSignalType
 Window focus signal type.
typedef Signal< void(Window,
WindowSize) > 
ResizeSignalType
 Window resized signal type.

Public Member Functions

 Window ()
 Creates an uninitialized handle.
 ~Window ()
 Destructor.
 Window (const Window &handle)
 This copy constructor is required for (smart) pointer semantics.
Windowoperator= (const Window &rhs)
 This assignment operator is required for (smart) pointer semantics.
void Add (Actor actor)
 Adds a child Actor to the Window.
void Remove (Actor actor)
 Removes a child Actor from the Window.
void SetBackgroundColor (const Vector4 &color)
 Sets the background color of the Window.
Vector4 GetBackgroundColor () const
 Gets the background color of the Window.
Layer GetRootLayer () const
 Returns the root Layer of the Window.
uint32_t GetLayerCount () const
 Queries the number of on-scene layers in the Window.
Layer GetLayer (uint32_t depth) const
 Retrieves the layer at a specified depth in the Window.
void ShowIndicator (IndicatorVisibleMode visibleMode) DALI_DEPRECATED_API
 This sets whether the indicator bar should be shown or not.
void SetIndicatorBgOpacity (IndicatorBgOpacity opacity) DALI_DEPRECATED_API
 This sets the opacity mode of indicator bar.
void RotateIndicator (WindowOrientation orientation) DALI_DEPRECATED_API
 This sets the orientation of indicator bar.
void SetClass (std::string name, std::string klass)
 Sets the window name and class string.
void Raise ()
 Raises window to the top of Window stack.
void Lower ()
 Lowers window to the bottom of Window stack.
void Activate ()
 Activates window to the top of Window stack even it is iconified.
void AddAvailableOrientation (WindowOrientation orientation)
 Adds an orientation to the list of available orientations.
void RemoveAvailableOrientation (WindowOrientation orientation)
 Removes an orientation from the list of available orientations.
void SetPreferredOrientation (WindowOrientation orientation)
 Sets a preferred orientation.
WindowOrientation GetPreferredOrientation ()
 Gets the preferred orientation.
DragAndDropDetector GetDragAndDropDetector () const DALI_DEPRECATED_API
 Returns an empty handle.
Any GetNativeHandle () const
 Gets the native handle of the window.
void SetAcceptFocus (bool accept)
 Sets whether window accepts focus or not.
bool IsFocusAcceptable () const
 Returns whether window accepts focus or not.
void Show ()
 Shows the window if it is hidden.
void Hide ()
 Hides the window if it is showing.
bool IsVisible () const
 Returns whether the window is visible or not.
unsigned int GetSupportedAuxiliaryHintCount () const
 Gets the count of supported auxiliary hints of the window.
std::string GetSupportedAuxiliaryHint (unsigned int index) const
 Gets the supported auxiliary hint string of the window.
unsigned int AddAuxiliaryHint (const std::string &hint, const std::string &value)
 Creates an auxiliary hint of the window.
bool RemoveAuxiliaryHint (unsigned int id)
 Removes an auxiliary hint of the window.
bool SetAuxiliaryHintValue (unsigned int id, const std::string &value)
 Changes a value of the auxiliary hint.
std::string GetAuxiliaryHintValue (unsigned int id) const
 Gets a value of the auxiliary hint.
unsigned int GetAuxiliaryHintId (const std::string &hint) const
 Gets a ID of the auxiliary hint string.
void SetInputRegion (const Rect< int > &inputRegion)
 Sets a region to accept input events.
void SetType (Type type)
 Sets a window type.
Type GetType () const
 Gets a window type.
bool SetNotificationLevel (NotificationLevel::Type level)
 Sets a priority level for the specified notification window.
NotificationLevel::Type GetNotificationLevel () const
 Gets a priority level for the specified notification window.
void SetOpaqueState (bool opaque)
 Sets a transparent window's visual state to opaque.
bool IsOpaqueState () const
 Returns whether a transparent window's visual state is opaque or not.
bool SetScreenOffMode (ScreenOffMode::Type screenOffMode)
 Sets a window's screen off mode.
ScreenOffMode::Type GetScreenOffMode () const
 Gets a screen off mode of the window.
bool SetBrightness (int brightness)
 Sets preferred brightness of the window.
int GetBrightness () const
 Gets preferred brightness of the window.
void SetSize (WindowSize size)
 Sets a size of the window.
WindowSize GetSize () const
 Gets a size of the window.
void SetPosition (WindowPosition position)
 Sets a position of the window.
WindowPosition GetPosition () const
 Gets a position of the window.
void SetTransparency (bool transparent)
 Sets whether the window is transparent or not.
IndicatorSignalTypeIndicatorVisibilityChangedSignal () DALI_DEPRECATED_API
 The user should connect to this signal to get a timing when indicator was shown / hidden.
FocusSignalTypeFocusChangedSignal () DALI_DEPRECATED_API
 The user should connect to this signal to get a timing when window gains focus or loses focus.
ResizedSignalTypeResizedSignal () DALI_DEPRECATED_API
 This signal is emitted when the window is resized.
FocusChangeSignalTypeFocusChangeSignal ()
 The user should connect to this signal to get a timing when window gains focus or loses focus.
ResizeSignalTypeResizeSignal ()
 This signal is emitted when the window is resized.

Static Public Member Functions

static Window New (PositionSize windowPosition, const std::string &name, bool isTransparent=false)
 Creates an initialized handle to a new Window.
static Window New (PositionSize windowPosition, const std::string &name, const std::string &className, bool isTransparent=false)
 Creates an initialized handle to a new Window.

Detailed Description

The window class is used internally for drawing.

A Window has an orientation and indicator properties. You can get a valid Window handle by calling Dali::Application::GetWindow().

Since:
2.4, DALi version 1.0.0

Member Typedef Documentation

Window focus signal type.

Since:
5.5, DALi version 1.4.35
typedef Signal< void (bool) > Dali::Window::FocusSignalType

Window focus signal type.

Deprecated:
Deprecated since 5.5, DALi version 1.4.35
Since:
4.0, DALi version 1.2.60
typedef Signal< void (bool) > Dali::Window::IndicatorSignalType

Indicator state signal type.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0

Window resized signal type.

Deprecated:
Deprecated since 5.5, DALi version 1.4.35
Since:
4.0, DALi version 1.2.60

Window resized signal type.

Since:
5.5, DALi version 1.4.35

Window position type.

Since:
4.0, DALi version 1.2.60

Window size type.

Since:
4.0, DALi version 1.2.60

Member Enumeration Documentation

Enumeration for opacity of the indicator.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0
Enumerator:
OPAQUE 

Fully opaque indicator Bg.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0
TRANSLUCENT 

Semi translucent indicator Bg.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0
TRANSPARENT 

Fully transparent indicator Bg.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0

Enumeration for visible mode of the indicator.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0
Enumerator:
INVISIBLE 

Hide indicator.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0
VISIBLE 

Show indicator.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0
AUTO 

Hide in default, will show when necessary.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0

An enum of Window types.

Since:
4.0, DALi version 1.2.60
Enumerator:
NORMAL 

A default window type. Indicates a normal, top-level window. Almost every window will be created with this type.

Since:
4.0, DALi version 1.2.60
NOTIFICATION 

A notification window, like a warning about battery life or a new E-Mail received.

Since:
4.0, DALi version 1.2.60
UTILITY 

A persistent utility window, like a toolbox or palette.

Since:
4.0, DALi version 1.2.60
DIALOG 

Used for simple dialog windows.

Since:
4.0, DALi version 1.2.60

Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.

This Enumeration is used the available orientation APIs and the preferred orientation.

Since:
2.4, DALi version 1.0.0
Enumerator:
PORTRAIT 

Portrait orientation. The height of the display area is greater than the width.

Since:
2.4, DALi version 1.0.0
LANDSCAPE 

Landscape orientation. A wide view area is needed.

Since:
2.4, DALi version 1.0.0
PORTRAIT_INVERSE 

Portrait inverse orientation.

Since:
2.4, DALi version 1.0.0
LANDSCAPE_INVERSE 

Landscape inverse orientation.

Since:
2.4, DALi version 1.0.0
NO_ORIENTATION_PREFERENCE 

No orientation. It is used to initialize or unset the preferred orientation.

Since:
5.5, DALi version 1.4.51

Constructor & Destructor Documentation

Creates an uninitialized handle.

This can be initialized using Dali::Application::GetWindow() or Dali::Window::New().

Since:
2.4, DALi version 1.0.0

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since:
2.4, DALi version 1.0.0
Dali::Window::Window ( const Window handle)

This copy constructor is required for (smart) pointer semantics.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]handleA reference to the copied handle

Member Function Documentation

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

Since:
2.4, DALi version 1.0.0
void Dali::Window::Add ( Actor  actor)

Adds a child Actor to the Window.

The child will be referenced.

Since:
5.5, DALi version 1.4.19
Parameters:
[in]actorThe child
Precondition:
The actor has been initialized.
The actor does not have a parent.
unsigned int Dali::Window::AddAuxiliaryHint ( const std::string &  hint,
const std::string &  value 
)

Creates an auxiliary hint of the window.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]hintThe auxiliary hint string.
[in]valueThe value string.
Returns:
The ID of created auxiliary hint, or 0 on failure.

Adds an orientation to the list of available orientations.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]orientationThe available orientation to add

The user should connect to this signal to get a timing when window gains focus or loses focus.

Deprecated:
Deprecated since 5.5, DALi version 1.4.35

A callback of the following type may be connected:

   void YourCallbackName( bool focusIn );

The parameter is true if window gains focus, otherwise false.

Since:
4.0, DALi version 1.2.60
Returns:
The signal to connect to

The user should connect to this signal to get a timing when window gains focus or loses focus.

A callback of the following type may be connected:

   void YourCallbackName( Window window, bool focusIn );

The parameter is true if window gains focus, otherwise false. and window means this signal was called from what window

Since:
5.5, DALi version 1.4.35
Returns:
The signal to connect to
unsigned int Dali::Window::GetAuxiliaryHintId ( const std::string &  hint) const

Gets a ID of the auxiliary hint string.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]hintThe auxiliary hint string.
Returns:
The ID of the auxiliary hint string, or 0 if none exists.
std::string Dali::Window::GetAuxiliaryHintValue ( unsigned int  id) const

Gets a value of the auxiliary hint.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]idThe auxiliary hint ID.
Returns:
The string value of the auxiliary hint ID, or an empty string if none exists.

Gets the background color of the Window.

Since:
5.5, DALi version 1.4.19
Returns:
The background color

Gets preferred brightness of the window.

Since:
4.0, DALi version 1.2.60
Returns:
The preferred brightness.
DragAndDropDetector Dali::Window::GetDragAndDropDetector ( ) const

Returns an empty handle.

Deprecated:
Deprecated since 5.5, DALi version 1.4.19 Was not intended for Application developers
Note:
Not intended for application developers.
Since:
2.4, DALi version 1.0.0
Returns:
An empty handle
Layer Dali::Window::GetLayer ( uint32_t  depth) const

Retrieves the layer at a specified depth in the Window.

Since:
5.5, DALi version 1.4.19
Parameters:
[in]depthThe depth
Returns:
The layer found at the given depth
Precondition:
Depth is less than layer count; see GetLayerCount().
uint32_t Dali::Window::GetLayerCount ( ) const

Queries the number of on-scene layers in the Window.

Note that a default layer is always provided (count >= 1).

Since:
5.5, DALi version 1.4.19
Returns:
The number of layers

Gets the native handle of the window.

When users call this function, it wraps the actual type used by the underlying window system.

Since:
2.4, DALi version 1.0.0
Returns:
The native handle of the Window or an empty handle

Gets a priority level for the specified notification window.

Since:
4.0, DALi version 1.2.60
Returns:
The notification window level.
Remarks:
This can be used for a notification type window only.

Gets a position of the window.

Since:
4.0, DALi version 1.2.60
Returns:
The position of the window

Gets the preferred orientation.

Since:
2.4, DALi version 1.0.0
Returns:
The preferred orientation if previously set, or none

Returns the root Layer of the Window.

Since:
5.5, DALi version 1.4.19
Returns:
The root layer

Gets a screen off mode of the window.

Since:
4.0, DALi version 1.2.60
Returns:
The screen off mode.

Gets a size of the window.

Since:
4.0, DALi version 1.2.60
Returns:
The size of the window
std::string Dali::Window::GetSupportedAuxiliaryHint ( unsigned int  index) const

Gets the supported auxiliary hint string of the window.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]indexThe index of the supported auxiliary hint lists
Returns:
The auxiliary hint string of the index.
Note:
The window auxiliary hint is the value which is used to decide which actions should be made available to the user by the window manager. If you want to set specific hint to your window, then you should check whether it exists in the supported auxiliary hints.

Gets the count of supported auxiliary hints of the window.

Since:
4.0, DALi version 1.2.60
Returns:
The number of supported auxiliary hints.
Note:
The window auxiliary hint is the value which is used to decide which actions should be made available to the user by the window manager. If you want to set specific hint to your window, then you should check whether it exists in the supported auxiliary hints.

Gets a window type.

Since:
4.0, DALi version 1.2.60
Returns:
A window type.

Hides the window if it is showing.

Since:
4.0, DALi version 1.2.60

The user should connect to this signal to get a timing when indicator was shown / hidden.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0
Returns:
The signal to connect to

Returns whether window accepts focus or not.

Since:
4.0, DALi version 1.2.60
Returns:
True if the window accept focus, false otherwise

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

Since:
4.0, DALi version 1.2.60
Returns:
True if the window's visual state is opaque, false otherwise.
Remarks:
The return value has no meaning on an opaque window.
bool Dali::Window::IsVisible ( ) const

Returns whether the window is visible or not.

Since:
4.0, DALi version 1.2.60
Returns:
True if the window is visible, false otherwise.

Lowers window to the bottom of Window stack.

Since:
2.4, DALi version 1.0.0
static Window Dali::Window::New ( PositionSize  windowPosition,
const std::string &  name,
bool  isTransparent = false 
) [static]

Creates an initialized handle to a new Window.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]windowPositionThe position and size of the Window
[in]nameThe Window title
[in]isTransparentWhether Window is transparent
Returns:
A new window
Note:
This creates an extra window in addition to the default main window
static Window Dali::Window::New ( PositionSize  windowPosition,
const std::string &  name,
const std::string &  className,
bool  isTransparent = false 
) [static]

Creates an initialized handle to a new Window.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]windowPositionThe position and size of the Window
[in]nameThe Window title
[in]classNameThe Window class name
[in]isTransparentWhether Window is transparent
Note:
This creates an extra window in addition to the default main window
Returns:
A new Window
Window& Dali::Window::operator= ( const Window rhs)

This assignment operator is required for (smart) pointer semantics.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsA reference to the copied handle
Returns:
A reference to this

Raises window to the top of Window stack.

Since:
2.4, DALi version 1.0.0
void Dali::Window::Remove ( Actor  actor)

Removes a child Actor from the Window.

The child will be unreferenced.

Since:
5.5, DALi version 1.4.19
Parameters:
[in]actorThe child
Precondition:
The actor has been added to the stage.
bool Dali::Window::RemoveAuxiliaryHint ( unsigned int  id)

Removes an auxiliary hint of the window.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]idThe ID of the auxiliary hint.
Returns:
True if no error occurred, false otherwise.

Removes an orientation from the list of available orientations.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]orientationThe available orientation to remove

This signal is emitted when the window is resized.

A callback of the following type may be connected:

   void YourCallbackName( int width, int height );

The parameters are the resized width and height.

Since:
4.0, DALi version 1.2.60
Returns:
The signal to connect to

This signal is emitted when the window is resized.

A callback of the following type may be connected:

   void YourCallbackName( Window window, int width, int height );

The parameters are the resized width and height. and window means this signal was called from what window

Since:
5.5, DALi version 1.4.35
Returns:
The signal to connect to

This sets the orientation of indicator bar.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9

It does not implicitly show the indicator if it is currently hidden.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]orientationThe orientation
void Dali::Window::SetAcceptFocus ( bool  accept)

Sets whether window accepts focus or not.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]acceptIf focus is accepted or not. Default is true.
bool Dali::Window::SetAuxiliaryHintValue ( unsigned int  id,
const std::string &  value 
)

Changes a value of the auxiliary hint.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]idThe auxiliary hint ID.
[in]valueThe value string to be set.
Returns:
True if no error occurred, false otherwise.
void Dali::Window::SetBackgroundColor ( const Vector4 color)

Sets the background color of the Window.

Since:
5.5, DALi version 1.4.19
Parameters:
[in]colorThe new background color
bool Dali::Window::SetBrightness ( int  brightness)

Sets preferred brightness of the window.

This API is useful when the application needs to change the brightness of the screen when it is appeared on the screen. If the brightness has been set and the window is shown, the window manager requests the display system to change the brightness to the provided value. If the window is no longer shown, then the window manager requests the display system to go back to default brightness. A value less than 0 results in default brightness and a value greater than 100 results in maximum brightness.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]brightnessThe preferred brightness (0 to 100).
Returns:
True if no error occurred, false otherwise.
Privilege Level:
public
Privilege:
http://tizen.org/privilege/display
void Dali::Window::SetClass ( std::string  name,
std::string  klass 
)

Sets the window name and class string.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]nameThe name of the window
[in]klassThe class of the window

This sets the opacity mode of indicator bar.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0
Parameters:
[in]opacityThe opacity mode
void Dali::Window::SetInputRegion ( const Rect< int > &  inputRegion)

Sets a region to accept input events.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]inputRegionThe region to accept input events.

Sets a priority level for the specified notification window.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]levelThe notification window level.
Returns:
True if no error occurred, false otherwise.
Privilege Level:
public
Privilege:
http://tizen.org/privilege/window.priority.set
Remarks:
This can be used for a notification type window only. The default level is NotificationLevel::NONE.
void Dali::Window::SetOpaqueState ( bool  opaque)

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.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]opaqueWhether 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.

Sets a position of the window.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]positionThe new window position

Sets a preferred orientation.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]orientationThe preferred orientation
Precondition:
Orientation is in the list of available orientations.
Note:
To unset the preferred orientation, orientation should be set NO_ORIENTATION_PREFERENCE.

Sets a window's screen off mode.

This API is useful when the application needs to keep the display turned on. If the application sets the screen mode to #Dali::Window::ScreenOffMode::NEVER to its window and the window is shown, the window manager requests the display system to keep the display on as long as the window is shown. If the window is no longer shown, then the window manager requests the display system to go back to normal operation.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]screenOffModeThe screen mode.
Returns:
True if no error occurred, false otherwise.
Privilege Level:
public
Privilege:
http://tizen.org/privilege/display

Sets a size of the window.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]sizeThe new window size
void Dali::Window::SetTransparency ( bool  transparent)

Sets whether the window is transparent or not.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]transparentWhether the window is transparent
void Dali::Window::SetType ( Type  type)

Sets a window type.

Since:
4.0, DALi version 1.2.60
Parameters:
[in]typeThe window type.
Remarks:
The default window type is NORMAL.

Shows the window if it is hidden.

Since:
4.0, DALi version 1.2.60

This sets whether the indicator bar should be shown or not.

Deprecated:
Deprecated since 5.5, DALi version 1.4.9
Since:
2.4, DALi version 1.0.0
Parameters:
[in]visibleModeVisible mode for indicator bar, VISIBLE in default