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>
38 DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
39 DECLARE_EXCEPTION_TYPE(Base, TooManyInstances)
40 DECLARE_EXCEPTION_TYPE(Base, FrameworkError)
44 static int app_create(void *data);
45 static int app_terminate(void *data);
46 static int app_pause(void *data);
47 static int app_resume(void *data);
48 static int app_reset(bundle *b, void *data);
53 std::string m_applicationName;
55 bool m_mainWindowVisible;
57 virtual void OnCreate();
58 virtual void OnStart();
59 virtual void OnStop();
60 virtual void OnResume();
61 virtual void OnPause();
62 virtual void OnRelaunch();
63 virtual void OnReset(bundle *b);
64 virtual void OnTerminate();
65 virtual void OnLowMemory();
66 virtual void OnLowBattery();
67 virtual void OnLanguageChanged();
72 const std::string &applicationName,
73 bool showMainWindow = true);
74 virtual ~Application();
77 * @brief Execute application and start message processing
82 * @brief Sends quit message to application message loop
87 class ApplicationExt : public Application
90 ApplicationExt(int argc,
92 const std::string &applicationName,
93 bool showMainWindow = true);
94 virtual ~ApplicationExt();
97 * @brief Execute application and start message processing
102 * @brief Sends quit message to application message loop
107 static DPL::Atomic m_useCount;
111 #endif // DPL_APPLICATION_H