1 #ifndef DALI_TOOLKIT_INTERNAL_LAYOUT_CONTROLLER_H
2 #define DALI_TOOLKIT_INTERNAL_LAYOUT_CONTROLLER_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.
20 #include <dali/public-api/object/base-object.h>
21 #include <dali/integration-api/core.h>
22 #include <dali-toolkit/public-api/controls/control.h>
23 #include <dali-toolkit/devel-api/layouting/layout-controller.h>
24 #include <dali-toolkit/devel-api/layouting/layout-item-impl.h>
25 #include <dali-toolkit/devel-api/layouting/layout-group-impl.h>
35 * @brief Layout controller handles measurement and layout of all
36 * controls that utilize Layouts.
38 class LayoutController : public Dali::BaseObject, public Integration::Processor
52 * Second stage initialization
57 * This marks the given layout and all its parents as dirty.
59 void RequestLayout( LayoutItem& layout );
62 * Measures next level of layouts in the actor hierarchy.
64 void MeasureHierarchy( Actor root, MeasureSpec widthSpec, MeasureSpec heightSpec );
67 * Perform layout of the hierarchy
69 void PerformLayout( Actor root, int left, int top, int right, int bottom );
71 protected: // Implementation of Processor
74 * @copydoc Dali::Integration::Processor::Process()
76 virtual void Process();
79 bool mLayoutRequested;
82 } // namespace Internal
84 inline Internal::LayoutController& GetImpl( Dali::Toolkit::LayoutController& handle )
86 DALI_ASSERT_ALWAYS(handle);
87 Dali::BaseObject& object = handle.GetBaseObject();
88 return static_cast<Internal::LayoutController&>(object);
91 inline const Internal::LayoutController& GetImpl( const Dali::Toolkit::LayoutController& handle )
93 DALI_ASSERT_ALWAYS(handle);
94 const Dali::BaseObject& object = handle.GetBaseObject();
95 return static_cast<const Internal::LayoutController&>(object);
98 } // namespace Toolkit
101 #endif // DALI_TOOLKIT_INTERNAL_LAYOUT_CONTROLLER_H