2013-04-30 00:14:11 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2013 cocos2d-x.org
|
|
|
|
Copyright (c) 2013 Lee, Jae-Hong
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2013-04-30 00:26:28 +08:00
|
|
|
#ifndef _CCOSPAPPLICATION_H_
|
|
|
|
#define _CCOSPAPPLICATION_H_
|
2013-04-30 00:14:11 +08:00
|
|
|
|
|
|
|
#include <FApp.h>
|
|
|
|
#include <FUi.h>
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
typedef void (*OspApplicationInitialized)(void);
|
2013-04-30 00:14:11 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
class OspApplication
|
2013-04-30 00:14:11 +08:00
|
|
|
: public Tizen::App::Application
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* [OspApplication] application must have a factory method that creates an instance of itself.
|
|
|
|
*/
|
|
|
|
static Tizen::App::Application* CreateInstance(void);
|
2013-06-20 14:13:12 +08:00
|
|
|
static OspApplication* GetInstance(void);
|
|
|
|
static void SetApplicationInitializedCallback(OspApplicationInitialized p);
|
2013-05-06 20:25:42 +08:00
|
|
|
static void SetScreenOrientation(Tizen::Ui::Orientation orientation);
|
2013-04-30 00:14:11 +08:00
|
|
|
|
|
|
|
public:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
OspApplication();
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
~OspApplication();
|
2013-04-30 00:14:11 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
Tizen::Ui::Controls::Form* getOspForm();
|
2013-04-30 00:14:11 +08:00
|
|
|
|
|
|
|
virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
|
|
|
|
virtual bool OnAppInitialized(void);
|
|
|
|
virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
|
|
|
|
virtual void OnForeground(void);
|
|
|
|
virtual void OnBackground(void);
|
|
|
|
virtual void OnLowMemory(void);
|
|
|
|
virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
|
|
|
|
virtual void OnScreenOn(void);
|
|
|
|
virtual void OnScreenOff(void);
|
|
|
|
|
|
|
|
protected:
|
2013-06-20 14:13:12 +08:00
|
|
|
static OspApplication* sm_pSharedOspApplication;
|
|
|
|
static OspApplicationInitialized sm_pApplicationInitialized;
|
2013-05-06 20:25:42 +08:00
|
|
|
static Tizen::Ui::Orientation sm_eScreenOrientation;
|
2013-04-30 00:14:11 +08:00
|
|
|
|
|
|
|
private:
|
2013-05-06 20:25:42 +08:00
|
|
|
Tizen::Ui::Controls::Frame* __pFrame;
|
2013-04-30 00:14:11 +08:00
|
|
|
Tizen::Ui::Controls::Form* __pForm;
|
|
|
|
};
|
|
|
|
|
2013-04-30 00:26:28 +08:00
|
|
|
#endif // _CCOSPAPPLICATION_H_
|