[Tizen] Merge HBoxLayout and VBoxLayout into LinearLayout.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / layouting / absolute-layout.h
1 #ifndef DALI_TOOLKIT_LAYOUTING_ABSOLUTE_LAYOUT_H
2 #define DALI_TOOLKIT_LAYOUTING_ABSOLUTE_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 #include <dali-toolkit/public-api/toolkit-property-index-ranges.h>
25 #include <dali-toolkit/public-api/dali-toolkit-common.h>
26
27 namespace Dali
28 {
29 namespace Toolkit
30 {
31
32 namespace Internal DALI_INTERNAL
33 {
34 class AbsoluteLayout;
35 }
36
37 /**
38  * This class implements a absolute layout, allowing explict positioning of
39  * children.
40  * Positions are from the top left of the layout and can be set using the
41  * Actor::Property::POSITION and alike.
42  */
43 class DALI_TOOLKIT_API AbsoluteLayout : public LayoutGroup
44 {
45 public:
46
47   enum PropertyRange
48   {
49     CHILD_PROPERTY_START_INDEX = ABSOLUTE_LAYOUT_CHILD_PROPERTY_START_INDEX,
50     CHILD_PROPERTY_END_INDEX   = ABSOLUTE_LAYOUT_CHILD_PROPERTY_END_INDEX
51   };
52
53   /**
54    * @brief Creates an uninitialized AbsoluteLayout handle.
55    *
56    * Initialize it using AbsoluteLayout::New().
57    * Calling member functions with an uninitialized handle is not allowed.
58    */
59   AbsoluteLayout();
60
61   /**
62    * @brief Creates a AbsoluteLayout object.
63    */
64   static AbsoluteLayout New();
65
66   /**
67    * @brief Downcasts a handle to a AbsoluteLayout handle.
68    *
69    * If handle points to a AbsoluteLayout, the downcast produces a valid handle.
70    * If not, the returned handle is left uninitialized.
71
72    * @param[in] handle to an object
73    * @return Handle to a AbsoluteLayout or an uninitialized handle
74    */
75   static AbsoluteLayout DownCast( BaseHandle handle );
76
77   /**
78    * @brief Copy constructor
79    */
80   AbsoluteLayout( const AbsoluteLayout& other );
81
82   /**
83    * @brief Assigment operator
84    */
85   AbsoluteLayout& operator=( const AbsoluteLayout& other );
86
87   /**
88    * @brief Default destructor.
89    *
90    * This is non-virtual, since derived Handle types must not contain data or virtual methods
91    */
92   ~AbsoluteLayout()=default;
93
94
95 public: // Not intended for application developers
96
97   /// @cond internal
98   /**
99    * @brief This constructor is used by AbsoluteLayout::New() methods.
100    *
101    * @param[in] actor A pointer to a newly allocated Dali resource
102    */
103   explicit DALI_INTERNAL AbsoluteLayout( Internal::AbsoluteLayout* body );
104   /// @endcond
105 };
106
107 } // namespace Toolkit
108 } // namespace Dali
109
110 #endif // DALI_TOOLKIT_LAYOUTING_ABSOLUTE_LAYOUT_H