2012-08-28 14:53:52 +08:00
|
|
|
|
|
|
|
class CCNotificationCenter : public CCObject
|
|
|
|
{
|
2013-05-24 11:42:27 +08:00
|
|
|
CCNotificationCenter();
|
|
|
|
|
|
|
|
~CCNotificationCenter();
|
|
|
|
|
2013-07-12 23:58:31 +08:00
|
|
|
// XXX deprecated
|
|
|
|
static CCNotificationCenter *sharedNotificationCenter(void);
|
2013-05-24 11:42:27 +08:00
|
|
|
static void purgeNotificationCenter(void);
|
|
|
|
|
2013-07-12 23:58:31 +08:00
|
|
|
static CCNotificationCenter* getInstance();
|
|
|
|
static void destroyInstance();
|
|
|
|
|
2013-05-24 11:42:27 +08:00
|
|
|
int removeAllObservers(CCObject *target);
|
|
|
|
|
|
|
|
void registerScriptObserver(CCObject *target,LUA_FUNCTION funcID,const char* name);
|
|
|
|
|
|
|
|
void unregisterScriptObserver(CCObject *target,const char* name);
|
|
|
|
|
2012-08-28 14:53:52 +08:00
|
|
|
void postNotification(const char *name);
|
2013-05-24 11:42:27 +08:00
|
|
|
|
|
|
|
void postNotification(const char *name, CCObject *object);
|
|
|
|
|
|
|
|
int getScriptHandler();
|
|
|
|
|
|
|
|
int getObserverHandlerByName(const char* name);
|
2012-08-28 14:53:52 +08:00
|
|
|
};
|