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>
28 #include <dpl/atomic.h>
39 DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
40 DECLARE_EXCEPTION_TYPE(Base, TooManyInstances)
41 DECLARE_EXCEPTION_TYPE(Base, FrameworkError)
45 static int app_create(void *data);
46 static int app_terminate(void *data);
47 static int app_pause(void *data);
48 static int app_resume(void *data);
49 static int app_reset(bundle *b, void *data);
54 std::string m_applicationName;
56 bool m_mainWindowVisible;
58 virtual void OnCreate();
59 virtual void OnStart();
60 virtual void OnStop();
61 virtual void OnResume();
62 virtual void OnPause();
63 virtual void OnRelaunch();
64 virtual void OnReset(bundle *b);
65 virtual void OnTerminate();
66 virtual void OnLowMemory();
67 virtual void OnLowBattery();
68 virtual void OnLanguageChanged();
71 Application(int argc, char **argv, const std::string &applicationName, bool showMainWindow = true);
72 virtual ~Application();
75 * @brief Execute application and start message processing
80 * @brief Sends quit message to application message loop
85 class ApplicationExt : public Application
88 ApplicationExt(int argc, char **argv, const std::string &applicationName, bool showMainWindow = true);
89 virtual ~ApplicationExt();
92 * @brief Execute application and start message processing
97 * @brief Sends quit message to application message loop
101 static DPL::Atomic m_useCount;
106 #endif // DPL_APPLICATION_H