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=db02721278224b883a60748d38d6f4a35e31f019;hp=61714e6eeb054eb4f8c7262a4d90affafd0bdef0;hb=1bc80454daa9e30655e4c4dec1784f6e9e5f496a;hpb=4be24b21c2acd28b5b14795afe57acbfdfd282ac diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 61714e6..db02721 100755 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -43,11 +43,13 @@ 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; //Forward declarations struct CursorInfo; struct FontDefaults; struct ControllerImplEventHandler; +struct SelectionHandleController; class SelectableControlInterface; @@ -108,7 +110,7 @@ struct EventData EventData( DecoratorPtr decorator, InputMethodContext& inputMethodContext ); - ~EventData(); + ~EventData() = default; static bool IsEditingState( State stateToCheck ) { @@ -173,7 +175,7 @@ struct EventData bool mPlaceholderEllipsisFlag : 1; ///< True if the text controller sets the placeholder ellipsis. bool mShiftSelectionFlag : 1; ///< True if the text selection using Shift key is enabled. bool mUpdateAlignment : 1; ///< True if the whole text needs to be full aligned.. - bool mEditingEnabled : 1; ///< True if the editing is enabled, false otherwise. + bool mEditingEnabled : 1; ///< True if the editing is enabled, false otherwise. }; struct ModifyEvent @@ -206,11 +208,11 @@ struct FontDefaults fontClient.GetDefaultPlatformFontDescription( mFontDescription ); } - FontId GetFontId( TextAbstraction::FontClient& fontClient ) + FontId GetFontId( TextAbstraction::FontClient& fontClient, float fontPointSize ) { if( !mFontId ) { - const PointSize26Dot6 pointSize = static_cast( mDefaultPointSize * 64.f ); + const PointSize26Dot6 pointSize = static_cast( fontPointSize * 64.f ); mFontId = fontClient.GetFontId( mFontDescription, pointSize ); } @@ -349,7 +351,8 @@ struct Controller::Impl mTextFitMinSize( DEFAULT_TEXTFIT_MIN ), mTextFitMaxSize( DEFAULT_TEXTFIT_MAX ), mTextFitStepSize( DEFAULT_TEXTFIT_STEP ), - mTextFitEnabled( false ) + mTextFitEnabled( false ), + mFontSizeScale( DEFAULT_FONT_SIZE_SCALE ) { mModel = Model::New(); @@ -612,21 +615,15 @@ struct Controller::Impl */ float GetDefaultFontLineHeight(); - void OnCursorKeyEvent( const Event& event ); - - void OnTapEvent( const Event& event ); - - void OnPanEvent( const Event& event ); - - void OnLongPressEvent( const Event& event ); - - void OnHandleEvent( const Event& event ); - - void OnSelectEvent( const Event& event ); - - void OnSelectAllEvent(); + /** + * @copydoc Text::Controller::GetPrimaryCursorPosition() + */ + CharacterIndex GetPrimaryCursorPosition() const; - void OnSelectNoneEvent(); + /** + * @copydoc Text::Controller::SetPrimaryCursorPosition() + */ + bool SetPrimaryCursorPosition( CharacterIndex index ); /** * @copydoc Text::SelectableControlInterface::SetTextSelectionRange() @@ -759,6 +756,11 @@ struct Controller::Impl void ScrollTextToMatchCursor( const CursorInfo& cursorInfo ); /** + * @brief Scrolls the text to make primary cursor visible. + */ + void ScrollTextToMatchCursor( ); + + /** * @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. @@ -828,9 +830,11 @@ public: 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 private: friend ControllerImplEventHandler; + friend SelectionHandleController; }; } // namespace Text