Dali 3D User Interface Engine
lifecycle-controller-impl.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 
18 // CLASS HEADER
20 
21 // EXTERNAL INCLUDES
23 
24 // INTERNAL INCLUDES
25 #include <adaptor-impl.h>
26 #include <singleton-service-impl.h>
27 
28 namespace Dali
29 {
30 
31 namespace Internal
32 {
33 
34 namespace Adaptor
35 {
36 
37 Dali::LifecycleController LifecycleController::Get()
38 {
39  Dali::LifecycleController lifecycleController;
40 
42  if ( service )
43  {
44  // Check whether the singleton is already created
45  Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::LifecycleController ) );
46  if(handle)
47  {
48  // If so, downcast the handle
49  lifecycleController = Dali::LifecycleController( dynamic_cast< LifecycleController* >( handle.GetObjectPtr() ) );
50  }
51  else
52  {
53  lifecycleController = Dali::LifecycleController( new LifecycleController() );
54  service.Register( typeid( lifecycleController ), lifecycleController );
55  }
56  }
57 
58  return lifecycleController;
59 }
60 
62 {
63 }
64 
66 {
67 }
68 
69 Dali::LifecycleController::LifecycleSignalType& LifecycleController::InitSignal()
70 {
71  return mInitSignal;
72 }
73 
75 {
76  if( !mInitSignal.Empty() )
77  {
78  mInitSignal.Emit();
79  }
80 }
81 
82 Dali::LifecycleController::LifecycleSignalType& LifecycleController::TerminateSignal()
83 {
84  return mTerminateSignal;
85 }
86 
88 {
89  if( !mTerminateSignal.Empty() )
90  {
91  mTerminateSignal.Emit();
92  }
93 }
94 
95 Dali::LifecycleController::LifecycleSignalType& LifecycleController::PauseSignal()
96 {
97  return mPauseSignal;
98 }
99 
101 {
102  if( !mPauseSignal.Empty() )
103  {
104  mPauseSignal.Emit();
105  }
106 }
107 
108 Dali::LifecycleController::LifecycleSignalType& LifecycleController::ResumeSignal()
109 {
110  return mResumeSignal;
111 }
112 
114 {
115  if( !mResumeSignal.Empty() )
116  {
117  mResumeSignal.Emit();
118  }
119 }
120 
121 Dali::LifecycleController::LifecycleSignalType& LifecycleController::ResetSignal()
122 {
123  return mResetSignal;
124 }
125 
127 {
128  if( !mResetSignal.Empty() )
129  {
130  mResetSignal.Emit();
131  }
132 }
133 
134 Dali::LifecycleController::LifecycleSignalType& LifecycleController::ResizeSignal()
135 {
136  return mResizeSignal;
137 }
138 
140 {
141  if( !mResizeSignal.Empty() )
142  {
143  mResizeSignal.Emit();
144  }
145 }
146 
147 Dali::LifecycleController::LifecycleSignalType& LifecycleController::LanguageChangedSignal()
148 {
149  return mLanguageChangedSignal;
150 }
151 
153 {
154  if( !mLanguageChangedSignal.Empty() )
155  {
156  mLanguageChangedSignal.Emit();
157  }
158 }
159 
161 {
162  EmitInitSignal();
163 }
164 
166 {
168 }
169 
171 {
172  EmitPauseSignal();
173 }
174 
176 {
178 }
179 
181 {
182  EmitResetSignal();
183 }
184 
186 {
188 }
189 
191 {
193 }
194 
195 } // namespace Adaptor
196 
197 } // namespace Internal
198 
199 } // namespace Dali
Dali Docs Home
Read more about Dali