Add codes for Dali Windows Backend
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / layouting / grid.h
1 #ifndef DALI_TOOLKIT_LAYOUTING_GRID_LAYOUT_H
2 #define DALI_TOOLKIT_LAYOUTING_GRID_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/object/base-handle.h>
21 #include <dali-toolkit/public-api/dali-toolkit-common.h>
22 #include <dali-toolkit/devel-api/layouting/layout-group.h>
23 #include <dali-toolkit/devel-api/layouting/layout-size.h>
24 #include <dali-toolkit/public-api/toolkit-property-index-ranges.h>
25
26 namespace Dali
27 {
28 namespace Toolkit
29 {
30
31 namespace Internal DALI_INTERNAL
32 {
33 class Grid;
34 }
35
36 /**
37  * @brief
38  * This class implements a horizontal box layout, automatically handling
39  * right to left or left to right direction change.
40  */
41 class DALI_TOOLKIT_API Grid : public LayoutGroup
42 {
43 public:
44
45   /**
46    * @brief Creates an uninitialized Grid handle.
47    *
48    * Initialize it using Grid::New().
49    * Calling member functions with an uninitialized handle is not allowed.
50    */
51   Grid();
52
53   /**
54    * @brief Creates a Grid object.
55    */
56   static Grid New();
57
58   /**
59    * @brief Downcasts a handle to a Grid handle.
60    *
61    * If handle points to a Grid, the downcast produces a valid handle.
62    * If not, the returned handle is left uninitialized.
63
64    * @param[in] handle to an object
65    * @return Handle to a Grid or an uninitialized handle
66    */
67   static Grid DownCast( BaseHandle handle );
68
69   /**
70    * @brief Copy constructor
71    */
72   Grid( const Grid& other );
73
74   /**
75    * @brief Assigment operator
76    */
77   Grid& operator=( const Grid& other );
78
79   /**
80    * @brief Default destructor.
81    *
82    * This is non-virtual, since derived Handle types must not contain data or virtual methods
83    */
84   ~Grid()=default;
85
86   /**
87    * @brief Set the number of columns in the Grid.
88    * @param[in] columns number of columns,
89    */
90   void SetNumberOfColumns( int columns );
91
92   /**
93    *  @brief Get the number of columns in the grid.
94    *  @return the number of columns.
95    */
96   int GetNumberOfColumns() const;
97
98 public: // Not intended for application developers
99
100   /// @cond internal
101   /**
102    * @brief This constructor is used by Grid::New() methods.
103    *
104    * @param[in] actor A pointer to a newly allocated Dali resource
105    */
106   explicit DALI_INTERNAL Grid( Internal::Grid* body );
107   /// @endcond
108 };
109
110 } // namespace Toolkit
111 } // namespace Dali
112
113 #endif // DALI_TOOLKIT_LAYOUTING_GRID_LAYOUT_H