2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
20 * @brief This file is the implementation file of MVC application support
22 #ifndef DPL_APPLICATION_H
23 #define DPL_APPLICATION_H
25 #include <dpl/exception.h>
26 #include <dpl/framework_efl.h>
27 #include <dpl/framework_appcore.h>
38 DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
39 DECLARE_EXCEPTION_TYPE(Base, TooManyInstances)
40 DECLARE_EXCEPTION_TYPE(Base, FrameworkError)
46 std::string m_applicationName;
48 bool m_mainWindowVisible;
50 static bool app_create(void *data);
51 static void app_terminate(void *data);
52 static void app_pause(void *data);
53 static void app_resume(void *data);
54 static void app_control(app_control_h app_control, void *data);
56 virtual void OnCreate();
57 virtual void OnStart();
58 virtual void OnStop();
59 virtual void OnResume();
60 virtual void OnPause();
61 virtual void OnRelaunch();
62 virtual void OnReset(bundle *b);
63 virtual void OnTerminate();
64 virtual void OnLowMemory();
65 virtual void OnLowBattery();
66 virtual void OnLanguageChanged();
71 const std::string &applicationName,
72 bool showMainWindow = true);
73 virtual ~Application();
76 * @brief Execute application and start message processing
81 * @brief Sends quit message to application message loop
86 class ApplicationExt : public Application
89 ApplicationExt(int argc,
91 const std::string &applicationName,
92 bool showMainWindow = true);
93 virtual ~ApplicationExt();
96 * @brief Execute application and start message processing
101 * @brief Sends quit message to application message loop
106 static std::atomic<int> m_useCount;
110 #endif // DPL_APPLICATION_H