X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-impl.h;h=59440393baa97aa8421d5484a9aedbe86716a9cf;hb=73949ef40f8dbe1e9661ae33e2f7765c93f0b25a;hp=92235b0039f8b630412cfccc7a91587d985b7413;hpb=0231146907c21e934102222180a1a94b36ba0e65;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 92235b0..5944039 100644 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -41,6 +41,7 @@ const float DEFAULT_TEXTFIT_MIN = 10.f; const float DEFAULT_TEXTFIT_MAX = 100.f; const float DEFAULT_TEXTFIT_STEP = 1.f; const float DEFAULT_FONT_SIZE_SCALE = 1.f; +const float DEFAULT_DISABLED_COLOR_OPACITY = 0.3f; //Forward declarations struct CursorInfo; @@ -351,16 +352,19 @@ struct Controller::Impl mShadowSetByString(false), mOutlineSetByString(false), mFontStyleSetByString(false), + mStrikethroughSetByString(false), mShouldClearFocusOnEscape(true), mLayoutDirection(LayoutDirection::LEFT_TO_RIGHT), mTextFitMinSize(DEFAULT_TEXTFIT_MIN), mTextFitMaxSize(DEFAULT_TEXTFIT_MAX), mTextFitStepSize(DEFAULT_TEXTFIT_STEP), mFontSizeScale(DEFAULT_FONT_SIZE_SCALE), + mDisabledColorOpacity(DEFAULT_DISABLED_COLOR_OPACITY), mFontSizeScaleEnabled(true), mTextFitEnabled(false), mTextFitChanged(false), - mIsLayoutDirectionChanged(false) + mIsLayoutDirectionChanged(false), + mIsUserInteractionEnabled(true) { mModel = Model::New(); @@ -368,6 +372,7 @@ struct Controller::Impl mClipboard = Clipboard::Get(); mView.SetVisualModel(mModel->mVisualModel); + mView.SetLogicalModel(mModel->mLogicalModel); // Use this to access FontClient i.e. to get down-scaled Emoji metrics. mMetrics = Metrics::New(mFontClient); @@ -625,6 +630,16 @@ struct Controller::Impl bool SetDefaultLineSize(float lineSize); /** + * @copydoc Controller::SetRelativeLineSize + */ + bool SetRelativeLineSize(float relativeLineSize); + + /** + * @copydoc Controller::GetRelativeLineSize + */ + float GetRelativeLineSize(); + + /** * @copydoc Text::Controller::GetPrimaryCursorPosition() */ CharacterIndex GetPrimaryCursorPosition() const; @@ -790,9 +805,16 @@ struct Controller::Impl void ScrollTextToMatchCursor(); /** - * @brief fill needed relayout parameters when line size is changed & request relayout. + * @brief Create an actor that renders the text background color + * + * @return the created actor or an empty handle if no background color needs to be rendered. */ - void RelayoutForNewLineSize(); + Actor CreateBackgroundActor(); + + /** + * @brief fill needed relayout parameters whenever a property is changed and a re-layout is needed for the entire text. + */ + void RelayoutAllCharacters(); /** * @copydoc Controller::IsInputStyleChangedSignalsQueueEmpty @@ -855,6 +877,11 @@ struct Controller::Impl void SetDefaultColor(const Vector4& color); /** + * @copydoc Controller::SetUserInteractionEnabled() + */ + void SetUserInteractionEnabled(bool enabled); + + /** * @brief Helper to clear font-specific data (only). */ void ClearFontData(); @@ -936,6 +963,18 @@ private: */ void CopyUnderlinedFromLogicalToVisualModels(bool shouldClearPreUnderlineRuns); + /** + * @brief Copy strikethrough-Character-Runs from Logical-Model to strikethrough-Glyph-Runs in Visual-Model + * + */ + void CopyStrikethroughFromLogicalToVisualModels(); + + /** + * @brief Copy CharacterSpacing-Character-Runs from Logical-Model to CharacterSpacing-Glyph-Runs in Visual-Model + * + */ + void CopyCharacterSpacingFromLogicalToVisualModels(); + public: ControlInterface* mControlInterface; ///< Reference to the text controller. EditableControlInterface* mEditableControlInterface; ///< Reference to the editable text controller. @@ -973,6 +1012,7 @@ public: bool mShadowSetByString : 1; ///< Set when shadow is set by string (legacy) instead of map bool mOutlineSetByString : 1; ///< Set when outline is set by string (legacy) instead of map bool mFontStyleSetByString : 1; ///< Set when font style is set by string (legacy) instead of map + bool mStrikethroughSetByString : 1; ///< Set when strikethrough is set by string (legacy) instead of map bool mShouldClearFocusOnEscape : 1; ///< Whether text control should clear key input focus LayoutDirection::Type mLayoutDirection; ///< Current system language direction @@ -982,10 +1022,12 @@ public: float mTextFitMaxSize; ///< Maximum Font Size for text fit. Default 100 float mTextFitStepSize; ///< Step Size for font intervalse. Default 1 float mFontSizeScale; ///< Scale value for Font Size. Default 1.0 + float mDisabledColorOpacity; ///< Color opacity when disabled. bool mFontSizeScaleEnabled : 1; ///< Whether the font size scale is enabled. bool mTextFitEnabled : 1; ///< Whether the text's fit is enabled. bool mTextFitChanged : 1; ///< Whether the text fit property has changed. bool mIsLayoutDirectionChanged : 1; ///< Whether the layout has changed. + bool mIsUserInteractionEnabled : 1; ///< Whether the user interaction is enabled. private: friend ControllerImplEventHandler;