36 void messageCallback()
override
38 if (
auto b = broadcaster.get())
39 if (
b->actionListeners.
contains (listener))
55 JUCE_ASSERT_MESSAGE_MANAGER_EXISTS
61 JUCE_ASSERT_MESSAGE_MANAGER_EXISTS
68 if (listener !=
nullptr)
69 actionListeners.
add (listener);
75 actionListeners.removeValue (listener);
81 actionListeners.
clear();
88 for (
int i = actionListeners.
size(); --i >= 0;)
Manages a list of ActionListeners, and can send them messages.
void removeActionListener(ActionListener *listener)
Removes a listener from the list.
ActionBroadcaster()
Creates an ActionBroadcaster.
void addActionListener(ActionListener *listener)
Adds a listener to the list.
virtual ~ActionBroadcaster()
Destructor.
void removeAllActionListeners()
Removes all listeners from the list.
void sendActionMessage(const String &message) const
Broadcasts a message to all the registered listeners.
Interface class for delivery of events that are sent by an ActionBroadcaster.
virtual void actionListenerCallback(const String &message)=0
Overridden by your subclass to receive the callback.
Holds a resizable array of primitive or copy-by-value objects.
ElementType getUnchecked(int index) const
Returns one of the elements in the array, without checking the index passed in.
int size() const noexcept
Returns the current number of elements in the array.
void add(const ElementType &newElement)
Appends a new element at the end of the array.
bool contains(ParameterType elementToLookFor) const
Returns true if the array contains at least one occurrence of an object.
void clear()
Removes all elements from the array.
Internal class used as the base class for all message objects.