[Tizen] Window operations return detail result 80/258880/1
authorJiyun Yang <ji.yang@samsung.com>
Wed, 12 May 2021 06:40:13 +0000 (15:40 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Thu, 27 May 2021 05:12:03 +0000 (14:12 +0900)
Change-Id: I849cb5349a093142e45edf12599588634f354233
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
18 files changed:
dali/internal/window-system/android/window-base-android.cpp
dali/internal/window-system/android/window-base-android.h
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/macos/window-base-mac.h
dali/internal/window-system/macos/window-base-mac.mm
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h
dali/internal/window-system/windows/window-base-win.cpp
dali/internal/window-system/windows/window-base-win.h
dali/public-api/adaptor-framework/window-enumerations.h
dali/public-api/adaptor-framework/window.cpp
dali/public-api/adaptor-framework/window.h

index 8ce440b..352e8c1 100644 (file)
@@ -250,9 +250,9 @@ void WindowBaseAndroid::SetType(Dali::WindowType type)
 {
 }
 
-bool WindowBaseAndroid::SetNotificationLevel(Dali::WindowNotificationLevel level)
+Dali::WindowOperationResult WindowBaseAndroid::SetNotificationLevel(Dali::WindowNotificationLevel level)
 {
-  return false;
+  return Dali::WindowOperationResult::NOT_SUPPORTED;
 }
 
 Dali::WindowNotificationLevel WindowBaseAndroid::GetNotificationLevel() const
@@ -264,9 +264,9 @@ void WindowBaseAndroid::SetOpaqueState(bool opaque)
 {
 }
 
-bool WindowBaseAndroid::SetScreenOffMode(WindowScreenOffMode screenOffMode)
+Dali::WindowOperationResult WindowBaseAndroid::SetScreenOffMode(WindowScreenOffMode screenOffMode)
 {
-  return false;
+  return Dali::WindowOperationResult::NOT_SUPPORTED;
 }
 
 WindowScreenOffMode WindowBaseAndroid::GetScreenOffMode() const
@@ -274,9 +274,9 @@ WindowScreenOffMode WindowBaseAndroid::GetScreenOffMode() const
   return WindowScreenOffMode::TIMEOUT;
 }
 
-bool WindowBaseAndroid::SetBrightness(int brightness)
+Dali::WindowOperationResult WindowBaseAndroid::SetBrightness(int brightness)
 {
-  return false;
+  return Dali::WindowOperationResult::NOT_SUPPORTED;
 }
 
 int WindowBaseAndroid::GetBrightness() const
index 1dd4cd6..7cabb85 100644 (file)
@@ -266,7 +266,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
-  bool SetNotificationLevel(Dali::WindowNotificationLevel level) override;
+  Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
@@ -281,7 +281,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
    */
-  bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
+  Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
@@ -291,7 +291,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
    */
-  bool SetBrightness(int brightness) override;
+  Dali::WindowOperationResult SetBrightness(int brightness) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
index 0c0d896..ddb2993 100644 (file)
@@ -252,7 +252,7 @@ public:
   /**
    * @copydoc Dali::Window::SetNotificationLevel()
    */
-  virtual bool SetNotificationLevel(Dali::WindowNotificationLevel level) = 0;
+  virtual Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) = 0;
 
   /**
    * @copydoc Dali::Window::GetNotificationLevel()
@@ -267,7 +267,7 @@ public:
   /**
    * @copydoc Dali::Window::SetScreenOffMode()
    */
-  virtual bool SetScreenOffMode(WindowScreenOffMode screenOffMode) = 0;
+  virtual Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) = 0;
 
   /**
    * @copydoc Dali::Window::GetScreenOffMode()
@@ -277,7 +277,7 @@ public:
   /**
    * @copydoc Dali::Window::SetBrightness()
    */
-  virtual bool SetBrightness(int brightness) = 0;
+  virtual Dali::WindowOperationResult SetBrightness(int brightness) = 0;
 
   /**
    * @copydoc Dali::Window::GetBrightness()
index 69e75de..a5917bd 100644 (file)
@@ -511,12 +511,12 @@ WindowType Window::GetType() const
   return mType;
 }
 
-bool Window::SetNotificationLevel(WindowNotificationLevel level)
+WindowOperationResult Window::SetNotificationLevel(WindowNotificationLevel level)
 {
   if(mType != WindowType::NOTIFICATION)
   {
     DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType);
-    return false;
+    return WindowOperationResult::INVALID_OPERATION;
   }
 
   return mWindowBase->SetNotificationLevel(level);
@@ -547,7 +547,7 @@ bool Window::IsOpaqueState() const
   return mOpaqueState;
 }
 
-bool Window::SetScreenOffMode(WindowScreenOffMode screenOffMode)
+WindowOperationResult Window::SetScreenOffMode(WindowScreenOffMode screenOffMode)
 {
   return mWindowBase->SetScreenOffMode(screenOffMode);
 }
@@ -557,12 +557,12 @@ WindowScreenOffMode Window::GetScreenOffMode() const
   return mWindowBase->GetScreenOffMode();
 }
 
-bool Window::SetBrightness(int brightness)
+WindowOperationResult Window::SetBrightness(int brightness)
 {
   if(brightness < 0 || brightness > 100)
   {
     DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Invalid brightness value [%d]\n", brightness);
-    return false;
+    return WindowOperationResult::INVALID_OPERATION;
   }
 
   return mWindowBase->SetBrightness(brightness);
index 7b20b58..6e3b382 100644 (file)
@@ -221,7 +221,7 @@ public:
   /**
    * @copydoc Dali::Window::SetNotificationLevel()
    */
-  bool SetNotificationLevel(WindowNotificationLevel level);
+  WindowOperationResult SetNotificationLevel(WindowNotificationLevel level);
 
   /**
    * @copydoc Dali::Window::GetNotificationLevel()
@@ -241,7 +241,7 @@ public:
   /**
    * @copydoc Dali::Window::SetScreenOffMode()
    */
-  bool SetScreenOffMode(WindowScreenOffMode screenOffMode);
+  WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode);
 
   /**
    * @copydoc Dali::Window::GetScreenOffMode()
@@ -251,7 +251,7 @@ public:
   /**
    * @copydoc Dali::Window::SetBrightness()
    */
-  bool SetBrightness(int brightness);
+  WindowOperationResult SetBrightness(int brightness);
 
   /**
    * @copydoc Dali::Window::GetBrightness()
index dc0ee59..1637f36 100644 (file)
@@ -195,7 +195,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
-  bool SetNotificationLevel(WindowNotificationLevel level) override;
+  WindowOperationResult SetNotificationLevel(WindowNotificationLevel level) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
@@ -210,7 +210,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
    */
-  bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
+  WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
@@ -220,7 +220,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
    */
-  bool SetBrightness(int brightness) override;
+  WindowOperationResult SetBrightness(int brightness) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
index b98f8a6..7015c2b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -535,9 +535,9 @@ void WindowBaseCocoa::SetType( Dali::WindowType type )
 {
 }
 
-bool WindowBaseCocoa::SetNotificationLevel( WindowNotificationLevel level )
+WindowOperationResult WindowBaseCocoa::SetNotificationLevel( WindowNotificationLevel level )
 {
-  return false;
+  return WindowOperationResult::NOT_SUPPORTED;
 }
 
 WindowNotificationLevel WindowBaseCocoa::GetNotificationLevel() const
@@ -549,9 +549,9 @@ void WindowBaseCocoa::SetOpaqueState( bool opaque )
 {
 }
 
-bool WindowBaseCocoa::SetScreenOffMode(WindowScreenOffMode screenOffMode)
+WindowOperationResult WindowBaseCocoa::SetScreenOffMode(WindowScreenOffMode screenOffMode)
 {
-  return false;
+  return WindowOperationResult::NOT_SUPPORTED;
 }
 
 WindowScreenOffMode WindowBaseCocoa::GetScreenOffMode() const
@@ -559,9 +559,9 @@ WindowScreenOffMode WindowBaseCocoa::GetScreenOffMode() const
   return WindowScreenOffMode::TIMEOUT;
 }
 
-bool WindowBaseCocoa::SetBrightness( int brightness )
+WindowOperationResult WindowBaseCocoa::SetBrightness( int brightness )
 {
-  return false;
+  return WindowOperationResult::NOT_SUPPORTED;
 }
 
 int WindowBaseCocoa::GetBrightness() const
index 3a07b04..c177432 100644 (file)
@@ -1565,7 +1565,7 @@ void WindowBaseEcoreWl::SetType(Dali::WindowType type)
   ecore_wl_window_type_set(mEcoreWindow, windowType);
 }
 
-bool WindowBaseEcoreWl::SetNotificationLevel(Dali::WindowNotificationLevel level)
+Dali::WindowOperationResult WindowBaseEcoreWl::SetNotificationLevel(Dali::WindowNotificationLevel level)
 {
   while(!mTizenPolicy)
   {
@@ -1626,17 +1626,17 @@ bool WindowBaseEcoreWl::SetNotificationLevel(Dali::WindowNotificationLevel level
   if(!mNotificationLevelChangeDone)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState);
-    return false;
+    return Dali::WindowOperationResult::UNKNOWN_ERROR;
   }
   else if(mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetNotificationLevel: Permission denied! [%d]\n", level);
-    return false;
+    return Dali::WindowOperationResult::PERMISSION_DENIED;
   }
 
   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetNotificationLevel: Level is changed [%d]\n", mNotificationLevel);
 
-  return true;
+  return Dali::WindowOperationResult::SUCCEED;
 }
 
 Dali::WindowNotificationLevel WindowBaseEcoreWl::GetNotificationLevel() const
@@ -1713,7 +1713,7 @@ void WindowBaseEcoreWl::SetOpaqueState(bool opaque)
   tizen_policy_set_opaque_state(mTizenPolicy, ecore_wl_window_surface_get(mEcoreWindow), (opaque ? 1 : 0));
 }
 
-bool WindowBaseEcoreWl::SetScreenOffMode(WindowScreenOffMode screenOffMode)
+Dali::WindowOperationResult WindowBaseEcoreWl::SetScreenOffMode(WindowScreenOffMode screenOffMode)
 {
   while(!mTizenPolicy)
   {
@@ -1753,17 +1753,17 @@ bool WindowBaseEcoreWl::SetScreenOffMode(WindowScreenOffMode screenOffMode)
   if(!mScreenOffModeChangeDone)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mScreenOffModeChangeState);
-    return false;
+    return Dali::WindowOperationResult::UNKNOWN_ERROR;
   }
   else if(mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode);
-    return false;
+    return Dali::WindowOperationResult::PERMISSION_DENIED;
   }
 
   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetScreenOffMode: Screen mode is changed [%d]\n", mScreenOffMode);
 
-  return true;
+  return Dali::WindowOperationResult::SUCCEED;
 }
 
 WindowScreenOffMode WindowBaseEcoreWl::GetScreenOffMode() const
@@ -1809,7 +1809,7 @@ WindowScreenOffMode WindowBaseEcoreWl::GetScreenOffMode() const
   return screenMode;
 }
 
-bool WindowBaseEcoreWl::SetBrightness(int brightness)
+Dali::WindowOperationResult WindowBaseEcoreWl::SetBrightness(int brightness)
 {
   while(!mTizenDisplayPolicy)
   {
@@ -1833,17 +1833,17 @@ bool WindowBaseEcoreWl::SetBrightness(int brightness)
   if(!mBrightnessChangeDone)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mBrightnessChangeState);
-    return false;
+    return Dali::WindowOperationResult::UNKNOWN_ERROR;
   }
   else if(mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetBrightness: Permission denied! [%d]\n", brightness);
-    return false;
+    return Dali::WindowOperationResult::PERMISSION_DENIED;
   }
 
   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetBrightness: Brightness is changed [%d]\n", mBrightness);
 
-  return true;
+  return Dali::WindowOperationResult::SUCCEED;
 }
 
 int WindowBaseEcoreWl::GetBrightness() const
index 8726cd4..7c3bdd7 100644 (file)
@@ -333,7 +333,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
-  bool SetNotificationLevel(Dali::WindowNotificationLevel level) override;
+  Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
@@ -348,7 +348,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
    */
-  bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
+  Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
@@ -358,7 +358,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
    */
-  bool SetBrightness(int brightness) override;
+  Dali::WindowOperationResult SetBrightness(int brightness) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
index f54c22b..7587ece 100644 (file)
@@ -1879,7 +1879,7 @@ void WindowBaseEcoreWl2::SetType(Dali::WindowType type)
   ecore_wl2_window_type_set(mEcoreWindow, windowType);
 }
 
-bool WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel level)
+Dali::WindowOperationResult WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel level)
 {
   while(!mTizenPolicy)
   {
@@ -1940,17 +1940,17 @@ bool WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel leve
   if(!mNotificationLevelChangeDone)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState);
-    return false;
+    Dali::WindowOperationResult::UNKNOWN_ERROR;
   }
   else if(mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Permission denied! [%d]\n", level);
-    return false;
+    return Dali::WindowOperationResult::PERMISSION_DENIED;
   }
 
   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level is changed [%d]\n", mNotificationLevel);
 
-  return true;
+  return Dali::WindowOperationResult::SUCCEED;
 }
 
 Dali::WindowNotificationLevel WindowBaseEcoreWl2::GetNotificationLevel() const
@@ -2027,7 +2027,7 @@ void WindowBaseEcoreWl2::SetOpaqueState(bool opaque)
   tizen_policy_set_opaque_state(mTizenPolicy, ecore_wl2_window_surface_get(mEcoreWindow), (opaque ? 1 : 0));
 }
 
-bool WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode)
+Dali::WindowOperationResult WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode)
 {
   while(!mTizenPolicy)
   {
@@ -2067,17 +2067,17 @@ bool WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode)
   if(!mScreenOffModeChangeDone)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mScreenOffModeChangeState);
-    return false;
+    return Dali::WindowOperationResult::UNKNOWN_ERROR;
   }
   else if(mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode);
-    return false;
+    return Dali::WindowOperationResult::PERMISSION_DENIED;
   }
 
   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode is changed [%d]\n", mScreenOffMode);
 
-  return true;
+  return Dali::WindowOperationResult::SUCCEED;
 }
 
 WindowScreenOffMode WindowBaseEcoreWl2::GetScreenOffMode() const
@@ -2123,7 +2123,7 @@ WindowScreenOffMode WindowBaseEcoreWl2::GetScreenOffMode() const
   return screenMode;
 }
 
-bool WindowBaseEcoreWl2::SetBrightness(int brightness)
+Dali::WindowOperationResult WindowBaseEcoreWl2::SetBrightness(int brightness)
 {
   while(!mTizenDisplayPolicy)
   {
@@ -2147,17 +2147,17 @@ bool WindowBaseEcoreWl2::SetBrightness(int brightness)
   if(!mBrightnessChangeDone)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mBrightnessChangeState);
-    return false;
+    return Dali::WindowOperationResult::UNKNOWN_ERROR;
   }
   else if(mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
   {
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Permission denied! [%d]\n", brightness);
-    return false;
+    return Dali::WindowOperationResult::PERMISSION_DENIED;
   }
 
   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness is changed [%d]\n", mBrightness);
 
-  return true;
+  return Dali::WindowOperationResult::SUCCEED;
 }
 
 int WindowBaseEcoreWl2::GetBrightness() const
index 66582a8..338d234 100644 (file)
@@ -364,7 +364,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
-  bool SetNotificationLevel(Dali::WindowNotificationLevel level) override;
+  Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
@@ -379,7 +379,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
    */
-  bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
+  Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
@@ -389,7 +389,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
    */
-  bool SetBrightness(int brightness) override;
+  Dali::WindowOperationResult SetBrightness(int brightness) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
index b12f37e..0eea078 100644 (file)
@@ -768,9 +768,9 @@ void WindowBaseEcoreX::SetType(Dali::WindowType type)
 {
 }
 
-bool WindowBaseEcoreX::SetNotificationLevel(Dali::WindowNotificationLevel level)
+Dali::WindowOperationResult WindowBaseEcoreX::SetNotificationLevel(Dali::WindowNotificationLevel level)
 {
-  return false;
+  return Dali::WindowOperationResult::NOT_SUPPORTED;
 }
 
 Dali::WindowNotificationLevel WindowBaseEcoreX::GetNotificationLevel() const
@@ -782,9 +782,9 @@ void WindowBaseEcoreX::SetOpaqueState(bool opaque)
 {
 }
 
-bool WindowBaseEcoreX::SetScreenOffMode(WindowScreenOffMode screenOffMode)
+Dali::WindowOperationResult WindowBaseEcoreX::SetScreenOffMode(WindowScreenOffMode screenOffMode)
 {
-  return false;
+  return Dali::WindowOperationResult::NOT_SUPPORTED;
 }
 
 WindowScreenOffMode WindowBaseEcoreX::GetScreenOffMode() const
@@ -792,9 +792,9 @@ WindowScreenOffMode WindowBaseEcoreX::GetScreenOffMode() const
   return WindowScreenOffMode::TIMEOUT;
 }
 
-bool WindowBaseEcoreX::SetBrightness(int brightness)
+Dali::WindowOperationResult WindowBaseEcoreX::SetBrightness(int brightness)
 {
-  return false;
+  return Dali::WindowOperationResult::NOT_SUPPORTED;
 }
 
 int WindowBaseEcoreX::GetBrightness() const
index 24081d6..2630578 100644 (file)
@@ -267,7 +267,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
-  bool SetNotificationLevel(Dali::WindowNotificationLevel level) override;
+  Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
@@ -282,7 +282,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
    */
-  bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
+  Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
@@ -292,7 +292,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
    */
-  bool SetBrightness(int brightness) override;
+  Dali::WindowOperationResult SetBrightness(int brightness) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
index 2b2f6bd..6382e43 100644 (file)
@@ -372,9 +372,9 @@ void WindowBaseWin::SetType(Dali::WindowType type)
 {
 }
 
-bool WindowBaseWin::SetNotificationLevel(Dali::WindowNotificationLevel level)
+Dali::WindowOperationResult WindowBaseWin::SetNotificationLevel(Dali::WindowNotificationLevel level)
 {
-  return false;
+  return Dali::WindowOperationResult::NOT_SUPPORTED;
 }
 
 Dali::WindowNotificationLevel WindowBaseWin::GetNotificationLevel() const
@@ -386,9 +386,9 @@ void WindowBaseWin::SetOpaqueState(bool opaque)
 {
 }
 
-bool WindowBaseWin::SetScreenOffMode(WindowScreenOffMode screenOffMode)
+Dali::WindowOperationResult WindowBaseWin::SetScreenOffMode(WindowScreenOffMode screenOffMode)
 {
-  return false;
+  return Dali::WindowOperationResult::NOT_SUPPORTED;
 }
 
 WindowScreenOffMode WindowBaseWin::GetScreenOffMode() const
@@ -396,9 +396,9 @@ WindowScreenOffMode WindowBaseWin::GetScreenOffMode() const
   return WindowScreenOffMode::TIMEOUT;
 }
 
-bool WindowBaseWin::SetBrightness(int brightness)
+Dali::WindowOperationResult WindowBaseWin::SetBrightness(int brightness)
 {
-  return false;
+  return Dali::WindowOperationResult::NOT_SUPPORTED;
 }
 
 int WindowBaseWin::GetBrightness() const
index dedbccb..57b51c4 100644 (file)
@@ -254,7 +254,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
    */
-  bool SetNotificationLevel(Dali::WindowNotificationLevel level) override;
+  Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
@@ -269,7 +269,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
    */
-  bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
+  Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
@@ -279,7 +279,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
    */
-  bool SetBrightness(int brightness) override;
+  Dali::WindowOperationResult SetBrightness(int brightness) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
index 22895ca..9797af1 100644 (file)
@@ -93,6 +93,18 @@ enum class WindowEffectType
   HIDE,     ///< Window hide effect. @SINCE_2_0.0
 };
 
+/**
+ * @brief An enum of window operation result.
+ */
+enum class WindowOperationResult
+{
+  UNKNOWN_ERROR = 0, ///< Failed for unknown reason.
+  SUCCEED,           ///< Succeed.
+  PERMISSION_DENIED, ///< Permission denied.
+  NOT_SUPPORTED,     ///< The operation is not supported.
+  INVALID_OPERATION, ///< The operation is invalid. (e.g. Try to operate to the wrong window)
+};
+
 } // namespace Dali
 
 #endif // DALI_WINDOW_ENUMERATIONS_H
index f1b67fe..0000add 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -248,7 +248,7 @@ WindowType Window::GetType() const
   return GetImplementation(*this).GetType();
 }
 
-bool Window::SetNotificationLevel(WindowNotificationLevel level)
+WindowOperationResult Window::SetNotificationLevel(WindowNotificationLevel level)
 {
   return GetImplementation(*this).SetNotificationLevel(level);
 }
@@ -268,7 +268,7 @@ bool Window::IsOpaqueState() const
   return GetImplementation(*this).IsOpaqueState();
 }
 
-bool Window::SetScreenOffMode(WindowScreenOffMode screenMode)
+WindowOperationResult Window::SetScreenOffMode(WindowScreenOffMode screenMode)
 {
   return GetImplementation(*this).SetScreenOffMode(screenMode);
 }
@@ -278,7 +278,7 @@ WindowScreenOffMode Window::GetScreenOffMode() const
   return GetImplementation(*this).GetScreenOffMode();
 }
 
-bool Window::SetBrightness(int brightness)
+WindowOperationResult Window::SetBrightness(int brightness)
 {
   return GetImplementation(*this).SetBrightness(brightness);
 }
index 759dfcd..e0c8d34 100644 (file)
@@ -420,12 +420,12 @@ public:
    * @brief Sets a priority level for the specified notification window.
    * @@SINCE_2_0.0
    * @param[in] level The notification window level.
-   * @return True if no error occurred, false otherwise.
+   * @return The result of the window operation.
    * @PRIVLEVEL_PUBLIC
    * @PRIVILEGE_WINDOW_PRIORITY
    * @remarks This can be used for a notification type window only. The default level is NotificationLevel::NONE.
    */
-  bool SetNotificationLevel(WindowNotificationLevel level);
+  WindowOperationResult SetNotificationLevel(WindowNotificationLevel level);
 
   /**
    * @brief Gets a priority level for the specified notification window.
@@ -462,11 +462,11 @@ public:
    * If the window is no longer shown, then the window manager requests the display system to go back to normal operation.
    * @@SINCE_2_0.0
    * @param[in] screenOffMode The screen mode.
-   * @return True if no error occurred, false otherwise.
+   * @return The result of the window operation.
    * @PRIVLEVEL_PUBLIC
    * @PRIVILEGE_DISPLAY
    */
-  bool SetScreenOffMode(WindowScreenOffMode screenOffMode);
+  WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode);
 
   /**
    * @brief Gets a screen off mode of the window.
@@ -483,11 +483,11 @@ public:
    * A value less than 0 results in default brightness and a value greater than 100 results in maximum brightness.
    * @SINCE_1_2.60
    * @param[in] brightness The preferred brightness (0 to 100).
-   * @return True if no error occurred, false otherwise.
+   * @return The result of the window operation.
    * @PRIVLEVEL_PUBLIC
    * @PRIVILEGE_DISPLAY
    */
-  bool SetBrightness(int brightness);
+  WindowOperationResult SetBrightness(int brightness);
 
   /**
    * @brief Gets preferred brightness of the window.