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=e86aed83911bb38a7dd313f2a069189665b53351;hp=0c6297f3383dba4eaf04e6571dd35eb688d6e6cc;hb=547d191030012ab8ba687cba368cb32a6f2d0ec2;hpb=e8a0d6cffda02a66a542fe89240fb41bc7c08215 diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 0c6297f..e86aed8 100644 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -356,8 +356,9 @@ struct Controller::Impl mTextFitMinSize(DEFAULT_TEXTFIT_MIN), mTextFitMaxSize(DEFAULT_TEXTFIT_MAX), mTextFitStepSize(DEFAULT_TEXTFIT_STEP), - mTextFitEnabled(false), mFontSizeScale(DEFAULT_FONT_SIZE_SCALE), + mTextFitEnabled(false), + mTextFitChanged(false), mIsLayoutDirectionChanged(false) { mModel = Model::New(); @@ -545,6 +546,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. * @@ -553,36 +559,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. @@ -620,6 +596,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; @@ -650,6 +636,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. @@ -771,6 +762,129 @@ 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(); + + /** + * @brief Resets a provided vector with actors that marks the position of anchors in markup enabled text + * + * @param[out] anchorActors the vector of actor (empty collection if no anchors available). + */ + void GetAnchorActors(std::vector& anchorActors); + + /** + * @brief Return an index of first anchor in the anchor vector whose boundaries includes given character offset + * + * @param[in] characterOffset A position in text coords. + * + * @return the 0-based index in anchor vector (-1 if an anchor not found) + */ + int32_t GetAnchorIndex(size_t characterOffset) const; + + /** + * @brief Return the geometrical position of an anchor relative to the parent origin point. + * + * @param[in] anchor An anchor. + * + * @return The x, y, z coordinates of an anchor. + */ + Vector3 GetAnchorPosition(Anchor anchor) const; + + /** + * @brief Return the size of an anchor expresed as a vector containing anchor's width and height. + * + * @param[in] anchor An anchor. + * + * @return The width and height of an anchor. + */ + Vector2 GetAnchorSize(Anchor anchor) const; + + /** + * @brief Return the actor representing an anchor. + * + * @param[in] anchor An anchor. + * + * @return The actor representing an anchor. + */ + Toolkit::TextAnchor CreateAnchorActor(Anchor anchor); + public: /** * @brief Gets implementation from the controller handle. @@ -840,8 +954,9 @@ public: 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 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. private: