Refactored text selection popup to reduce loc 14/273614/2
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 8 Apr 2022 12:19:36 +0000 (21:19 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Fri, 8 Apr 2022 13:19:48 +0000 (22:19 +0900)
- refactored property setters/getters

- I plan to bind the TextSelectionPopup to NUI.
before that, I will reduce loc with some refactoring.

Change-Id: I7f790153ed845a50a68591c97211d240b662e77e
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-property-handler.cpp [new file with mode: 0644]
dali-toolkit/internal/controls/text-controls/text-selection-popup-property-handler.h [new file with mode: 0644]
dali-toolkit/internal/file.list

index f8ee78d..c256b7a 100644 (file)
@@ -238,6 +238,7 @@ int UtcDaliToolkitTextSelectionPopupIconProperties(void)
   popup.SetProperty(TextSelectionPopup::Property::POPUP_PASTE_BUTTON_ICON_IMAGE, "POPUP_PASTE_BUTTON_ICON_IMAGE");
   popup.SetProperty(TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE, "POPUP_SELECT_BUTTON_ICON_IMAGE");
   popup.SetProperty(TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE, "POPUP_SELECT_ALL_BUTTON_ICON_IMAGE");
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_PRESSED_IMAGE, "POPUP_PRESSED_IMAGE");
 
   DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_CLIPBOARD_BUTTON_ICON_IMAGE", TEST_LOCATION);
   DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_CUT_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_CUT_BUTTON_ICON_IMAGE", TEST_LOCATION);
@@ -245,6 +246,7 @@ int UtcDaliToolkitTextSelectionPopupIconProperties(void)
   DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_PASTE_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_PASTE_BUTTON_ICON_IMAGE", TEST_LOCATION);
   DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_SELECT_BUTTON_ICON_IMAGE", TEST_LOCATION);
   DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_SELECT_ALL_BUTTON_ICON_IMAGE", TEST_LOCATION);
+  DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_PRESSED_IMAGE).Get<std::string>(), "POPUP_PRESSED_IMAGE", TEST_LOCATION);
 
   END_TEST;
 }
@@ -273,3 +275,35 @@ int UtcDaliToolkitTextSelectionPopupSizeProperties(void)
 
   END_TEST;
 }
+
+int UtcDaliToolkitTextSelectionPopupDurationProperties(void)
+{
+  ToolkitTestApplication application;
+  TextSelectionPopup     popup = TextSelectionPopup::New(nullptr);
+
+  const float popupFadeInDuration = 5.0f;
+  const float popupFadeOutDuration = 10.0f;
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_FADE_IN_DURATION, popupFadeInDuration);
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_FADE_OUT_DURATION, popupFadeOutDuration);
+
+  DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_FADE_IN_DURATION).Get<float>(), popupFadeInDuration, TEST_LOCATION);
+  DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_FADE_OUT_DURATION).Get<float>(), popupFadeOutDuration, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitTextSelectionPopupColorProperties(void)
+{
+  ToolkitTestApplication application;
+  TextSelectionPopup     popup = TextSelectionPopup::New(nullptr);
+
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_DIVIDER_COLOR, Color::RED);
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_ICON_COLOR, Color::BLUE);
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_PRESSED_COLOR, Color::BLACK);
+
+  DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_DIVIDER_COLOR).Get<Vector4>(), Color::RED, TEST_LOCATION);
+  DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_ICON_COLOR).Get<Vector4>(), Color::BLUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_PRESSED_COLOR).Get<Vector4>(), Color::BLACK, TEST_LOCATION);
+
+  END_TEST;
+}
\ No newline at end of file
index 5d41058..ffa258d 100644 (file)
@@ -38,6 +38,7 @@
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/internal/controls/text-controls/text-selection-popup-property-handler.h>
 #include <dali-toolkit/internal/helpers/color-conversion.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
@@ -149,104 +150,8 @@ void TextSelectionPopup::SetProperty(BaseObject* object, Property::Index index,
 
   if(selectionPopup)
   {
-    TextSelectionPopup& impl(GetImpl(selectionPopup));
-
-    switch(index)
-    {
-      case Toolkit::TextSelectionPopup::Property::POPUP_MAX_SIZE:
-      {
-        impl.SetDimensionToCustomise(POPUP_MAXIMUM_SIZE, value.Get<Vector2>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::OPTION_MAX_SIZE:
-      {
-        impl.SetDimensionToCustomise(OPTION_MAXIMUM_SIZE, value.Get<Vector2>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::OPTION_MIN_SIZE:
-      {
-        impl.SetDimensionToCustomise(OPTION_MINIMUM_SIZE, value.Get<Vector2>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_SIZE:
-      {
-        impl.SetDimensionToCustomise(OPTION_DIVIDER_SIZE, value.Get<Vector2>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_PADDING:
-      {
-        Vector4 padding(value.Get<Vector4>());
-        impl.SetOptionDividerPadding(Padding(padding.x, padding.y, padding.z, padding.w));
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE:
-      {
-        impl.SetButtonImage(Toolkit::TextSelectionPopup::CLIPBOARD, value.Get<std::string>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_CUT_BUTTON_ICON_IMAGE:
-      {
-        impl.SetButtonImage(Toolkit::TextSelectionPopup::CUT, value.Get<std::string>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_COPY_BUTTON_ICON_IMAGE:
-      {
-        impl.SetButtonImage(Toolkit::TextSelectionPopup::COPY, value.Get<std::string>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_PASTE_BUTTON_ICON_IMAGE:
-      {
-        impl.SetButtonImage(Toolkit::TextSelectionPopup::PASTE, value.Get<std::string>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE:
-      {
-        impl.SetButtonImage(Toolkit::TextSelectionPopup::SELECT, value.Get<std::string>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE:
-      {
-        impl.SetButtonImage(Toolkit::TextSelectionPopup::SELECT_ALL, value.Get<std::string>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_DIVIDER_COLOR:
-      {
-        impl.mDividerColor = value.Get<Vector4>();
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_ICON_COLOR:
-      {
-        impl.mIconColor = value.Get<Vector4>();
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_PRESSED_COLOR:
-      {
-        impl.mPressedColor = value.Get<Vector4>();
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_PRESSED_IMAGE:
-      {
-        impl.SetPressedImage(value.Get<std::string>());
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_FADE_IN_DURATION:
-      {
-        impl.mFadeInDuration = value.Get<float>();
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_FADE_OUT_DURATION:
-      {
-        impl.mFadeOutDuration = value.Get<float>();
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER:
-      {
-        Property::Map map = value.Get<Property::Map>();
-        impl.CreateBackgroundBorder(map);
-        break;
-      }
-    } // switch
-  }   // TextSelectionPopup
+    PropertyHandler::SetProperty(selectionPopup, index, value);
+  }
 }
 
 Property::Value TextSelectionPopup::GetProperty(BaseObject* object, Property::Index index)
@@ -257,93 +162,7 @@ Property::Value TextSelectionPopup::GetProperty(BaseObject* object, Property::In
 
   if(selectionPopup)
   {
-    TextSelectionPopup& impl(GetImpl(selectionPopup));
-
-    switch(index)
-    {
-      case Toolkit::TextSelectionPopup::Property::POPUP_MAX_SIZE:
-      {
-        value = impl.GetDimensionToCustomise(POPUP_MAXIMUM_SIZE);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::OPTION_MAX_SIZE:
-      {
-        value = impl.GetDimensionToCustomise(OPTION_MAXIMUM_SIZE);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::OPTION_MIN_SIZE:
-      {
-        value = impl.GetDimensionToCustomise(OPTION_MINIMUM_SIZE);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_SIZE:
-      {
-        value = impl.GetDimensionToCustomise(OPTION_DIVIDER_SIZE);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_PADDING:
-      {
-        Padding padding = impl.GetOptionDividerPadding();
-        value           = Vector4(padding.left, padding.right, padding.top, padding.bottom);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE:
-      {
-        value = impl.GetButtonImage(Toolkit::TextSelectionPopup::CLIPBOARD);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_CUT_BUTTON_ICON_IMAGE:
-      {
-        value = impl.GetButtonImage(Toolkit::TextSelectionPopup::CUT);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_COPY_BUTTON_ICON_IMAGE:
-      {
-        value = impl.GetButtonImage(Toolkit::TextSelectionPopup::COPY);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_PASTE_BUTTON_ICON_IMAGE:
-      {
-        value = impl.GetButtonImage(Toolkit::TextSelectionPopup::PASTE);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE:
-      {
-        value = impl.GetButtonImage(Toolkit::TextSelectionPopup::SELECT);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE:
-      {
-        value = impl.GetButtonImage(Toolkit::TextSelectionPopup::SELECT_ALL);
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_PRESSED_IMAGE:
-      {
-        value = impl.GetPressedImage();
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_FADE_IN_DURATION:
-      {
-        value = impl.mFadeInDuration;
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::POPUP_FADE_OUT_DURATION:
-      {
-        value = impl.mFadeOutDuration;
-        break;
-      }
-      case Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER:
-      {
-        Property::Map         map;
-        Toolkit::Visual::Base visual = DevelControl::GetVisual(impl, Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER);
-        if(visual)
-        {
-          visual.CreatePropertyMap(map);
-        }
-        value = map;
-        break;
-      }
-    } // switch
+    value = PropertyHandler::GetProperty(selectionPopup, index);
   }
   return value;
 }
index 41686ee..db51100 100644 (file)
@@ -273,6 +273,8 @@ private: // Implementation
   virtual ~TextSelectionPopup();
 
 protected:
+  struct PropertyHandler;
+
   class TextSelectionPopupAccessible : public DevelControl::ControlAccessible
   {
   public:
diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-property-handler.cpp b/dali-toolkit/internal/controls/text-controls/text-selection-popup-property-handler.cpp
new file mode 100644 (file)
index 0000000..fe6e93f
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2022 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.
+ */
+
+#include <dali-toolkit/internal/controls/text-controls/text-selection-popup-property-handler.h>
+#include <dali/integration-api/debug.h>
+
+#if defined(DEBUG_ENABLED)
+extern Debug::Filter* gLogFilter;
+#endif
+
+namespace Dali::Toolkit::Internal
+{
+void TextSelectionPopup::PropertyHandler::SetProperty(Toolkit::TextSelectionPopup selectionPopup, Property::Index index, const Property::Value& value)
+{
+  TextSelectionPopup& impl(GetImpl(selectionPopup));
+
+  switch(index)
+  {
+    case Toolkit::TextSelectionPopup::Property::POPUP_MAX_SIZE:
+    {
+      impl.SetDimensionToCustomise(POPUP_MAXIMUM_SIZE, value.Get<Vector2>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::OPTION_MAX_SIZE:
+    {
+      impl.SetDimensionToCustomise(OPTION_MAXIMUM_SIZE, value.Get<Vector2>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::OPTION_MIN_SIZE:
+    {
+      impl.SetDimensionToCustomise(OPTION_MINIMUM_SIZE, value.Get<Vector2>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_SIZE:
+    {
+      impl.SetDimensionToCustomise(OPTION_DIVIDER_SIZE, value.Get<Vector2>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_PADDING:
+    {
+      Vector4 padding(value.Get<Vector4>());
+      impl.SetOptionDividerPadding(Padding(padding.x, padding.y, padding.z, padding.w));
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE:
+    {
+      impl.SetButtonImage(Toolkit::TextSelectionPopup::CLIPBOARD, value.Get<std::string>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_CUT_BUTTON_ICON_IMAGE:
+    {
+      impl.SetButtonImage(Toolkit::TextSelectionPopup::CUT, value.Get<std::string>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_COPY_BUTTON_ICON_IMAGE:
+    {
+      impl.SetButtonImage(Toolkit::TextSelectionPopup::COPY, value.Get<std::string>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_PASTE_BUTTON_ICON_IMAGE:
+    {
+      impl.SetButtonImage(Toolkit::TextSelectionPopup::PASTE, value.Get<std::string>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE:
+    {
+      impl.SetButtonImage(Toolkit::TextSelectionPopup::SELECT, value.Get<std::string>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE:
+    {
+      impl.SetButtonImage(Toolkit::TextSelectionPopup::SELECT_ALL, value.Get<std::string>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_DIVIDER_COLOR:
+    {
+      impl.mDividerColor = value.Get<Vector4>();
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_ICON_COLOR:
+    {
+      impl.mIconColor = value.Get<Vector4>();
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_PRESSED_COLOR:
+    {
+      impl.mPressedColor = value.Get<Vector4>();
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_PRESSED_IMAGE:
+    {
+      impl.SetPressedImage(value.Get<std::string>());
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_FADE_IN_DURATION:
+    {
+      impl.mFadeInDuration = value.Get<float>();
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_FADE_OUT_DURATION:
+    {
+      impl.mFadeOutDuration = value.Get<float>();
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER:
+    {
+      Property::Map map = value.Get<Property::Map>();
+      impl.CreateBackgroundBorder(map);
+      break;
+    }
+  }
+}
+
+Property::Value TextSelectionPopup::PropertyHandler::GetProperty(Toolkit::TextSelectionPopup selectionPopup, Property::Index index)
+{
+  Property::Value value;
+  TextSelectionPopup& impl(GetImpl(selectionPopup));
+
+  switch(index)
+  {
+    case Toolkit::TextSelectionPopup::Property::POPUP_MAX_SIZE:
+    {
+      value = impl.GetDimensionToCustomise(POPUP_MAXIMUM_SIZE);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::OPTION_MAX_SIZE:
+    {
+      value = impl.GetDimensionToCustomise(OPTION_MAXIMUM_SIZE);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::OPTION_MIN_SIZE:
+    {
+      value = impl.GetDimensionToCustomise(OPTION_MINIMUM_SIZE);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_SIZE:
+    {
+      value = impl.GetDimensionToCustomise(OPTION_DIVIDER_SIZE);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::OPTION_DIVIDER_PADDING:
+    {
+      Padding padding = impl.GetOptionDividerPadding();
+      value           = Vector4(padding.left, padding.right, padding.top, padding.bottom);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE:
+    {
+      value = impl.GetButtonImage(Toolkit::TextSelectionPopup::CLIPBOARD);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_CUT_BUTTON_ICON_IMAGE:
+    {
+      value = impl.GetButtonImage(Toolkit::TextSelectionPopup::CUT);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_COPY_BUTTON_ICON_IMAGE:
+    {
+      value = impl.GetButtonImage(Toolkit::TextSelectionPopup::COPY);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_PASTE_BUTTON_ICON_IMAGE:
+    {
+      value = impl.GetButtonImage(Toolkit::TextSelectionPopup::PASTE);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE:
+    {
+      value = impl.GetButtonImage(Toolkit::TextSelectionPopup::SELECT);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE:
+    {
+      value = impl.GetButtonImage(Toolkit::TextSelectionPopup::SELECT_ALL);
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_DIVIDER_COLOR:
+    {
+      value = impl.mDividerColor;
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_ICON_COLOR:
+    {
+      value = impl.mIconColor;
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_PRESSED_COLOR:
+    {
+      value = impl.mPressedColor;
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_PRESSED_IMAGE:
+    {
+      value = impl.GetPressedImage();
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_FADE_IN_DURATION:
+    {
+      value = impl.mFadeInDuration;
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::POPUP_FADE_OUT_DURATION:
+    {
+      value = impl.mFadeOutDuration;
+      break;
+    }
+    case Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER:
+    {
+      Property::Map         map;
+      Toolkit::Visual::Base visual = DevelControl::GetVisual(impl, Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER);
+      if(visual)
+      {
+        visual.CreatePropertyMap(map);
+      }
+      value = map;
+      break;
+    }
+  }
+
+  return value;
+}
+
+} // namespace Dali::Toolkit::Internal
diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-property-handler.h b/dali-toolkit/internal/controls/text-controls/text-selection-popup-property-handler.h
new file mode 100644 (file)
index 0000000..805e3d8
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_PROPERTY_HANDLER_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_PROPERTY_HANDLER_H
+
+/*
+ * Copyright (c) 2022 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.
+ */
+
+#include <dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h>
+
+namespace Dali::Toolkit::Internal
+{
+/**
+ * Class to manage properties for the TextSelectionPopup
+ */
+struct TextSelectionPopup::PropertyHandler
+{
+  /**
+   * Set properties on the text selection popup
+   *
+   * @param[in] selectionPopup The handle for the text selection popup
+   * @param[in] index The property index of the property to set
+   * @param[in] value The value to set
+   */
+  static void SetProperty(Toolkit::TextSelectionPopup selectionPopup, Property::Index index, const Property::Value& value);
+
+  /**
+   * Get properties from the text selection popup
+   *
+   * @param[in] selectionPopup The handle for the text selection popup
+   * @param[in] index The property index of the property to set
+   * @return the value
+   */
+  static Property::Value GetProperty(Toolkit::TextSelectionPopup selectionPopup, Property::Index index);
+};
+
+} // namespace Dali::Toolkit::Internal
+
+#endif //DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_PROPERTY_HANDLER_H
index 355667e..b1920a9 100644 (file)
@@ -111,6 +111,7 @@ SET( toolkit_src_files
    ${toolkit_src_dir}/controls/text-controls/text-field-property-handler.cpp
    ${toolkit_src_dir}/controls/text-controls/text-label-impl.cpp
    ${toolkit_src_dir}/controls/text-controls/text-selection-popup-impl.cpp
+   ${toolkit_src_dir}/controls/text-controls/text-selection-popup-property-handler.cpp
    ${toolkit_src_dir}/controls/text-controls/text-selection-toolbar-impl.cpp
    ${toolkit_src_dir}/controls/tool-bar/tool-bar-impl.cpp
    ${toolkit_src_dir}/controls/tooltip/tooltip.cpp