Dali 3D User Interface Engine
framework.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_FRAMEWORK_H__
2 #define __DALI_INTERNAL_FRAMEWORK_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
22 #include <string>
24 
25 // INTERNAL INCLUDES
26 #include "abort-handler.h"
27 
28 namespace Dali
29 {
30 
31 namespace Internal
32 {
33 
34 namespace Adaptor
35 {
36 
42 class Framework
43 {
44 public:
45 
49  class Observer
50  {
51  public:
52 
56  virtual void OnInit() {}
57 
61  virtual void OnTerminate() {}
62 
66  virtual void OnPause() {}
67 
71  virtual void OnResume() {}
72 
76  virtual void OnReset() {}
77 
82  virtual void OnAppControl(void *) {}
83 
87  virtual void OnLanguageChanged() {}
88 
92  virtual void OnRegionChanged() {}
93 
97  virtual void OnBatteryLow() {}
98 
102  virtual void OnMemoryLow() {}
103  };
104 
105 public:
106 
113  Framework( Observer& observer, int* argc, char ***argv );
114 
118  ~Framework();
119 
120 public:
121 
125  void Run();
126 
130  void Quit();
131 
136  bool IsMainLoopRunning();
137 
144  void AddAbortCallback( CallbackBase* callback );
145 
149  std::string GetBundleName() const;
150 
154  std::string GetBundleId() const;
155 
156 private:
157 
158  // Undefined
159  Framework(const Framework&);
161 
162 private:
168  bool AppStatusHandler(int type, void *bundleData);
169 
173  void SetBundleName(const std::string& name);
174 
178  void SetBundleId(const std::string& id);
179 
183  void AbortCallback();
184 
188  void InitThreads();
189 
190 private:
193  bool mRunning;
194  int* mArgc;
195  char*** mArgv;
196  std::string mBundleName;
197  std::string mBundleId;
199 
200 private: // impl members
201 
202  struct Impl;
203  Impl* mImpl;
204 
205 };
206 
207 } // namespace Adaptor
208 
209 } // namespace Internal
210 
211 } // namespace Dali
212 
213 #endif // __DALI_INTERNAL_FRAMEWORK_H__
Dali Docs Home
Read more about Dali