32 #ifndef TBX_PREQUITLISTENER_H_
33 #define TBX_PREQUITLISTENER_H_
35 #include "wimpmessagelistener.h"
132 static PreQuitManager *_instance;
133 std::vector<PreQuitListener *> _listeners;
137 static PreQuitManager *instance() {
return _instance;}
139 void add_listener(PreQuitListener *listener);
140 void remove_listener(PreQuitListener *listener);
142 virtual void recorded_message(WimpMessageEvent &event,
int reply_to);
QuitRestarter & operator=(const QuitRestarter &other)
Assignment operator.
Definition: prequitlistener.cc:66
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
PreQuitEvent(const WimpMessage &m, int reply_to)
Construct PreQuitEvent from prequit message received from the WIMP.
Definition: prequitlistener.cc:109
Listen for the pre quit message from the desktop.
Definition: prequitlistener.h:110
void cancel_quit()
Cancel the quit preceeded by this pre-quit message.
Definition: prequitlistener.cc:120
QuitRestarter()
Construct a quit restarter that will just close the current application when restart_quit is called.
Definition: prequitlistener.cc:49
QuitRestarter quit_restarter() const
Return a class that can be used to restart the quit.
Definition: prequitlistener.h:103
void close_application_only(bool close_only)
Set the QuitRestarter to close this application and not continue a desktop shutdown.
Definition: prequitlistener.h:65
Listener to handle WimpRecordedMessages (event code 18)
Definition: wimpmessagelistener.h:270
Event passed to pre quit listeners.
Definition: prequitlistener.h:83
virtual void pre_quit(PreQuitEvent &event)=0
Called when the prequit message has been received from the desktop.
Wimp message information.
Definition: wimpmessagelistener.h:37
bool cancelled() const
Quit has already been cancelled by a previous pre-quit handler.
Definition: prequitlistener.h:98
bool close_application_only() const
Check if this QuitRestarter will close the current application only.
Definition: prequitlistener.h:73
Base class for all toolbox event listeners.
Definition: listener.h:34
Class to allow a quit cancelled during the prequit message to be restarted.
Definition: prequitlistener.h:46
void restart_quit()
Restart a quit application cancelled during a PreQuit message.
Definition: prequitlistener.cc:91