Add size animation in layout measure phase.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / layouting / vbox-layout.h
1 #ifndef DALI_TOOLKIT_LAYOUTING_VBOX_LAYOUT_H
2 #define DALI_TOOLKIT_LAYOUTING_VBOX_LAYOUT_H
3
4 /*
5  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #include <dali/public-api/common/dali-common.h>
21 #include <dali/public-api/object/base-handle.h>
22 #include <dali-toolkit/devel-api/layouting/layout-group.h>
23 #include <dali-toolkit/devel-api/layouting/layout-size.h>
24
25 namespace Dali
26 {
27 namespace Toolkit
28 {
29
30 namespace Internal DALI_INTERNAL
31 {
32 class VboxLayout;
33 }
34
35 /**
36  * This class implements a vertical box layout, automatically handling
37  * right to left or left to right direction change.
38  */
39 class DALI_TOOLKIT_API VboxLayout : public LayoutGroup
40 {
41 public:
42
43   enum PropertyRange
44   {
45     CHILD_PROPERTY_START_INDEX = LINEAR_LAYOUT_CHILD_PROPERTY_START_INDEX,
46     CHILD_PROPERTY_END_INDEX   = LINEAR_LAYOUT_CHILD_PROPERTY_END_INDEX
47   };
48
49   struct ChildProperty
50   {
51     enum
52     {
53       WEIGHT = CHILD_PROPERTY_START_INDEX,
54     };
55   };
56
57   /**
58    * @brief Creates an uninitialized VboxLayout handle.
59    *
60    * Initialize it using VboxLayout::New().
61    * Calling member functions with an uninitialized handle is not allowed.
62    */
63   VboxLayout();
64
65   /**
66    * @brief Creates a VboxLayout object.
67    */
68   static VboxLayout New();
69
70   /**
71    * @brief Downcasts a handle to a VboxLayout handle.
72    *
73    * If handle points to a VboxLayout, the downcast produces a valid handle.
74    * If not, the returned handle is left uninitialized.
75
76    * @param[in] handle to an object
77    * @return Handle to a VboxLayout or an uninitialized handle
78    */
79   static VboxLayout DownCast( BaseHandle handle );
80
81   /**
82    * @brief Copy constructor
83    */
84   VboxLayout( const VboxLayout& other );
85
86   /**
87    * @brief Assigment operator
88    */
89   VboxLayout& operator=( const VboxLayout& other );
90
91   /**
92    * @brief Default destructor.
93    *
94    * This is non-virtual, since derived Handle types must not contain data or virtual methods
95    */
96   ~VboxLayout()=default;
97
98   /**
99    * @brief Set the padding between cells in the layout
100    *
101    * @param[in] size The padding between cells.
102    */
103   void SetCellPadding( LayoutSize size );
104
105   /**
106    * @brief Get the padding between cells in the layout
107    *
108    * @return The padding between cells.
109    */
110   LayoutSize GetCellPadding();
111
112 public: // Not intended for application developers
113
114   /// @cond internal
115   /**
116    * @brief This constructor is used by VboxLayout::New() methods.
117    *
118    * @param[in] actor A pointer to a newly allocated Dali resource
119    */
120   explicit DALI_INTERNAL VboxLayout( Internal::VboxLayout* body );
121   /// @endcond
122 };
123
124 } // namespace Toolkit
125 } // namespace Dali
126
127 #endif // DALI_TOOLKIT_LAYOUTING_VBOX_LAYOUT_H