Changed some examples to use initializer list for Maps & Arrays
[platform/core/uifw/dali-demo.git] / examples / simple-layout / custom-layout.h
1 #ifndef DEMO_CUSTOM_LAYOUT_H
2 #define DEMO_CUSTOM_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 // EXTERNAL INCLUDES
21 #include <dali/public-api/object/base-handle.h>
22 #include <dali-toolkit/devel-api/layouting/layout-group.h>
23
24 namespace Demo
25 {
26
27 namespace Internal
28 {
29 class CustomLayout;
30 }
31
32 /**
33  * @brief This is the handle class to a very simple Custom Layout.
34  *
35  * This class lays out its children horizontally in a very simple manner.
36  */
37 class CustomLayout : public Dali::Toolkit::LayoutGroup
38 {
39 public:
40
41   /**
42    * @brief Creates an uninitialized CustomLayout handle.
43    *
44    * Initialize it using CustomLayout::New().
45    * Calling member functions with an uninitialized handle is not allowed.
46    */
47   CustomLayout() = default;
48
49   /**
50    * @brief Creates a CustomLayout object.
51    */
52   static CustomLayout New();
53
54
55   /**
56    * @brief Default destructor.
57    *
58    * This is non-virtual, since derived Handle types must not contain data or virtual methods
59    */
60   ~CustomLayout() = default;
61
62   /**
63    * @brief Copy constructor
64    */
65   CustomLayout( const CustomLayout& ) = default;
66
67   /**
68    * @brief Assigment operator
69    */
70   CustomLayout& operator=( const CustomLayout& ) = default;
71
72   /**
73    * @brief Move constructor
74    */
75   CustomLayout( CustomLayout&& ) = default;
76
77   /**
78    * @brief Movable assignment operator
79    */
80   CustomLayout& operator=( CustomLayout&& ) = default;
81
82   /**
83    * @brief Downcasts a handle to a CustomLayout handle.
84    *
85    * If handle points to a CustomLayout, the downcast produces a valid handle.
86    * If not, the returned handle is left uninitialized.
87
88    * @param[in] handle to an object
89    * @return Handle to a CustomLayout or an uninitialized handle
90    */
91   static CustomLayout DownCast( BaseHandle handle );
92
93 public: // Not intended for application developers
94
95   /// @cond internal
96   /**
97    * @brief This constructor is used by CustomLayout::New() methods.
98    *
99    * @param[in] actor A pointer to a newly allocated Dali resource
100    */
101   explicit CustomLayout( Internal::CustomLayout* body );
102   /// @endcond
103 };
104
105 } // namespace Demo
106
107 #endif // DEMO_CUSTOM_LAYOUT_H