Dali 3D User Interface Engine
lifecycle-controller-impl.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_LIFECYCLE_CONTROLLER_H__
2 #define __DALI_INTERNAL_LIFECYCLE_CONTROLLER_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 // EXTERNAL INCLUDES
24 
25 // INTERNAL INCLUDES
26 #include <lifecycle-controller.h>
27 #include <application.h>
28 
29 namespace Dali
30 {
31 
32 class Adaptor;
33 
34 namespace Internal
35 {
36 
37 namespace Adaptor
38 {
39 
44 {
45 public:
46 
47  // Creation & Destruction
48 
53 
58  static Dali::LifecycleController Get();
59 
60  // Signals
61 
65  Dali::LifecycleController::LifecycleSignalType& InitSignal();
66 
70  Dali::LifecycleController::LifecycleSignalType& TerminateSignal();
71 
75  Dali::LifecycleController::LifecycleSignalType& PauseSignal();
76 
80  Dali::LifecycleController::LifecycleSignalType& ResumeSignal();
81 
85  Dali::LifecycleController::LifecycleSignalType& ResetSignal();
86 
90  Dali::LifecycleController::LifecycleSignalType& ResizeSignal();
91 
95  Dali::LifecycleController::LifecycleSignalType& LanguageChangedSignal();
96 
97 public:
98 
104  void OnInit( Dali::Application& app );
105 
111  void OnTerminate( Dali::Application& app );
112 
118  void OnPause( Dali::Application& app );
119 
125  void OnResume( Dali::Application& app );
126 
132  void OnReset( Dali::Application& app );
133 
140 
146  void OnResize( Dali::Application& app );
147 
148 protected:
149 
153  virtual ~LifecycleController();
154 
155 private:
156 
160  void EmitInitSignal();
161 
165  void EmitTerminateSignal();
166 
170  void EmitPauseSignal();
171 
175  void EmitResumeSignal();
176 
180  void EmitResetSignal();
181 
185  void EmitResizeSignal();
186 
191 
192 private:
193 
194  // Signals
195  Dali::LifecycleController::LifecycleSignalType mInitSignal;
196  Dali::LifecycleController::LifecycleSignalType mTerminateSignal;
197  Dali::LifecycleController::LifecycleSignalType mPauseSignal;
198  Dali::LifecycleController::LifecycleSignalType mResumeSignal;
199  Dali::LifecycleController::LifecycleSignalType mResetSignal;
200  Dali::LifecycleController::LifecycleSignalType mResizeSignal;
201  Dali::LifecycleController::LifecycleSignalType mLanguageChangedSignal;
202 
203 };
204 
205 } // namespace Adaptor
206 
207 } // namespace Internal
208 
209 // Additional Helpers for public-api forwarding methods
210 
211 inline Internal::Adaptor::LifecycleController& GetImplementation(Dali::LifecycleController& controller)
212 {
213  DALI_ASSERT_ALWAYS(controller && "Controller handle is empty");
214  BaseObject& handle = controller.GetBaseObject();
215  return static_cast<Internal::Adaptor::LifecycleController&>(handle);
216 }
217 
218 inline const Internal::Adaptor::LifecycleController& GetImplementation(const Dali::LifecycleController& controller)
219 {
220  DALI_ASSERT_ALWAYS(controller && "Controller handle is empty");
221  const BaseObject& handle = controller.GetBaseObject();
222  return static_cast<const Internal::Adaptor::LifecycleController&>(handle);
223 }
224 
225 } // namespace Dali
226 
227 #endif // __DALI_INTERNAL_LIFECYCLE_CONTROLLER_H__
Dali Docs Home
Read more about Dali