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=7eaf5eef19358aae00e0a6c8ac6125dc99925c95;hp=0757bc0488621f94c8596c1e8d65cb6f32eabe03;hb=c427acac5f2616578c05987c99e7b430c9ab0137;hpb=f040ee74bc71aad84339b672e5aec6247fdf189e diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 0757bc0..7eaf5ee 100644 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -37,10 +37,11 @@ namespace Toolkit { namespace Text { -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_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; @@ -345,6 +346,7 @@ struct Controller::Impl mMarkupProcessorEnabled(false), mClipboardHideEnabled(true), mIsAutoScrollEnabled(false), + mIsAutoScrollMaxTextureExceeded(false), mUpdateTextDirection(true), mIsTextDirectionRTL(false), mUnderlineSetByString(false), @@ -358,10 +360,12 @@ struct Controller::Impl 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(); @@ -382,12 +386,11 @@ struct Controller::Impl Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get(); if(styleManager) { - bool temp; - Property::Map config = Toolkit::DevelStyleManager::GetConfigurations(styleManager); - if(config["clearFocusOnEscape"].Get(temp)) - { - mShouldClearFocusOnEscape = temp; - } + const Property::Map& config = Toolkit::DevelStyleManager::GetConfigurations(styleManager); + const auto clearFocusOnEscapeValue = config.Find("clearFocusOnEscape", Property::Type::BOOLEAN); + + // Default is true. If config don't have "clearFocusOnEscape" property, make it true. + mShouldClearFocusOnEscape = (!clearFocusOnEscapeValue || clearFocusOnEscapeValue->Get()); } } @@ -874,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(); @@ -961,6 +969,12 @@ private: */ 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. @@ -987,12 +1001,13 @@ public: std::unique_ptr mInputFilter; ///< Avoid allocating this when the user does not specify input filter mode. Vector2 mTextFitContentSize; ///< Size of Text fit content - bool mRecalculateNaturalSize : 1; ///< Whether the natural size needs to be recalculated. - bool mMarkupProcessorEnabled : 1; ///< Whether the mark-up procesor is enabled. - bool mClipboardHideEnabled : 1; ///< Whether the ClipboardHide function work or not - bool mIsAutoScrollEnabled : 1; ///< Whether auto text scrolling is enabled. - bool mUpdateTextDirection : 1; ///< Whether the text direction needs to be updated. - CharacterDirection mIsTextDirectionRTL : 1; ///< Whether the text direction is right to left or not + bool mRecalculateNaturalSize : 1; ///< Whether the natural size needs to be recalculated. + bool mMarkupProcessorEnabled : 1; ///< Whether the mark-up procesor is enabled. + bool mClipboardHideEnabled : 1; ///< Whether the ClipboardHide function work or not + bool mIsAutoScrollEnabled : 1; ///< Whether auto text scrolling is enabled. + bool mIsAutoScrollMaxTextureExceeded : 1; ///< Whether auto text scrolling is exceed max texture size. + bool mUpdateTextDirection : 1; ///< Whether the text direction needs to be updated. + CharacterDirection mIsTextDirectionRTL : 1; ///< Whether the text direction is right to left or not bool mUnderlineSetByString : 1; ///< Set when underline is set by string (legacy) instead of map bool mShadowSetByString : 1; ///< Set when shadow is set by string (legacy) instead of map @@ -1008,10 +1023,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;