The base class of event listener. More...
#include <CCEventListener.h>
Public Member Functions | |
virtual | ~EventListener () |
Destructor. More... | |
virtual bool | checkAvaiable ()=0 |
Checks whether the listener is available. More... | |
virtual EventListener * | clone ()=0 |
Clones the listener, its subclasses have to override this method. More... | |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
void | release () |
Release the ownership immediately. More... | |
void | retain () |
Retains the ownership. More... | |
Object * | autorelease () |
Release the ownership sometime soon automatically. More... | |
bool | isSingleReference () const |
Returns a boolean value that indicates whether there is only one reference to the object. More... | |
unsigned int | retainCount () const |
Returns the object's current reference count. More... | |
virtual bool | isEqual (const Object *object) |
Returns a boolean value that indicates whether this object and a given object are equal. More... | |
virtual void | acceptVisitor (DataVisitor &visitor) |
virtual void | update (float dt) |
Protected Member Functions | |
EventListener () | |
Constructor. More... | |
EventListener () | |
Constructor. More... | |
bool | init (const std::string &t, std::function< void(Event *)>callback) |
Initializes event with type and callback function. More... | |
local | init ( local t, local callback) |
Initializes event with type and callback function. More... | |
Protected Attributes | |
std::function< void(Event *)> | _onEvent |
local | _onEvent |
std::string | _type |
Event callback function. More... | |
var | _type |
Event callback function. More... | |
local | _type |
Event callback function. More... | |
bool | _isRegistered |
Event type. More... | |
![]() | |
unsigned int | _reference |
count of references More... | |
var | _reference |
count of references More... | |
local | _reference |
count of references More... | |
unsigned int | _autoReleaseCount |
count of autorelease More... | |
var | _autoReleaseCount |
count of autorelease More... | |
local | _autoReleaseCount |
count of autorelease More... | |
Friends | |
class | EventDispatcher |
Whether the listener has been added to dispatcher. More... | |
class | Node |
Additional Inherited Members | |
![]() | |
unsigned int | _ID |
object id, ScriptSupport need public _ID More... | |
int | _luaID |
Lua reference id. More... | |
The base class of event listener.
If you need custom listener which with different callback, you need to inherit this class. For instance, you could refer to AccelerationEventListener, KeyboardEventListener or TouchEventListener, CustomEventListener.
|
protected |
Constructor.
|
protected |
Constructor.
|
protected |
Constructor.
|
virtual |
Destructor.
|
virtual |
Destructor.
|
virtual |
Destructor.
|
pure virtual |
Checks whether the listener is available.
Implemented in EventListenerCustom, EventListenerKeyboard, EventListenerTouch, and EventListenerAcceleration.
|
pure virtual |
Checks whether the listener is available.
Implemented in EventListenerCustom, EventListenerKeyboard, EventListenerTouch, and EventListenerAcceleration.
|
pure virtual |
Checks whether the listener is available.
Implemented in EventListenerCustom, EventListenerKeyboard, EventListenerTouch, and EventListenerAcceleration.
|
pure virtual |
Clones the listener, its subclasses have to override this method.
Implemented in EventListenerCustom, EventListenerKeyboard, EventListenerTouch, and EventListenerAcceleration.
|
pure virtual |
Clones the listener, its subclasses have to override this method.
Implemented in EventListenerCustom, EventListenerKeyboard, EventListenerTouch, and EventListenerAcceleration.
|
pure virtual |
Clones the listener, its subclasses have to override this method.
Implemented in EventListenerCustom, EventListenerKeyboard, EventListenerTouch, and EventListenerAcceleration.
|
protected |
Initializes event with type and callback function.
|
protected |
Initializes event with type and callback function.
|
protected |
Initializes event with type and callback function.
|
friend |
Whether the listener has been added to dispatcher.
|
friend |
Whether the listener has been added to dispatcher.
|
friend |
Whether the listener has been added to dispatcher.
|
friend |
|
friend |
|
friend |
|
protected |
Event type.
|
protected |
Event type.
|
protected |
Event type.
|
protected |
|
protected |
|
protected |
|
protected |
Event callback function.
|
protected |
Event callback function.
|
protected |
Event callback function.