Stop rendering during idle state
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / relayout-controller-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
2 #define __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
3
4 /*
5  * Copyright (c) 2014 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
21 #include <dali/dali.h>
22 #include "relayout-controller.h"
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Internal
31 {
32
33 class RelayoutController;
34
35 /**
36  * @copydoc Toolkit::Internal::RelayoutController
37  */
38 class RelayoutControllerImpl : public Dali::BaseObject, public ConnectionTracker
39 {
40 public:
41
42   /**
43    * Constructor.
44    * We should only create a unique instance.
45    */
46   RelayoutControllerImpl();
47
48
49   /**
50    * Destructor
51    */
52   virtual ~RelayoutControllerImpl();
53
54   /**
55    * Request for relayout.
56    */
57   void Request();
58
59 private:
60
61   /**
62    * Relayouts controls inside actor tree from bottom to top.
63    */
64   void Relayout();
65
66   /**
67    * Resets the relayout controller.
68    */
69   void Reset();
70
71   /**
72    * Disconnect the Relayout() method from the Stage::EventProcessingFinishedSignal().
73    */
74   void Disconnect();
75
76   // Undefined
77   RelayoutControllerImpl(const RelayoutControllerImpl&);
78   RelayoutControllerImpl& operator=(const RelayoutControllerImpl&);
79
80 private:
81
82   bool mRelayoutConnection:1; ///< Whether EventProcessingFinishedSignal signal is connected.
83 };
84
85 } // namespace Internal
86
87
88 inline Internal::RelayoutControllerImpl& GetImpl(Dali::Toolkit::Internal::RelayoutController& obj)
89 {
90   DALI_ASSERT_ALWAYS(obj);
91
92   Dali::BaseObject& handle = obj.GetBaseObject();
93
94   return static_cast<Internal::RelayoutControllerImpl&>(handle);
95 }
96
97 inline const Internal::RelayoutControllerImpl& GetImpl(const Dali::Toolkit::Internal::RelayoutController& obj)
98 {
99   DALI_ASSERT_ALWAYS(obj);
100
101   const Dali::BaseObject& handle = obj.GetBaseObject();
102
103   return static_cast<const Internal::RelayoutControllerImpl&>(handle);
104 }
105
106 } // namespace Toolkit
107
108 } // namespace Dali
109
110 #endif // __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__