1 #ifndef __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
2 #define __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
5 * Copyright (c) 2014 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.
22 #include <dali/public-api/common/vector-wrapper.h>
23 #include <dali/public-api/object/base-object.h>
26 #include <dali-toolkit/public-api/controls/control.h>
27 #include <dali-toolkit/public-api/controls/control-impl.h>
28 #include "relayout-controller.h"
39 class RelayoutController;
41 typedef std::pair< Dali::Toolkit::Control, Vector2 > ControlSizePair;
42 typedef std::vector< ControlSizePair > ControlStack;
45 * @copydoc Toolkit::Internal::RelayoutController
47 class RelayoutControllerImpl : public Dali::BaseObject, public ConnectionTracker
53 * We should only create a unique instance.
54 * @param relayoutFlag to avoid unnecessary calls inside a single frame
56 RelayoutControllerImpl( bool& relayoutFlag );
62 virtual ~RelayoutControllerImpl();
65 * Request for relayout.
72 * Relayouts controls inside actor tree from bottom to top.
77 * Resets the relayout controller.
82 * Disconnect the Relayout() method from the Stage::EventProcessingFinishedSignal().
87 RelayoutControllerImpl(const RelayoutControllerImpl&);
88 RelayoutControllerImpl& operator=(const RelayoutControllerImpl&);
92 bool& mRelayoutFlag; ///< reference to relayout flag to avoid unnecessary calls
93 ControlStack mControlStack; ///< stack for relayouting
94 ActorSizeContainer mSizecontainer; ///< size container
95 bool mRelayoutConnection:1; ///< Whether EventProcessingFinishedSignal signal is connected.
99 } // namespace Internal
102 inline Internal::RelayoutControllerImpl& GetImpl(Dali::Toolkit::Internal::RelayoutController& obj)
104 DALI_ASSERT_ALWAYS(obj);
106 Dali::BaseObject& handle = obj.GetBaseObject();
108 return static_cast<Internal::RelayoutControllerImpl&>(handle);
111 inline const Internal::RelayoutControllerImpl& GetImpl(const Dali::Toolkit::Internal::RelayoutController& obj)
113 DALI_ASSERT_ALWAYS(obj);
115 const Dali::BaseObject& handle = obj.GetBaseObject();
117 return static_cast<const Internal::RelayoutControllerImpl&>(handle);
120 } // namespace Toolkit
124 #endif // __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__