1 #ifndef TEST_CUSTOM_LAYOUT_H
2 #define TEST_CUSTOM_LAYOUT_H
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <dali/public-api/object/base-handle.h>
22 #include <dali-toolkit/devel-api/layouting/layout-group.h>
33 * @brief This is the handle class to a very simple Custom Layout.
35 * This class lays out its children horizontally in a very simple manner.
37 class CustomLayout : public Dali::Toolkit::LayoutGroup
42 static const int BEHAVIOUR_FLAG_UNCONSTRAINED_CHILD_WIDTH = 0x00000001; // Child width measured without constraint
43 static const int BEHAVIOUR_FLAG_UNCONSTRAINED_CHILD_HEIGHT = 0x00000002; // Child height measured without constraint
46 * @brief Creates an uninitialized CustomLayout handle.
48 * Initialize it using CustomLayout::New().
49 * Calling member functions with an uninitialized handle is not allowed.
51 CustomLayout() = default;
54 * @brief Creates a CustomLayout object.
56 static CustomLayout New();
60 * @brief Default destructor.
62 * This is non-virtual, since derived Handle types must not contain data or virtual methods
64 ~CustomLayout() = default;
67 * @brief Copy constructor
69 CustomLayout( const CustomLayout& ) = default;
72 * @brief Assigment operator
74 CustomLayout& operator=( const CustomLayout& ) = default;
77 * @brief Move constructor
79 CustomLayout( CustomLayout&& ) = default;
82 * @brief Movable assignment operator
84 CustomLayout& operator=( CustomLayout&& ) = default;
87 * @brief Downcasts a handle to a CustomLayout handle.
89 * If handle points to a CustomLayout, the downcast produces a valid handle.
90 * If not, the returned handle is left uninitialized.
92 * @param[in] handle to an object
93 * @return Handle to a CustomLayout or an uninitialized handle
95 static CustomLayout DownCast( BaseHandle handle );
98 * Request for a relayout of this layout
100 void RequestLayout();
103 * Enables setting of flags corresponding to particular behaviour of this layout
104 * @param[in] flag the flag to set
106 void SetCustomBehaviourFlag( int flag );
109 * Returns true or false depending on whether flag is set
110 * @return bool returns true if flag set
112 bool GetCustomBehaviourFlags( int flagToCheck );
115 * Clears the flag if already set.
116 * @param[in] flag the flag to clear
118 void ClearPrivateFlag( int flag );
120 public: // Not intended for application developers
124 * @brief This constructor is used by CustomLayout::New() methods.
126 * @param[in] actor A pointer to a newly allocated Dali resource
128 explicit CustomLayout( Internal::CustomLayout* body );
134 #endif // TEST_CUSTOM_LAYOUT_H