Merge "Add text selection popup style" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-selection-popup-impl.h
index 64130e1..b3739d6 100644 (file)
@@ -24,6 +24,7 @@
 #include <string>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/table-view/table-view.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h>
@@ -114,6 +115,16 @@ public:
   static Property::Value GetProperty(BaseObject* object, Property::Index index);
 
   /**
+   * @brief Toolkit::TextSelectionPopup::SetProperties()
+   */
+  void SetProperties(const Property::Map& properties);
+
+  /**
+   * @brief Toolkit::TextSelectionPopup::GetProperties()
+   */
+  void GetProperties(Property::Map& properties);
+
+  /**
    * @copydoc Toolkit::EnableButtons
    */
   void EnableButtons(Toolkit::TextSelectionPopup::Buttons buttonsToEnable);
@@ -139,6 +150,11 @@ private: // From Control
    */
   void OnInitialize() override;
 
+  /**
+   * @copydoc Toolkit::Internal::Control::CreateAccessibleObject()
+   */
+  DevelControl::ControlAccessible* CreateAccessibleObject() override;
+
 private: // Implementation
   void HideAnimationFinished(Animation& animation);
 
@@ -241,6 +257,18 @@ private: // Implementation
    */
   Padding GetOptionDividerPadding() const;
 
+  /**
+   * Set label padding
+   * @param[in] padding BEGIN END BOTTOM TOP
+   */
+  void SetLabelPadding(const Padding& padding);
+
+  /**
+   * Get label padding
+   * @return Padding
+   */
+  Padding GetLabelPadding() const;
+
   void CreateOrderedListOfPopupOptions();
 
   void AddOption(const ButtonRequirement& button, bool showDivider, bool showIcons, bool showCaption);
@@ -257,6 +285,14 @@ private: // Implementation
   void CreateBackgroundBorder(Property::Map& propertyMap);
 
   /**
+   * Creates the background image
+   *
+   * @param[in] propertyMap The properties describing the background
+   */
+  void CreateBackground(Property::Map& propertyMap);
+
+
+  /**
    * Construct a new TextField.
    */
   TextSelectionPopup(TextSelectionPopupCallbackInterface* callbackInterface);
@@ -266,6 +302,20 @@ private: // Implementation
    */
   virtual ~TextSelectionPopup();
 
+protected:
+  struct PropertyHandler;
+
+  class TextSelectionPopupAccessible : public DevelControl::ControlAccessible
+  {
+  public:
+    using DevelControl::ControlAccessible::ControlAccessible;
+
+    /**
+     * @copydoc DevelControl::ControlAccessible::CalculateStates()
+     */
+    Dali::Accessibility::States CalculateStates() override;
+  };
+
 private:
   // Undefined copy constructor and assignment operators
   TextSelectionPopup(const TextSelectionPopup&);
@@ -290,15 +340,21 @@ private: // Data
   Size    mOptionDividerSize;    // Size of divider line
   Padding mOptionDividerPadding; // Padding of divider line
 
+  Vector2       mLabelMinimumSize; // Minimum size of label
+  Padding       mLabelPadding;     // Padding of label
+  Property::Map mLabelTextVisual;  // Text visual map of label
+  bool          mEnableScrollBar;  // Enable scrollbar
+
   std::vector<ButtonRequirement> mOrderListOfButtons; // List of buttons in the order to be displayed and a flag to indicate if needed.
 
   Toolkit::TextSelectionPopup::Buttons          mEnabledButtons; // stores enabled buttons
   Toolkit::TextSelectionPopupCallbackInterface* mCallbackInterface;
 
-  std::string mPressedImage; // Image used for the popup option when pressed.
-  Vector4     mPressedColor; // Color of the popup option when pressed.
-  Vector4     mDividerColor; // Color of the divider between buttons
-  Vector4     mIconColor;    // Color of the popup icon.
+  std::string mPressedImage;        // Image used for the popup option when pressed.
+  Vector4     mPressedColor;        // Color of the popup option when pressed.
+  float       mPressedCornerRadius; // Corner radius of the popup option when pressed.
+  Vector4     mDividerColor;        // Color of the divider between buttons
+  Vector4     mIconColor;           // Color of the popup icon.
 
   // Priority of Options/Buttons in the Cut and Paste pop-up, higher priority buttons are displayed first, left to right.
   std::size_t mSelectOptionPriority;    // Position of Select Button