X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Flayouting%2Fflex-node.h;h=5a73458786687a142712c915d36954ac488f9a76;hp=3542f7db8d9d557164cfe1955d2d88557f1b116b;hb=cabf76b631c0365a1e8f396b91ee54faa4994880;hpb=e7dcd994ba541f20581b4c999043d4cbeb36416c diff --git a/dali-toolkit/devel-api/layouting/flex-node.h b/dali-toolkit/devel-api/layouting/flex-node.h index 3542f7d..5a73458 100644 --- a/dali-toolkit/devel-api/layouting/flex-node.h +++ b/dali-toolkit/devel-api/layouting/flex-node.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_LAYOUTING_FLEX_NODE_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -18,9 +18,9 @@ */ // EXTERNAL INCLUDES -#include -#include #include +#include +#include // INTERNAL INCLUDES #include @@ -29,10 +29,8 @@ namespace Dali { namespace Toolkit { - namespace Flex { - class Node; /** @@ -41,10 +39,10 @@ class Node; */ enum class FlexDirection { - COLUMN, ///< The flexible items are displayed vertically as a column - COLUMN_REVERSE, ///< The flexible items are displayed vertically as a column, but in reverse order - ROW, ///< The flexible items are displayed horizontally as a row - ROW_REVERSE ///< The flexible items are displayed horizontally as a row, but in reverse order + COLUMN, ///< The flexible items are displayed vertically as a column + COLUMN_REVERSE, ///< The flexible items are displayed vertically as a column, but in reverse order + ROW, ///< The flexible items are displayed horizontally as a row + ROW_REVERSE ///< The flexible items are displayed horizontally as a row, but in reverse order }; /** @@ -53,11 +51,11 @@ enum class FlexDirection */ enum class Justification { - FLEX_START, ///< Items are positioned at the beginning of the container - CENTER, ///< Items are positioned at the center of the container - FLEX_END, ///< Items are positioned at the end of the container - SPACE_BETWEEN, ///< Items are positioned with equal space between the items - SPACE_AROUND ///< Items are positioned with equal space before, between, and after the items + FLEX_START, ///< Items are positioned at the beginning of the container + CENTER, ///< Items are positioned at the center of the container + FLEX_END, ///< Items are positioned at the end of the container + SPACE_BETWEEN, ///< Items are positioned with equal space between the items + SPACE_AROUND ///< Items are positioned with equal space before, between, and after the items }; /** @@ -66,8 +64,8 @@ enum class Justification */ enum class WrapType { - NO_WRAP, ///< Flex items laid out in single line (shrunk to fit the flex container along the main axis) - WRAP ///< Flex items laid out in multiple lines if needed + NO_WRAP, ///< Flex items laid out in single line (shrunk to fit the flex container along the main axis) + WRAP ///< Flex items laid out in multiple lines if needed }; /** @@ -76,12 +74,12 @@ enum class WrapType */ enum class Alignment { - AUTO, ///< Currently unsupported, placeholder for inheritance of parent alignment. + AUTO, ///< Currently unsupported, placeholder for inheritance of parent alignment. - FLEX_START, ///< At the beginning of the container - CENTER, ///< At the center of the container - FLEX_END, ///< At the end of the container - STRETCH ///< Stretch to fit the container + FLEX_START, ///< At the beginning of the container + CENTER, ///< At the center of the container + FLEX_END, ///< At the end of the container + STRETCH ///< Stretch to fit the container }; /** @@ -89,8 +87,8 @@ enum class Alignment */ enum class PositionType { - RELATIVE, ///< Flex items laid out relatively - ABSOLUTE ///< Flex items laid out absolutely + RELATIVE, ///< Flex items laid out relatively + ABSOLUTE ///< Flex items laid out absolutely }; /** @@ -98,7 +96,11 @@ enum class PositionType */ struct SizeTuple { - SizeTuple( float x, float y ) : width( x ), height( y ){} + SizeTuple(float x, float y) + : width(x), + height(y) + { + } float width; float height; @@ -111,8 +113,9 @@ struct SizeTuple * @note int, width measure specifcation mode * @note float, available height for child * @note int, height measure specification mode + * @note SizeTuple, return value */ -using MeasureCallback = SizeTuple (*)( Dali::Actor, float , int , float , int ); +using MeasureCallback = void (*)(Dali::Actor, float , int , float , int, SizeTuple *); /** * This class provides the API for calling into the Flex layout implementation. @@ -131,8 +134,8 @@ public: ~Node(); Node& operator=(Node&&) = default; - Node(Node&&) = default; - Node(const Node&) = delete; + Node(Node&&) = default; + Node(const Node&) = delete; Node& operator=(const Node&) = delete; /** @@ -143,13 +146,13 @@ public: * @param[in] index to insert at. * @return child node pointer */ - Node* AddChild( Actor child, Extents margin, MeasureCallback measureFunction, int index ); + Node* AddChild(Actor child, Extents margin, MeasureCallback measureFunction, int index); /** * @brief Remove child from the FlexLayout at the given index. * @param[in] child child to be removed. */ - void RemoveChild( Actor child ); + void RemoveChild(Actor child); /** * @brief Return the dimensions of the node. @@ -159,7 +162,7 @@ public: * @param[in] heightMode height specification mode * @return Size tuple representing the width and height of the node */ - SizeTuple MeasureNode( float width, int widthMode, float height, int heightMode ); + SizeTuple MeasureNode(float width, int widthMode, float height, int heightMode); /** * @brief Perform the layout measure calculations. @@ -167,7 +170,7 @@ public: * @param[in] availableHeight Amount of space available for layout, height. * @param[in] isRTL Is the direction of the layout right to left. */ - void CalculateLayout( float availableWidth, float availableHeight, bool isRTL ); + void CalculateLayout(float availableWidth, float availableHeight, bool isRTL); /** * @brief Get the calculated width of the given node. @@ -186,14 +189,14 @@ public: * @param[in] index of the child * @return Frame structure left x, top y, right z, bottom w */ - Vector4 GetNodeFrame(int index ) const; + Vector4 GetNodeFrame(int index) const; /** * @brief Set the flex direction in the layout. * The direction of the main-axis which determines the direction that flex items are laid out. * @param[in] flexDirection The flex direction. */ - void SetFlexDirection( FlexDirection flexDirection ); + void SetFlexDirection(FlexDirection flexDirection); /** * @brief Get the flex direction in the layout. @@ -205,7 +208,7 @@ public: * @brief Set the justification in the layout. * @param[in] flexJustification The flex justification. */ - void SetFlexJustification( Justification flexJustification ); + void SetFlexJustification(Justification flexJustification); /** * @brief Get the flex justification in the layout. @@ -217,7 +220,7 @@ public: * @brief Set the wrap in the layout. * @param[in] flexWrap The flex wrap. */ - void SetFlexWrap(WrapType flexWrap ); + void SetFlexWrap(WrapType flexWrap); /** * @brief Get the flex wrap in the layout. @@ -229,7 +232,7 @@ public: * @brief Set the alignment of the layout content. * @param[in] flexAlignment The alignment of the content. */ - void SetFlexAlignment( Alignment flexAlignment ); + void SetFlexAlignment(Alignment flexAlignment); /** * @brief Get the alignment of the layout content. @@ -241,7 +244,7 @@ public: * @brief Set the alignment of the layout items. * @param[in] flexAlignment The alignment of the items. */ - void SetFlexItemsAlignment( Alignment flexAlignment ); + void SetFlexItemsAlignment(Alignment flexAlignment); /** * @brief Get the alignment of the layout items. @@ -253,7 +256,7 @@ public: * @brief Set the alignment self of the layout items. * @param[in] flexAlignmentSelf The alignment self of the items. */ - void SetFlexAlignmentSelf( Alignment flexAlignmentSelf ); + void SetFlexAlignmentSelf(Alignment flexAlignmentSelf); /** * @brief Get the alignment self of the layout items. @@ -265,7 +268,7 @@ public: * @brief Set the position type of the layout items. * @param[in] flexPositionType The position type of the items. */ - void SetFlexPositionType( PositionType flexPositionType ); + void SetFlexPositionType(PositionType flexPositionType); /** * @brief Get the position type of the layout items. @@ -277,7 +280,7 @@ public: * @brief Set the aspect ratio of the layout items. * @param[in] flexAspectRatio The aspect ratio of the items. */ - void SetFlexAspectRatio( float flexAspectRatio ); + void SetFlexAspectRatio(float flexAspectRatio); /** * @brief Get the aspect ratio of the layout items. @@ -289,7 +292,7 @@ public: * @brief Set the basis of the layout items. * @param[in] flexBasis The basis of the items. */ - void SetFlexBasis( float flexBasis ); + void SetFlexBasis(float flexBasis); /** * @brief Get the basis of the layout items. @@ -301,7 +304,7 @@ public: * @brief Set the shrink of the layout items. * @param[in] flexShrink The shrink of the items. */ - void SetFlexShrink( float flexShrink ); + void SetFlexShrink(float flexShrink); /** * @brief Get the shrink of the layout items. @@ -313,7 +316,7 @@ public: * @brief Set the grow of the layout items. * @param[in] flexGrow The grow of the items. */ - void SetFlexGrow( float flexGrow ); + void SetFlexGrow(float flexGrow); /** * @brief Get the grow of the layout items. @@ -325,21 +328,20 @@ public: * @brief Set the margin. * @param[in] margin The margin value. */ - void SetMargin( Extents margin ); + void SetMargin(Extents margin); /** * @brief Set the padding. * @param[in] padding The padding value. */ - void SetPadding( Extents padding ); + void SetPadding(Extents padding); private: struct Impl; - std::unique_ptr< Impl > mImpl; + std::unique_ptr mImpl; }; // Node - } // namespace Flex } // namespace Toolkit } // namespace Dali