Add Window APIs - type, notification level, screen mode, brightness
[platform/core/uifw/dali-adaptor.git] / adaptors / devel-api / adaptor-framework / window-devel.h
index 10325ed..6d07c71 100644 (file)
@@ -35,6 +35,48 @@ namespace Dali
 namespace DevelWindow
 {
 
+namespace NotificationLevel
+{
+
+/**
+ * @brief An enum of notification window's priority level.
+ */
+enum Type
+{
+  NONE    = -1,    ///< No notification level. Default level. This value makes the notification window place in the layer of the normal window.
+  BASE    = 10,    ///< Base notification level.
+  MEDIUM  = 20,    ///< Higher notification level than base.
+  HIGH    = 30,    ///< Higher notification level than medium.
+  TOP     = 40     ///< The highest notification level.
+};
+
+} // namespace NotificationLevel
+
+namespace ScreenMode
+{
+
+/**
+ * @brief An enum of screen mode.
+ */
+enum Type
+{
+  DEFAULT,      ///< The mode which turns the screen off after a timeout.
+  ALWAYS_ON     ///< The mode which keeps the screen turned on.
+};
+
+} // namespace ScreenMode
+
+/**
+ * @brief An enum of Window types.
+ */
+enum Type
+{
+  NORMAL,           ///< A default window type. Indicates a normal, top-level window. Almost every window will be created with this type.
+  NOTIFICATION,     ///< A notification window, like a warning about battery life or a new E-Mail received.
+  UTILITY,          ///< A persistent utility window, like a toolbox or palette.
+  DIALOG            ///< Used for simple dialog windows.
+};
+
 typedef Signal< void (bool) > FocusSignalType;      ///< Window focus signal type
 
 /**
@@ -156,6 +198,101 @@ DALI_IMPORT_API unsigned int GetAuxiliaryHintId( Window window, const std::strin
  */
 DALI_IMPORT_API void SetInputRegion( Window window, const Rect< int >& inputRegion );
 
+/**
+ * @brief Sets a window type.
+ * @param[in] window The window to set a type
+ * @param[in] type The window type.
+ * @remarks The default window type is NORMAL.
+ */
+DALI_IMPORT_API void SetType( Window window, Type type );
+
+/**
+ * @brief Gets a window type.
+ * @param[in] window The window to get a type
+ * @return A window type.
+ */
+DALI_IMPORT_API Type GetType( Window window );
+
+/**
+ * @brief Sets a priority level for the specified notification window.
+ * @param[in] window The window to set a notification level
+ * @param[in] level The notification window level.
+ * @return True if no error occurred, false otherwise.
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_WINDOW_PRIORITY
+ * @remarks This can be used for a notification type window only. The default level is NotificationLevel::NONE.
+ */
+DALI_IMPORT_API bool SetNotificationLevel( Window window, NotificationLevel::Type level );
+
+/**
+ * @brief Gets a priority level for the specified notification window.
+ * @param[in] window The window to get a notification level
+ * @return The notification window level.
+ * @remarks This can be used for a notification type window only.
+ */
+DALI_IMPORT_API NotificationLevel::Type GetNotificationLevel( Window window );
+
+/**
+ * @brief Sets a transparent window's visual state to opaque.
+ * @details If a visual state of a transparent window is opaque,
+ * then the window manager could handle it as an opaque window when calculating visibility.
+ * @param[in] window The window to set a state
+ * @param[in] 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.
+ */
+DALI_IMPORT_API void SetOpaqueState( Window window, bool opaque );
+
+/**
+ * @brief Returns whether a transparent window's visual state is opaque or not.
+ * @param[in] window The window to get a state
+ * @return True if the window's visual state is opaque, false otherwise.
+ * @remarks The return value has no meaning on an opaque window.
+ */
+DALI_IMPORT_API bool IsOpaqueState( Window window );
+
+/**
+ * @brief Sets a window's screen mode.
+ * @details This API is useful when the application needs to keep the display turned on.
+ * If the application sets the screen mode to #ScreenMode::ALWAYS_ON 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.
+ * @param[in] window The window to set a screen mode
+ * @param[in] screenMode The screen mode.
+ * @return True if no error occurred, false otherwise.
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
+ */
+DALI_IMPORT_API bool SetScreenMode( Window window, ScreenMode::Type screenMode );
+
+/**
+ * @brief Gets a screen mode of the window.
+ * @param[in] window The window to get a screen mode
+ * @return The screen mode.
+ */
+DALI_IMPORT_API ScreenMode::Type GetScreenMode( Window window );
+
+/**
+ * @brief Sets preferred brightness of the window.
+ * @details 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.
+ * @param[in] window The window to set a brightness
+ * @param[in] brightness The preferred brightness (0 to 100).
+ * @return True if no error occurred, false otherwise.
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
+ */
+DALI_IMPORT_API bool SetBrightness( Window window, int brightness );
+
+/**
+ * @brief Gets preffered brightness of the window.
+ * @param[in] window The window to get brightness
+ * @return The preffered brightness.
+ */
+DALI_IMPORT_API int GetBrightness( Window window );
+
 } // namespace DevelWindow
 
 } // namespace Dali