Manages a list of ActionListeners, and can send them messages. More...
#include <juce_ActionBroadcaster.h>
Public Member Functions | |
ActionBroadcaster () | |
Creates an ActionBroadcaster. More... | |
virtual | ~ActionBroadcaster () |
Destructor. More... | |
void | addActionListener (ActionListener *listener) |
Adds a listener to the list. More... | |
void | removeActionListener (ActionListener *listener) |
Removes a listener from the list. More... | |
void | removeAllActionListeners () |
Removes all listeners from the list. More... | |
void | sendActionMessage (const String &message) const |
Broadcasts a message to all the registered listeners. More... | |
Private Attributes | |
CriticalSection | actionListenerLock |
SortedSet< ActionListener * > | actionListeners |
Friends | |
class | ActionMessage |
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.
{Events}
juce::ActionBroadcaster::ActionBroadcaster | ( | ) |
Creates an ActionBroadcaster.
|
virtual |
Destructor.
void juce::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 juce::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 juce::ActionBroadcaster::removeAllActionListeners | ( | ) |
Removes all listeners from the list.
void juce::ActionBroadcaster::sendActionMessage | ( | const String & | message | ) | const |
Broadcasts a message to all the registered listeners.
|
friend |
|
private |
|
private |