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-impl.h;h=814f3a834da53a4396a562997cfb7df289006d27;hp=55184ef39482567b4ffa3afdb9978bc0f5c336f0;hb=c039ebb7a115f5516aa792c1aa3bd6370e61acfd;hpb=0a6073b11b32d2153deb0e4a581a9314eef8ab10 diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 55184ef..814f3a8 100644 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -46,6 +46,7 @@ const float DEFAULT_FONT_SIZE_SCALE = 1.f; struct CursorInfo; struct FontDefaults; struct ControllerImplEventHandler; +struct ControllerImplModelUpdater; struct SelectionHandleController; class SelectableControlInterface; @@ -66,6 +67,7 @@ struct Event SELECT, SELECT_ALL, SELECT_NONE, + SELECT_RANGE, }; union Param @@ -115,12 +117,12 @@ struct EventData return (stateToCheck == EDITING || stateToCheck == EDITING_WITH_POPUP || stateToCheck == EDITING_WITH_GRAB_HANDLE || stateToCheck == EDITING_WITH_PASTE_POPUP); } - DecoratorPtr mDecorator; ///< Pointer to the decorator. - InputMethodContext mInputMethodContext; ///< The Input Method Framework Manager. - FontDefaults* mPlaceholderFont; ///< The placeholder default font. - std::string mPlaceholderTextActive; ///< The text to display when the TextField is empty with key-input focus. - std::string mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive. - Vector4 mPlaceholderTextColor; ///< The in/active placeholder text color. + DecoratorPtr mDecorator; ///< Pointer to the decorator. + InputMethodContext mInputMethodContext; ///< The Input Method Framework Manager. + std::unique_ptr mPlaceholderFont; ///< The placeholder default font. + std::string mPlaceholderTextActive; ///< The text to display when the TextField is empty with key-input focus. + std::string mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive. + Vector4 mPlaceholderTextColor; ///< The in/active placeholder text color. /** * This is used to delay handling events until after the model has been updated. @@ -355,7 +357,8 @@ struct Controller::Impl mTextFitMaxSize(DEFAULT_TEXTFIT_MAX), mTextFitStepSize(DEFAULT_TEXTFIT_STEP), mTextFitEnabled(false), - mFontSizeScale(DEFAULT_FONT_SIZE_SCALE) + mFontSizeScale(DEFAULT_FONT_SIZE_SCALE), + mIsLayoutDirectionChanged(false) { mModel = Model::New(); @@ -542,6 +545,11 @@ struct Controller::Impl } /** + * @copydoc Controller::GetLayoutDirection() + */ + Dali::LayoutDirection::Type GetLayoutDirection(Dali::Actor& actor) const; + + /** * @brief Calculates the start character index of the first paragraph to be updated and * the end character index of the last paragraph to be updated. * @@ -550,36 +558,6 @@ struct Controller::Impl void CalculateTextUpdateIndices(Length& numberOfCharacters); /** - * @brief Helper to clear completely the parts of the model specified by the given @p operations. - * - * @note It never clears the text stored in utf32. - */ - void ClearFullModelData(OperationsMask operations); - - /** - * @brief Helper to clear completely the parts of the model related with the characters specified by the given @p operations. - * - * @note It never clears the text stored in utf32. - * - * @param[in] startIndex Index to the first character to be cleared. - * @param[in] endIndex Index to the last character to be cleared. - * @param[in] operations The operations required. - */ - void ClearCharacterModelData(CharacterIndex startIndex, CharacterIndex endIndex, OperationsMask operations); - - /** - * @brief Helper to clear completely the parts of the model related with the glyphs specified by the given @p operations. - * - * @note It never clears the text stored in utf32. - * @note Character indices are transformed to glyph indices. - * - * @param[in] startIndex Index to the first character to be cleared. - * @param[in] endIndex Index to the last character to be cleared. - * @param[in] operations The operations required. - */ - void ClearGlyphModelData(CharacterIndex startIndex, CharacterIndex endIndex, OperationsMask operations); - - /** * @brief Helper to clear the parts of the model specified by the given @p operations and from @p startIndex to @p endIndex. * * @note It never clears the text stored in utf32. @@ -617,6 +595,16 @@ struct Controller::Impl float GetDefaultFontLineHeight(); /** + * @copydoc Controller::SetDefaultLineSpacing + */ + bool SetDefaultLineSpacing(float lineSpacing); + + /** + * @copydoc Controller::SetDefaultLineSize + */ + bool SetDefaultLineSize(float lineSize); + + /** * @copydoc Text::Controller::GetPrimaryCursorPosition() */ CharacterIndex GetPrimaryCursorPosition() const; @@ -624,7 +612,7 @@ struct Controller::Impl /** * @copydoc Text::Controller::SetPrimaryCursorPosition() */ - bool SetPrimaryCursorPosition(CharacterIndex index); + bool SetPrimaryCursorPosition(CharacterIndex index, bool focused); /** * @copydoc Text::SelectableControlInterface::SetTextSelectionRange() @@ -647,6 +635,11 @@ struct Controller::Impl void SetEditable(bool editable); /** + * @copydoc Controller::UpdateAfterFontChange + */ + void UpdateAfterFontChange(const std::string& newDefaultFont); + + /** * @brief Retrieves the selected text. It removes the text if the @p deleteAfterRetrieval parameter is @e true. * * @param[out] selectedText The selected text encoded in utf8. @@ -768,6 +761,86 @@ struct Controller::Impl */ Actor CreateBackgroundActor(); + /** + * @brief fill needed relayout parameters when line size is changed & request relayout. + */ + void RelayoutForNewLineSize(); + + /** + * @copydoc Controller::IsInputStyleChangedSignalsQueueEmpty + */ + bool IsInputStyleChangedSignalsQueueEmpty(); + + /** + * @copydoc Controller::ProcessInputStyleChangedSignals + */ + void ProcessInputStyleChangedSignals(); + + /** + * @copydoc Controller::ScrollBy() + */ + void ScrollBy(Vector2 scroll); + + /** + * @copydoc Controller::GetHorizontalScrollPosition() + */ + float GetHorizontalScrollPosition(); + + /** + * @copydoc Controller::GetVerticalScrollPosition() + */ + float GetVerticalScrollPosition(); + + /** + * @copydoc Controller::SetAutoScrollEnabled() + */ + void SetAutoScrollEnabled(bool enable); + + /** + * @copydoc Controller::SetEnableCursorBlink() + */ + void SetEnableCursorBlink(bool enable); + + /** + * @copydoc Controller::SetMultiLineEnabled() + */ + void SetMultiLineEnabled(bool enable); + + /** + * @copydoc Controller::SetHorizontalAlignment() + */ + void SetHorizontalAlignment(HorizontalAlignment::Type alignment); + + /** + * @copydoc Controller::SetVerticalAlignment() + */ + void SetVerticalAlignment(VerticalAlignment::Type alignment); + + /** + * @copydoc Controller::SetLineWrapMode() + */ + void SetLineWrapMode(Text::LineWrap::Mode textWarpMode); + + /** + * @copydoc Controller::SetDefaultColor() + */ + void SetDefaultColor(const Vector4& color); + + /** + * @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(); + public: /** * @brief Gets implementation from the controller handle. @@ -834,14 +907,17 @@ public: Shader mShaderBackground; ///< The shader for text background. - float mTextFitMinSize; ///< Minimum Font Size for text fit. Default 10 - float mTextFitMaxSize; ///< Maximum Font Size for text fit. Default 100 - float mTextFitStepSize; ///< Step Size for font intervalse. Default 1 - bool mTextFitEnabled : 1; ///< Whether the text's fit is enabled. - float mFontSizeScale; ///< Scale value for Font Size. Default 1.0 + float mTextFitMinSize; ///< Minimum Font Size for text fit. Default 10 + float mTextFitMaxSize; ///< Maximum Font Size for text fit. Default 100 + float mTextFitStepSize; ///< Step Size for font intervalse. Default 1 + bool mTextFitEnabled : 1; ///< Whether the text's fit is enabled. + float mTextFitChanged; ///< Whether the text fit property has changed. + float mFontSizeScale; ///< Scale value for Font Size. Default 1.0 + bool mIsLayoutDirectionChanged : 1; ///< Whether the layout has changed. private: friend ControllerImplEventHandler; + friend ControllerImplModelUpdater; friend SelectionHandleController; };