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=02fbff8fe3c56b343f6ba1f0bde5fa75b31f2f3d;hp=ef4bb69c239f3ea00ab4af138320551a87774c16;hb=2daa5af9afa208c6e58b5a69ff304b513777aa63;hpb=64b92adb4035ab57f5ad265e0676a8ca8a23c64b diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index ef4bb69..02fbff8 100644 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -66,6 +66,7 @@ struct Event SELECT, SELECT_ALL, SELECT_NONE, + SELECT_RANGE, }; union Param @@ -115,12 +116,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. @@ -338,6 +339,7 @@ struct Controller::Impl mOperationsPending(NO_OPERATION), mMaximumNumberOfCharacters(50u), mHiddenInput(NULL), + mInputFilter(nullptr), mRecalculateNaturalSize(true), mMarkupProcessorEnabled(false), mClipboardHideEnabled(true), @@ -354,7 +356,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(); @@ -386,7 +389,6 @@ struct Controller::Impl ~Impl() { delete mHiddenInput; - delete mFontDefaults; delete mUnderlineDefaults; delete mShadowDefaults; @@ -624,7 +626,7 @@ struct Controller::Impl /** * @copydoc Text::Controller::SetPrimaryCursorPosition() */ - bool SetPrimaryCursorPosition(CharacterIndex index); + bool SetPrimaryCursorPosition(CharacterIndex index, bool focused); /** * @copydoc Text::SelectableControlInterface::SetTextSelectionRange() @@ -785,30 +787,38 @@ private: // Declared private and left undefined to avoid copies. Impl& operator=(const Impl&); + /** + * @brief Copy Underlined-Character-Runs from Logical-Model to Underlined-Glyph-Runs in Visual-Model + * + * @param shouldClearPreUnderlineRuns Whether should clear the existing Underlined-Glyph-Runs in Visual-Model + */ + void CopyUnderlinedFromLogicalToVisualModels(bool shouldClearPreUnderlineRuns); + public: - ControlInterface* mControlInterface; ///< Reference to the text controller. - EditableControlInterface* mEditableControlInterface; ///< Reference to the editable text controller. - SelectableControlInterface* mSelectableControlInterface; ///< Reference to the selectable text controller. - AnchorControlInterface* mAnchorControlInterface; ///< Reference to the anchor controller. - ModelPtr mModel; ///< Pointer to the text's model. - FontDefaults* mFontDefaults; ///< Avoid allocating this when the user does not specify a font. - UnderlineDefaults* mUnderlineDefaults; ///< Avoid allocating this when the user does not specify underline parameters. - ShadowDefaults* mShadowDefaults; ///< Avoid allocating this when the user does not specify shadow parameters. - EmbossDefaults* mEmbossDefaults; ///< Avoid allocating this when the user does not specify emboss parameters. - OutlineDefaults* mOutlineDefaults; ///< Avoid allocating this when the user does not specify outline parameters. - EventData* mEventData; ///< Avoid allocating everything for text input until EnableTextInput(). - TextAbstraction::FontClient mFontClient; ///< Handle to the font client. - Clipboard mClipboard; ///< Handle to the system clipboard - View mView; ///< The view interface to the rendering back-end. - MetricsPtr mMetrics; ///< A wrapper around FontClient used to get metrics & potentially down-scaled Emoji metrics. - Layout::Engine mLayoutEngine; ///< The layout engine. - Vector mModifyEvents; ///< Temporary stores the text set until the next relayout. - Vector4 mTextColor; ///< The regular text color - TextUpdateInfo mTextUpdateInfo; ///< Info of the characters updated. - OperationsMask mOperationsPending; ///< Operations pending to be done to layout the text. - Length mMaximumNumberOfCharacters; ///< Maximum number of characters that can be inserted. - HiddenText* mHiddenInput; ///< Avoid allocating this when the user does not specify hidden input mode. - Vector2 mTextFitContentSize; ///< Size of Text fit content + ControlInterface* mControlInterface; ///< Reference to the text controller. + EditableControlInterface* mEditableControlInterface; ///< Reference to the editable text controller. + SelectableControlInterface* mSelectableControlInterface; ///< Reference to the selectable text controller. + AnchorControlInterface* mAnchorControlInterface; ///< Reference to the anchor controller. + ModelPtr mModel; ///< Pointer to the text's model. + FontDefaults* mFontDefaults; ///< Avoid allocating this when the user does not specify a font. + UnderlineDefaults* mUnderlineDefaults; ///< Avoid allocating this when the user does not specify underline parameters. + ShadowDefaults* mShadowDefaults; ///< Avoid allocating this when the user does not specify shadow parameters. + EmbossDefaults* mEmbossDefaults; ///< Avoid allocating this when the user does not specify emboss parameters. + OutlineDefaults* mOutlineDefaults; ///< Avoid allocating this when the user does not specify outline parameters. + EventData* mEventData; ///< Avoid allocating everything for text input until EnableTextInput(). + TextAbstraction::FontClient mFontClient; ///< Handle to the font client. + Clipboard mClipboard; ///< Handle to the system clipboard + View mView; ///< The view interface to the rendering back-end. + MetricsPtr mMetrics; ///< A wrapper around FontClient used to get metrics & potentially down-scaled Emoji metrics. + Layout::Engine mLayoutEngine; ///< The layout engine. + Vector mModifyEvents; ///< Temporary stores the text set until the next relayout. + Vector4 mTextColor; ///< The regular text color + TextUpdateInfo mTextUpdateInfo; ///< Info of the characters updated. + OperationsMask mOperationsPending; ///< Operations pending to be done to layout the text. + Length mMaximumNumberOfCharacters; ///< Maximum number of characters that can be inserted. + HiddenText* mHiddenInput; ///< Avoid allocating this when the user does not specify hidden input mode. + 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. @@ -826,11 +836,12 @@ 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 mFontSizeScale; ///< Scale value for Font Size. Default 1.0 + bool mIsLayoutDirectionChanged : 1; ///< Whether the layout has changed. private: friend ControllerImplEventHandler;