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=a5bc8b48ac429805274f332723e2bf557d127da8;hp=109be1ab276aa53bd73830960bd781a01fc55ee8;hb=c039ebb7a115f5516aa792c1aa3bd6370e61acfd;hpb=ac95292b53ca62c34114cde6e78e8595909bcb9c diff --git a/dali-toolkit/internal/text/text-controller.h b/dali-toolkit/internal/text/text-controller.h index 109be1a..a5bc8b4 100644 --- a/dali-toolkit/internal/text/text-controller.h +++ b/dali-toolkit/internal/text/text-controller.h @@ -35,11 +35,7 @@ #include #include -namespace Dali -{ -namespace Toolkit -{ -namespace Text +namespace Dali::Toolkit::Text { class Controller; class ControlInterface; @@ -170,7 +166,10 @@ public: // Constructor. * * @return A pointer to a new Controller. */ - static ControllerPtr New(); + static ControllerPtr New() + { + return ControllerPtr(new Controller()); + } /** * @brief Create a new instance of a Controller. @@ -179,7 +178,10 @@ public: // Constructor. * * @return A pointer to a new Controller. */ - static ControllerPtr New(ControlInterface* controlInterface); + static ControllerPtr New(ControlInterface* controlInterface) + { + return ControllerPtr(new Controller(controlInterface)); + } /** * @brief Create a new instance of a Controller. @@ -194,7 +196,13 @@ public: // Constructor. static ControllerPtr New(ControlInterface* controlInterface, EditableControlInterface* editableControlInterface, SelectableControlInterface* selectableControlInterface, - AnchorControlInterface* anchorControlInterface); + AnchorControlInterface* anchorControlInterface) + { + return ControllerPtr(new Controller(controlInterface, + editableControlInterface, + selectableControlInterface, + anchorControlInterface)); + } public: // Configure the text controller. /** @@ -474,6 +482,27 @@ public: // Configure the text controller. Vector2 GetTextFitContentSize() const; /** + * @brief Retrieve the fited point size. + * + * @return The fited point size. + */ + float GetTextFitPointSize() const; + + /** + * @brief Sets whether the text fit properties have changed. + * + * @param[in] changed Whether to changed the text fit. + */ + void SetTextFitChanged(bool changed); + + /** + * @brief Whether the text fit properties are changed or not. + * + * @return True if the text fit properties are changed + */ + bool IsTextFitChanged() const; + + /** * @brief Enable or disable the placeholder text elide. * @param enabled Whether to enable the placeholder text elide. */ @@ -1633,6 +1662,21 @@ public: // Text-input Event Queuing. void SelectWholeText(); /** + * @copydoc Text::EditableControlInterface::CopyText() + */ + string CopyText(); + + /** + * @copydoc Text::EditableControlInterface::CutText() + */ + string CutText(); + + /** + * @copydoc Text::EditableControlInterface::PasteText() + */ + void PasteText(); + + /** * @copydoc Text::SelectableControlInterface::SelectNone() */ void SelectNone(); @@ -1751,8 +1795,7 @@ private: // Update. void InsertText(const std::string& text, InsertType type); /** - * @brief Paste given string into Text model - * @param[in] stringToPaste this string will be inserted into the text model + * @copydoc Text::EditableControlInterface::PasteText() */ void PasteText(const std::string& stringToPaste); @@ -1859,36 +1902,22 @@ private: // Helpers. */ void ShowPlaceholderText(); - /** - * @brief Helper to clear font-specific data (only). - */ - void ClearFontData(); - - /** - * @brief Helper to clear text's style data. - */ - void ClearStyleData(); - - /** - * @brief Used to reset the scroll position after setting a new text. - */ - void ResetScrollPosition(); - - /** - * @brief fill needed relayout parameters when line size is changed & request relayout. - */ - void RelayoutForNewLineSize(); - private: // Private contructors & copy operator. /** * @brief Private constructor. */ - Controller(); + Controller() + : Controller(nullptr, nullptr, nullptr, nullptr) + { + } /** * @brief Private constructor. */ - Controller(ControlInterface* controlInterface); + Controller(ControlInterface* controlInterface) + : Controller(controlInterface, nullptr, nullptr, nullptr) + { + } /** * @brief Private constructor. @@ -1898,11 +1927,8 @@ private: // Private contructors & copy operator. SelectableControlInterface* selectableControlInterface, AnchorControlInterface* anchorControlInterface); - // Undefined - Controller(const Controller& handle); - - // Undefined - Controller& operator=(const Controller& handle); + Controller(const Controller& handle) = delete; + Controller& operator=(const Controller& handle) = delete; protected: // Destructor. /** @@ -1916,6 +1942,7 @@ public: private: struct EventHandler; struct InputFontHandler; + struct InputProperties; struct PlaceholderHandler; struct Relayouter; struct TextUpdater; @@ -1923,10 +1950,6 @@ private: Impl* mImpl; }; -} // namespace Text - -} // namespace Toolkit - -} // namespace Dali +} // namespace Dali::Toolkit::Text #endif // DALI_TOOLKIT_TEXT_CONTROLLER_H