The base class of event listener. More...
#include <CCEventListener.h>
Public Types | |
enum | Type { UNKNOWN, TOUCH_ONE_BY_ONE, TOUCH_ALL_AT_ONCE, KEYBOARD, MOUSE, ACCELERATION, CUSTOM } |
typedef std::string | ListenerID |
Public Member Functions | |
virtual | ~EventListener () |
Destructor. More... | |
virtual bool | checkAvailable ()=0 |
Checks whether the listener is available. More... | |
var | checkAvailable () |
Checks whether the listener is available. More... | |
local | checkAvailable () |
Checks whether the listener is available. More... | |
virtual EventListener * | clone ()=0 |
Clones the listener, its subclasses have to override this method. More... | |
local | clone () |
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... | |
unsigned int | getReferenceCount () const |
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... | |
bool | init (Type t, ListenerID listenerID, std::function< void(Event *)>callback) |
Initializes event with type and callback function. More... | |
local | init ( local t, local listenerID, local callback) |
Initializes event with type and callback function. More... | |
void | setPaused (bool paused) |
bool | isPaused () const |
void | setRegistered (bool registered) |
local | setRegistered ( local registered) |
bool | isRegistered () const |
Type | getType () const |
const ListenerID & | getListenerID () const |
var | getListenerID () |
local | getListenerID () |
void | setFixedPriority (int fixedPriority) |
var | setFixedPriority ( var fixedPriority) |
local | setFixedPriority ( local fixedPriority) |
int | getFixedPriority () const |
void | setSceneGraphPriority (Node *node) |
Node * | getSceneGraphPriority () const |
Protected Attributes | |
std::function< void(Event *)> | _onEvent |
var | _onEvent |
local | _onEvent |
Type | _type |
Event callback function. More... | |
var | _type |
Event callback function. More... | |
local | _type |
Event callback function. More... | |
ListenerID | _listenerID |
Event listener type. More... | |
var | _listenerID |
Event listener type. More... | |
local | _listenerID |
Event listener type. More... | |
bool | _isRegistered |
Event listener ID. More... | |
var | _isRegistered |
Event listener ID. More... | |
local | _isRegistered |
Event listener ID. More... | |
int | _fixedPriority |
Whether the listener has been added to dispatcher. More... | |
Node * | _node |
bool | _paused |
var | _paused |
local | _paused |
![]() | |
unsigned int | _referenceCount |
count of references More... | |
Friends | |
class | EventDispatcher |
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 EventListenerAcceleration, EventListenerKeyboard, EventListenerTouchOneByOne, EventListenerCustom.
typedef std::string ListenerID |
var ListenerID |
local ListenerID |
|
strong |
|
strong |
|
strong |
|
protected |
Constructor.
|
protected |
Constructor.
|
protected |
Constructor.
|
virtual |
Destructor.
|
virtual |
Destructor.
|
virtual |
Destructor.
|
pure virtual |
Checks whether the listener is available.
Implemented in EventListenerTouchAllAtOnce, EventListenerCustom, EventListenerTouchOneByOne, EventListenerKeyboard, EventListenerMouse, and EventListenerAcceleration.
|
pure virtual |
Checks whether the listener is available.
Implemented in EventListenerTouchAllAtOnce, EventListenerCustom, EventListenerTouchOneByOne, EventListenerKeyboard, EventListenerMouse, and EventListenerAcceleration.
|
pure virtual |
Checks whether the listener is available.
Implemented in EventListenerTouchAllAtOnce, EventListenerCustom, EventListenerTouchOneByOne, EventListenerKeyboard, EventListenerMouse, and EventListenerAcceleration.
|
pure virtual |
Clones the listener, its subclasses have to override this method.
Implemented in EventListenerTouchAllAtOnce, EventListenerCustom, EventListenerTouchOneByOne, EventListenerKeyboard, EventListenerMouse, and EventListenerAcceleration.
|
pure virtual |
Clones the listener, its subclasses have to override this method.
Implemented in EventListenerTouchAllAtOnce, EventListenerCustom, EventListenerTouchOneByOne, EventListenerKeyboard, EventListenerMouse, and EventListenerAcceleration.
|
pure virtual |
Clones the listener, its subclasses have to override this method.
Implemented in EventListenerTouchAllAtOnce, EventListenerCustom, EventListenerTouchOneByOne, EventListenerKeyboard, EventListenerMouse, and EventListenerAcceleration.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
protected |
Initializes event with type and callback function.
|
protected |
Initializes event with type and callback function.
|
protected |
Initializes event with type and callback function.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
friend |
|
friend |
|
friend |
|
protected |
Whether the listener has been added to dispatcher.
|
protected |
Whether the listener has been added to dispatcher.
|
protected |
Whether the listener has been added to dispatcher.
|
protected |
Event listener ID.
|
protected |
Event listener ID.
|
protected |
Event listener ID.
|
protected |
Event listener type.
|
protected |
Event listener type.
|
protected |
Event listener type.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Event callback function.
|
protected |
Event callback function.