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... | |
Public Member Functions inherited from Ref | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Release the ownership immediately. More... | |
Ref * | autorelease () |
Release the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
Protected Member Functions | |
EventListener () | |
Constructor. More... | |
bool | init (Type t, const ListenerID &listenerID, const std::function< void(Event *)> &callback) |
Initializes event with type and callback function. More... | |
void | setPaused (bool paused) |
bool | isPaused () const |
void | setRegistered (bool 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 Member Functions inherited from Ref | |
Ref () | |
Constructor. More... | |
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 |
Protected Attributes inherited from Ref | |
unsigned int | _referenceCount |
count of references More... | |
Friends | |
class | EventDispatcher |
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.