Fix boost includes
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / relayout-controller.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 // FILE HEADER
18
19 #include "relayout-controller.h"
20 #include "relayout-controller-impl.h"
21
22 // EXTERNAL INCLUDES
23
24 #include <stack>
25 #include <sstream>
26 #include <dali/integration-api/debug.h>
27
28 // INTERNAL INCLUDES
29
30 #include "dali-toolkit/public-api/controls/control.h"
31 #include "dali-toolkit/public-api/controls/control-impl.h"
32 #include "dali-toolkit/public-api/controls/text-view/text-view.h"
33
34 namespace Dali
35 {
36
37 namespace Toolkit
38 {
39
40 namespace Internal
41 {
42
43 RelayoutController::RelayoutController()
44 {
45
46 }
47
48 RelayoutController::~RelayoutController()
49 {
50
51 }
52
53 RelayoutController RelayoutController::Get()
54 {
55   RelayoutController controller;
56
57   // Check whether the RelayoutController is already created
58   Dali::Adaptor& adaptor = Dali::Adaptor::Get();
59   Dali::BaseHandle handle = adaptor.GetSingleton(typeid(RelayoutController));
60
61   if(handle)
62   {
63     // If so, downcast the handle of singleton to RelayoutController
64     controller = RelayoutController(dynamic_cast<Internal::RelayoutControllerImpl*>(handle.GetObjectPtr()));
65   }
66
67   if(!controller)
68   {
69     // If not, create the RelayoutController and register it as a singleton
70     controller = RelayoutController(new Internal::RelayoutControllerImpl());
71     adaptor.RegisterSingleton(typeid(controller), controller);
72   }
73
74   return controller;
75 }
76
77 RelayoutController::RelayoutController(Internal::RelayoutControllerImpl *impl)
78   : BaseHandle(impl)
79 {
80 }
81
82 void RelayoutController::Request()
83 {
84   GetImpl(*this).Request();
85 }
86
87
88 } // namespace Internal
89
90 } // namespace Toolkit
91
92 } // namespace Dali
93