2012-04-24 17:13:13 +08:00
|
|
|
#ifndef __CC_APPLICATION_PROTOCOL_H__
|
|
|
|
#define __CC_APPLICATION_PROTOCOL_H__
|
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
|
2012-08-16 10:21:15 +08:00
|
|
|
enum TargetPlatform
|
|
|
|
{
|
|
|
|
kTargetWindows,
|
|
|
|
kTargetLinux,
|
|
|
|
kTargetMacOS,
|
|
|
|
kTargetAndroid,
|
|
|
|
kTargetIphone,
|
|
|
|
kTargetIpad,
|
2012-08-18 05:45:21 +08:00
|
|
|
kTargetBlackBerry,
|
2012-08-16 10:21:15 +08:00
|
|
|
};
|
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
/**
|
|
|
|
* @addtogroup platform
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2012-04-24 17:13:13 +08:00
|
|
|
class CC_DLL CCApplicationProtocol
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual ~CCApplicationProtocol() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Implement CCDirector and CCScene init code here.
|
|
|
|
@return true Initialize success, app continue.
|
|
|
|
@return false Initialize failed, app terminate.
|
|
|
|
*/
|
|
|
|
virtual bool applicationDidFinishLaunching() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief The function be called when the application enter background
|
|
|
|
@param the pointer of the application
|
|
|
|
*/
|
|
|
|
virtual void applicationDidEnterBackground() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief The function be called when the application enter foreground
|
|
|
|
@param the pointer of the application
|
|
|
|
*/
|
|
|
|
virtual void applicationWillEnterForeground() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Callback by CCDirector for limit FPS.
|
|
|
|
@interval The time, which expressed in second in second, between current frame and next.
|
|
|
|
*/
|
|
|
|
virtual void setAnimationInterval(double interval) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
@brief Get current language config
|
|
|
|
@return Current language config
|
|
|
|
*/
|
|
|
|
virtual ccLanguageType getCurrentLanguage() = 0;
|
2012-06-11 14:36:25 +08:00
|
|
|
|
2012-08-16 10:21:15 +08:00
|
|
|
/**
|
|
|
|
@brief Get target platform
|
|
|
|
*/
|
|
|
|
virtual TargetPlatform getTargetPlatform() = 0;
|
2012-04-24 17:13:13 +08:00
|
|
|
};
|
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
// end of platform group
|
|
|
|
/// @}
|
|
|
|
|
2012-04-24 17:13:13 +08:00
|
|
|
NS_CC_END
|
|
|
|
|
|
|
|
#endif // __CC_APPLICATION_PROTOCOL_H__
|