X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-selection-popup-impl.h;h=a79a925c55ab99d089a64e3aca970af9cdb8c425;hp=3bb8b7113d4c80ae19bcdd662ce56ec4b8ca5b1d;hb=b694e7e2ae624e206e1548b1a863c554eb9cd4d7;hpb=88e94c0533741de9664d32968a85f18db5a4c5dd diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h index 3bb8b71..a79a925 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H__ -#define __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H__ +#ifndef DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H +#define DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -21,13 +21,14 @@ // INTERNAL INCLUDES #include #include +#include #include #include #include // EXTERNAL INCLUDES -#include #include +#include namespace Dali { @@ -38,20 +39,14 @@ namespace Toolkit namespace Internal { -namespace -{ - enum PopupCustomisations { POPUP_MAXIMUM_SIZE, - POPUP_MINIMUM_SIZE, OPTION_MAXIMUM_SIZE, OPTION_MINIMUM_SIZE, OPTION_DIVIDER_SIZE }; -} // namespace - class TextSelectionPopup : public Control { public: @@ -98,12 +93,10 @@ public: /** * @brief New constructor with provided buttons to enable. - * @param[in] buttonsToEnable bit mask of buttons to enable * @param[in] callbackInterface The text popup callback interface which receives the button click callbacks. * @return A handle to the TextSelectionPopup control. */ - static Toolkit::TextSelectionPopup New( Toolkit::TextSelectionPopup::Buttons buttonsToEnable, - TextSelectionPopupCallbackInterface* callbackInterface ); + static Toolkit::TextSelectionPopup New( TextSelectionPopupCallbackInterface* callbackInterface ); // Properties @@ -125,24 +118,36 @@ public: static Property::Value GetProperty( BaseObject* object, Property::Index index ); /** + * @copydoc Toolkit::EnableButtons + */ + void EnableButtons( Toolkit::TextSelectionPopup::Buttons buttonsToEnable ); + + /** * @copydoc Toolkit::TextSelectionPopup::RaiseAbove() */ void RaiseAbove( Layer target ); -private: // From Control + /** + * @copydoc Toolkit::TextSelectionPopup::ShowPopup() + */ + void ShowPopup(); /** - * @copydoc Control::OnInitialize() + * @copydoc Toolkiut::TextSelectionPopup::HidePopup() */ - virtual void OnInitialize(); + void HidePopup(); + +private: // From Control /** - * @copydoc Control::OnStageConnection() + * @copydoc Control::OnInitialize() */ - virtual void OnStageConnection( int depth ); + virtual void OnInitialize(); private: // Implementation + void HideAnimationFinished( Animation& animation ); + /** * @brief When the cut button is pressed. * @param[in] button the button pressed @@ -216,6 +221,20 @@ private: // Implementation */ Dali::Image GetButtonImage( Toolkit::TextSelectionPopup::Buttons button ); + /** + * @brief Sets the image for the pressed state of a popup option. + * + * @param[in] filename The image filename to use. + */ + void SetPressedImage( const std::string& filename); + + /** + * @brief Gets the image used for the pressed state of a popup option. + * + * @return The image filename used. + */ + std::string GetPressedImage() const; + void CreateOrderedListOfPopupOptions(); void AddOption( const ButtonRequirement& button, bool showDivider, bool showIcons, bool showCaption ); @@ -224,7 +243,12 @@ private: // Implementation void AddPopupOptionsToToolbar( bool showIcons, bool showCaptions ); - void CreatePopup(); + /** + * Creates the background-border image + * + * @param[in] propertyMap The properties describing the background-border + */ + void CreateBackgroundBorder( Property::Map& propertyMap ); /** * Construct a new TextField. @@ -257,21 +281,20 @@ private: // Data Image mSelectIconImage; Image mSelectAllIconImage; - Size mMaxSize; // Maximum size of the Popup - Size mMinSize; // Minimum size of the Popup - - Size mOptionMaxSize; // Maximum size of an Option button - Size mOptionMinSize; // Minimum size of an Option button - Size mOptionDividerSize; // Size of divider line + Size mPopupMaxSize; // Maximum size of the Popup + Size mOptionMaxSize; // Maximum size of an Option button + Size mOptionMinSize; // Minimum size of an Option button + Size mOptionDividerSize; // Size of divider line std::vector 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. - Vector4 mPressedColor; // Color of the popup option when pressed. // 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 @@ -280,9 +303,13 @@ private: // Data std::size_t mCopyOptionPriority; // Position of Copy button std::size_t mPasteOptionPriority; // Position of Paste button std::size_t mClipboardOptionPriority; // Position of Clipboard button + float mFadeInDuration; // Duration of the animation to fade in the Popup + float mFadeOutDuration; // Duration of the animation to fade out the Popup bool mShowIcons:1; // Flag to show icons bool mShowCaptions:1; // Flag to show text captions + bool mPopupShowing:1; // Flag to indicate Popup showing + bool mButtonsChanged:1; // Flag to indicate the Popup Buttons have changed }; @@ -312,5 +339,5 @@ inline const Toolkit::Internal::TextSelectionPopup& GetImpl( const Toolkit::Text } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H__ +#endif // DALI_TOOLKIT_INTERNAL_TEXT_SELECTION_POPUP_H