34 virtual void close() = 0;
52 #if JUCE_MODAL_LOOPS_PERMITTED
54 return runSync (std::move (native));
70 nativeImplementation->close();
79 result->self = result;
80 result->triggerAsyncUpdate();
86 auto local = std::move (p);
87 return local !=
nullptr ? local->runSync() : 0;
95 : callback (std::move (c)), nativeImplementation (std::move (p)) {}
97 void handleAsyncUpdate()
override
105 if (auto* cb = locked->callback.get())
106 cb->modalStateFinished (result);
108 locked->self.reset();
Has a callback method that is triggered asynchronously.
void cancelPendingUpdate() noexcept
This will stop any pending updates from happening.
static bool callAsync(std::function< void()> functionToCall)
Asynchronously invokes a function or C++11 lambda on the message thread.
static MessageManager * getInstance()
Returns the global instance of the MessageManager.
static ModalComponentManager::Callback * create(CallbackFn &&fn)
This is a utility function to create a ModalComponentManager::Callback that will call a callable obje...
Receives callbacks when a modal component is dismissed.
Objects of this type can be used to programmatically close message boxes.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
std::unique_ptr< T > rawToUniquePtr(T *ptr)
Converts an owning raw pointer into a unique_ptr, deriving the type of the unique_ptr automatically.