1 #ifndef DALI_TOOLKIT_INTERNAL_LAYOUTING_SIZE_NEGOTIATION_MAPPER_IMPL_H
2 #define DALI_TOOLKIT_INTERNAL_LAYOUTING_SIZE_NEGOTIATION_MAPPER_IMPL_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/actors/actor-enumerations.h>
22 #include <dali-toolkit/public-api/controls/control.h>
23 #include <dali-toolkit/devel-api/layouting/layout-item.h>
31 using LayoutItemPtr = IntrusivePtr<LayoutItem>;
33 * @brief Maps ResizePolicies used in SizeNegotiation to the Layout system
36 namespace SizeNegotiationMapper
39 * @brief Sets the child layout parameters on the control by mapping it's ResizePolicy to a MeasureSpecification
40 * @param[out] control the control to set the layout params on
41 * @param[out] layout the layout for the given control
42 * @param[in] dimension the dimension or dimensions the resize policy applies to.
43 * @note If Dimension::ALL_DIMENSIONS is provided as the dimension parameter then Dimension::WIDTH is used for
44 * both height and width mapping.
46 void SetLayoutParametersUsingResizePolicy( Toolkit::Control control, Toolkit::Internal::LayoutItemPtr layout, const Dimension::Type dimension );
49 * @brief Sets the child layout parameters on the control using the a ResizePolicy that is dependant on it's parent
50 * @param[out] control the control to set the layout params on
51 * @param[in] parentWidthSpecification the parent's width measure specification
52 * @param[in] parentHeightSpecification the parent's height measure specification
53 * @param[out] childWidth the resulting child width
54 * @param[out] childHeight the resulting child height
55 * @note This method should be used after a child has been parented and a parent measure spec is available.
57 void GetSizeofChildForParentDependentResizePolicy( Toolkit::Control control, const MeasureSpec parentWidthSpecification, const MeasureSpec parentHeightSpecification, LayoutLength& childWidth, LayoutLength& childHeight );
59 } // namespace SizeNegotiationMapper
61 } // namespace Internal
63 } // namespace Toolkit
68 #endif // DALI_TOOLKIT_INTERNAL_LAYOUTING_SIZE_NEGOTIATION_MAPPER_IMPL_H