X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-label-impl.h;h=87a80e0241d0a81ae40209d98c5b503e97c7908c;hp=926128eb05bf86b0b7b59b4bae39bba406baf7b1;hb=9ddd5fea6278d06b8874988498c7c4c6508750ba;hpb=f2039d47f9bed8104575da80a2ecf0bb6e37ff8d diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.h b/dali-toolkit/internal/controls/text-controls/text-label-impl.h index 926128e..87a80e0 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_TEXT_LABEL_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,33 +22,28 @@ #include // INTERNAL INCLUDES -#include -#include +#include +#include #include #include #include -#include #include #include -#include - +#include +#include namespace Dali { - namespace Toolkit { - namespace Internal { - /** * @brief A control which renders a short text string. */ class TextLabel : public Control, public Text::ControlInterface, public Text::ScrollerInterface { public: - /** * @copydoc Dali::Toollkit::TextLabel::New() */ @@ -63,7 +58,7 @@ public: * @param[in] index The property index. * @param[in] value The new property value. */ - static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value ); + static void SetProperty(BaseObject* object, Property::Index index, const Property::Value& value); /** * @brief Called to retrieve a property of an object of this type. @@ -72,12 +67,11 @@ public: * @param[in] index The property index. * @return The current value of the property. */ - static Property::Value GetProperty( BaseObject* object, Property::Index index ); + static Property::Value GetProperty(BaseObject* object, Property::Index index); Text::ControllerPtr getController(); private: // From Control - /** * @copydoc Control::OnInitialize() */ @@ -86,12 +80,12 @@ private: // From Control /** * @copydoc Control::OnStyleChange() */ - void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change ) override; + void OnStyleChange(Toolkit::StyleManager styleManager, StyleChange::Type change) override; /** * @copydoc Control::OnRelayout() */ - void OnRelayout( const Vector2& size, RelayoutContainer& container ) override; + void OnRelayout(const Vector2& size, RelayoutContainer& container) override; /** * @copydoc Control::GetNaturalSize() @@ -101,12 +95,12 @@ private: // From Control /** * @copydoc Control::GetHeightForWidth() */ - float GetHeightForWidth( float width ) override; + float GetHeightForWidth(float width) override; /** * @copydoc Control::OnPropertySet() */ - void OnPropertySet( Property::Index index, const Property::Value& propertyValue ) override ; + void OnPropertySet(Property::Index index, const Property::Value& propertyValue) override; // From ControlInterface @@ -116,14 +110,12 @@ private: // From Control void RequestTextRelayout() override; private: // from TextScroller - /** * @copydoc Text::ScrollerInterface::ScrollingFinished() */ void ScrollingFinished() override; private: // Implementation - /** * Construct a new TextLabel. */ @@ -135,7 +127,6 @@ private: // Implementation virtual ~TextLabel(); private: - // Undefined copy constructor and assignment operators TextLabel(const TextLabel&); TextLabel& operator=(const TextLabel& rhs); @@ -151,22 +142,21 @@ private: */ Text::TextScrollerPtr GetTextScroller() { - if( !mTextScroller ) + if(!mTextScroller) { - mTextScroller = Text::TextScroller::New( *this ); + mTextScroller = Text::TextScroller::New(*this); } return mTextScroller; } private: // Data - - Text::ControllerPtr mController; + Text::ControllerPtr mController; Text::TextScrollerPtr mTextScroller; Toolkit::Visual::Base mVisual; - int mRenderingBackend; - bool mTextUpdateNeeded:1; + int mRenderingBackend; + bool mTextUpdateNeeded : 1; protected: struct AccessibleImpl : public Control::Impl::AccessibleImpl, @@ -174,19 +164,16 @@ protected: { using Control::Impl::AccessibleImpl::AccessibleImpl; - std::string GetText( size_t startOffset, size_t endOffset ) override; - size_t GetCharacterCount() override; - size_t GetCaretOffset() override; - bool SetCaretOffset(size_t offset) override; - Dali::Accessibility::Range - GetTextAtOffset( size_t offset, - Dali::Accessibility::TextBoundary boundary ) override; - Dali::Accessibility::Range GetSelection( size_t selectionNum ) override; - bool RemoveSelection( size_t selectionNum ) override; - bool SetSelection( size_t selectionNum, size_t startOffset, - size_t endOffset ) override; - std::string GetNameRaw() override; - Property::Index GetNamePropertyIndex() override; + std::string GetText(size_t startOffset, size_t endOffset) override; + size_t GetCharacterCount() override; + size_t GetCaretOffset() override; + bool SetCaretOffset(size_t offset) override; + Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) override; + Accessibility::Range GetSelection(size_t selectionNum) override; + bool RemoveSelection(size_t selectionNum) override; + bool SetSelection(size_t selectionNum, size_t startOffset, size_t endOffset) override; + std::string GetNameRaw() override; + Property::Index GetNamePropertyIndex() override; }; }; @@ -194,7 +181,7 @@ protected: // Helpers for public-api forwarding methods -inline Toolkit::Internal::TextLabel& GetImpl( Toolkit::TextLabel& textLabel ) +inline Toolkit::Internal::TextLabel& GetImpl(Toolkit::TextLabel& textLabel) { DALI_ASSERT_ALWAYS(textLabel); @@ -203,7 +190,7 @@ inline Toolkit::Internal::TextLabel& GetImpl( Toolkit::TextLabel& textLabel ) return static_cast(handle); } -inline const Toolkit::Internal::TextLabel& GetImpl( const Toolkit::TextLabel& textLabel ) +inline const Toolkit::Internal::TextLabel& GetImpl(const Toolkit::TextLabel& textLabel) { DALI_ASSERT_ALWAYS(textLabel);