X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fflex-container%2Fflex-container-impl.h;h=ab57f61f44d3b8457aa8237bad0e597aedbd34c4;hb=91a31a5bdf35ebea5818c3809467b6fb74a547a2;hp=2005f9cb5af8988dbf5c9cb7d911c8264701ad58;hpb=aab8149131bede35560a96a8f69611433fc854fc;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/flex-container/flex-container-impl.h b/dali-toolkit/internal/controls/flex-container/flex-container-impl.h index 2005f9c..ab57f61 100644 --- a/dali-toolkit/internal/controls/flex-container/flex-container-impl.h +++ b/dali-toolkit/internal/controls/flex-container/flex-container-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_FLEX_CONTAINER_H__ -#define __DALI_TOOLKIT_INTERNAL_FLEX_CONTAINER_H__ +#ifndef DALI_TOOLKIT_INTERNAL_FLEX_CONTAINER_H +#define DALI_TOOLKIT_INTERNAL_FLEX_CONTAINER_H /* - * Copyright (c) 2016 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. @@ -19,46 +19,38 @@ */ // EXTERNAL INCLUDES -#include +#include // INTERNAL INCLUDES #include #include -extern "C" -{ -#include "layout.h" -} +#include namespace Dali { - namespace Toolkit { - namespace Internal { - /** - * FlexContainer is a custom control for laying out actors in a flexbox layout + * FlexContainer is a custom control for laying out actors in a Flexbox layout * @see Dali::Toolkit:FlexContainer for more details */ class FlexContainer : public Control { public: - /** * The structure to store the style properties and layout information of flex item */ struct FlexItemNode { - WeakHandle< Dali::Actor > actor; ///< Actor handle of the flex item - css_node_t* node; ///< The style properties and layout information + WeakHandle actor; ///< Actor handle of the flex item + YGNodeRef node; ///< The style properties and layout information }; - typedef std::vector< FlexItemNode > FlexItemNodeContainer; + typedef std::vector FlexItemNodeContainer; public: - /** * Construct a new FlexContainer. */ @@ -158,7 +150,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); /** * Called to retrieve a property of an object of this type. @@ -166,52 +158,52 @@ 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); private: // From Control - /** * @copydoc Control::OnInitialize() */ - virtual void OnInitialize(); + void OnInitialize() override; /** * @copydoc Control::OnChildAdd(Actor& child) */ - virtual void OnChildAdd( Actor& child ); + void OnChildAdd(Actor& child) override; /** * @copydoc Control::OnChildRemove(Actor& child) */ - virtual void OnChildRemove( Actor& child ); + void OnChildRemove(Actor& child) override; /** * @copydoc Control::OnRelayout */ - virtual void OnRelayout( const Vector2& size, RelayoutContainer& container ); + void OnRelayout(const Vector2& size, RelayoutContainer& container) override; /** * @copydoc Control::RelayoutDependentOnChildren() */ - virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ); + bool RelayoutDependentOnChildren(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) override; /** * @copydoc Control::GetNextKeyboardFocusableActor */ - virtual Actor GetNextKeyboardFocusableActor( Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled ); + Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled) override; /** * @copydoc CustomActorImpl::OnSizeSet( const Vector3& size ) */ - virtual void OnSizeSet( const Vector3& size ); + void OnSizeSet(const Vector3& size) override; /** - * @copydoc CustomActorImpl::OnSizeAnimation(Animation&, const Vector3&) - */ - virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize); + * @copydoc OnLayoutDirectionChanged( Dali::Actor actor, Dali::LayoutDirection::Type type ) + * @param[in] actor The actor whose layoutDirection is changed. + * @param[in] type The layoutDirection. + */ + void OnLayoutDirectionChanged(Dali::Actor actor, Dali::LayoutDirection::Type type); private: // Implementation - /** * Calculate the layout properties of all the children */ @@ -228,29 +220,27 @@ private: // Implementation virtual ~FlexContainer(); private: - // Undefined copy constructor and assignment operators FlexContainer(const FlexContainer&); FlexContainer& operator=(const FlexContainer& rhs); -private: // Data - - FlexItemNode mRootNode; ///< Style properties and layout information of flex container - FlexItemNodeContainer mChildrenNodes; ///< Style properties and layout information of flex items in the container +private: // Data + FlexItemNode mRootNode; ///< Style properties and layout information of flex container + FlexItemNodeContainer mChildrenNodes; ///< Style properties and layout information of flex items in the container - Toolkit::FlexContainer::ContentDirection mContentDirection; ///< The content direction of the container - Toolkit::FlexContainer::FlexDirection mFlexDirection; ///< The flex direction of the container - Toolkit::FlexContainer::WrapType mFlexWrap; ///< The wrap type of the container - Toolkit::FlexContainer::Justification mJustifyContent; ///< The alignment of flex items in the container on the main-axis - Toolkit::FlexContainer::Alignment mAlignItems; ///< The alignment of flex items in the container on the cross-axis - Toolkit::FlexContainer::Alignment mAlignContent; ///< The alignment of flex lines in the container on the cross-axis + Toolkit::FlexContainer::ContentDirection mContentDirection; ///< The content direction of the container + Toolkit::FlexContainer::FlexDirection mFlexDirection; ///< The flex direction of the container + Toolkit::FlexContainer::WrapType mFlexWrap; ///< The wrap type of the container + Toolkit::FlexContainer::Justification mJustifyContent; ///< The alignment of flex items in the container on the main-axis + Toolkit::FlexContainer::Alignment mAlignItems; ///< The alignment of flex items in the container on the cross-axis + Toolkit::FlexContainer::Alignment mAlignContent; ///< The alignment of flex lines in the container on the cross-axis }; } // namespace Internal // Helpers for public-api forwarding methods -inline Toolkit::Internal::FlexContainer& GetImpl( Toolkit::FlexContainer& flexContainer ) +inline Toolkit::Internal::FlexContainer& GetImpl(Toolkit::FlexContainer& flexContainer) { DALI_ASSERT_ALWAYS(flexContainer); @@ -259,7 +249,7 @@ inline Toolkit::Internal::FlexContainer& GetImpl( Toolkit::FlexContainer& flexCo return static_cast(handle); } -inline const Toolkit::Internal::FlexContainer& GetImpl( const Toolkit::FlexContainer& flexContainer ) +inline const Toolkit::Internal::FlexContainer& GetImpl(const Toolkit::FlexContainer& flexContainer) { DALI_ASSERT_ALWAYS(flexContainer); @@ -272,4 +262,4 @@ inline const Toolkit::Internal::FlexContainer& GetImpl( const Toolkit::FlexConta } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_FLEX_CONTAINER_H__ +#endif // DALI_TOOLKIT_INTERNAL_FLEX_CONTAINER_H