Manages a list of ActionListeners, and can send them messages. More...
#include <juce_ActionBroadcaster.h>
Public Member Functions | |
ActionBroadcaster () | |
Creates an ActionBroadcaster. | |
virtual | ~ActionBroadcaster () |
Destructor. | |
void | addActionListener (ActionListener *listener) |
Adds a listener to the list. | |
void | removeActionListener (ActionListener *listener) |
Removes a listener from the list. | |
void | removeAllActionListeners () |
Removes all listeners from the list. | |
void | sendActionMessage (const String &message) const |
Broadcasts a message to all the registered listeners. | |
Manages a list of ActionListeners, and can send them messages.
To quickly add methods to your class that can add/remove action listeners and broadcast to them, you can derive from this.
ActionBroadcaster::ActionBroadcaster | ( | ) |
Creates an ActionBroadcaster.
|
virtual |
Destructor.
void ActionBroadcaster::addActionListener | ( | ActionListener * | listener | ) |
Adds a listener to the list.
Trying to add a listener that's already on the list will have no effect.
void ActionBroadcaster::removeActionListener | ( | ActionListener * | listener | ) |
Removes a listener from the list.
If the listener isn't on the list, this won't have any effect.
void ActionBroadcaster::removeAllActionListeners | ( | ) |
Removes all listeners from the list.
void ActionBroadcaster::sendActionMessage | ( | const String & | message | ) | const |
Broadcasts a message to all the registered listeners.