X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.h;h=54444b186d74cc01c6df6008238c3719d4f1027c;hp=c7a549e7ce7e777c51600d424cc85c64de2d6af5;hb=d48e9b8b161367ad699c0352dfeb0128832bbe59;hpb=cb3691d010da3297946e5b92bcd1a43c38d414fe diff --git a/dali-toolkit/internal/text/text-controller.h b/dali-toolkit/internal/text/text-controller.h index c7a549e..54444b1 100755 --- a/dali-toolkit/internal/text/text-controller.h +++ b/dali-toolkit/internal/text/text-controller.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_TEXT_CONTROLLER_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -31,6 +31,7 @@ #include #include #include +#include namespace Dali { @@ -187,11 +188,13 @@ public: // Constructor. * * @param[in] controlInterface The control's interface. * @param[in] editableControlInterface The editable control's interface. + * @param[in] selectableControlInterface The selectable control's interface. * * @return A pointer to a new Controller. */ static ControllerPtr New( ControlInterface* controlInterface, - EditableControlInterface* editableControlInterface ); + EditableControlInterface* editableControlInterface, + SelectableControlInterface* selectableControlInterface ); public: // Configure the text controller. @@ -1470,7 +1473,7 @@ public: // Text-input Event Queuing. * @param[in] state The state of the gesture. * @param[in] displacement This distance panned since the last pan gesture. */ - void PanEvent( Gesture::State state, const Vector2& displacement ); + void PanEvent( GestureState state, const Vector2& displacement ); /** * @brief Called by editable UI controls when a long press gesture occurs. @@ -1479,7 +1482,7 @@ public: // Text-input Event Queuing. * @param[in] x The x position relative to the top-left of the parent control. * @param[in] y The y position relative to the top-left of the parent control. */ - void LongPressEvent( Gesture::State state, float x, float y ); + void LongPressEvent( GestureState state, float x, float y ); /** * @brief Creates a selection event. @@ -1493,6 +1496,41 @@ public: // Text-input Event Queuing. void SelectEvent( float x, float y, SelectionType selection ); /** + * @copydoc Text::SelectableControlInterface::SetTextSelectionRange() + */ + void SetTextSelectionRange(const uint32_t *start, const uint32_t *end); + + /** + * @copydoc Text::SelectableControlInterface::GetTextSelectionRange() + */ + Uint32Pair GetTextSelectionRange() const; + + /** + * @copydoc Text::SelectableControlInterface::SelectWholeText() + */ + void SelectWholeText(); + + /** + * @copydoc Text::SelectableControlInterface::SelectNone() + */ + void SelectNone(); + + /** + * @copydoc Text::SelectableControlInterface::GetSelectedText() + */ + string GetSelectedText() const; + + /** + * @copydoc Text::EditableControlInterface::IsEditable() + */ + virtual bool IsEditable() const; + + /** + * @copydoc Text::EditableControlInterface::SetEditable() + */ + virtual void SetEditable( bool editable ); + + /** * @brief Event received from input method context * * @param[in] inputMethodContext The input method context. @@ -1520,43 +1558,36 @@ public: // Text-input Event Queuing. */ Actor CreateBackgroundActor(); - /** - * @brief Retrive Selected text. - * - * @return The seleced text. - */ - std::string GetSelectedText(); - protected: // Inherit from Text::Decorator::ControllerInterface. /** * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::GetTargetSize() */ - virtual void GetTargetSize( Vector2& targetSize ); + void GetTargetSize( Vector2& targetSize ) override; /** * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::AddDecoration() */ - virtual void AddDecoration( Actor& actor, bool needsClipping ); + void AddDecoration( Actor& actor, bool needsClipping ) override; /** * @copydoc Dali::Toolkit::Text::Decorator::ControllerInterface::DecorationEvent() */ - virtual void DecorationEvent( HandleType handle, HandleState state, float x, float y ); + void DecorationEvent( HandleType handle, HandleState state, float x, float y ) override; protected: // Inherit from TextSelectionPopup::TextPopupButtonCallbackInterface. /** * @copydoc Dali::Toolkit::TextSelectionPopup::TextPopupButtonCallbackInterface::TextPopupButtonTouched() */ - virtual void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button ); + void TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button ) override; protected: // Inherit from HiddenText. /** * @brief Invoked from HiddenText when showing time of the last character was expired */ - virtual void DisplayTimeExpired(); + void DisplayTimeExpired() override; private: // Update. @@ -1698,7 +1729,8 @@ private: // Private contructors & copy operator. * @brief Private constructor. */ Controller( ControlInterface* controlInterface, - EditableControlInterface* editableControlInterface ); + EditableControlInterface* editableControlInterface, + SelectableControlInterface* selectableControlInterface ); // Undefined Controller( const Controller& handle ); @@ -1719,6 +1751,10 @@ public: private: + struct EventHandler; + struct InputFontHandler; + struct PlaceholderHandler; + Impl* mImpl; };