35 #include "pointerinfo.h"
36 #include "wimpmessagelistener.h"
42 class SaverSaveToFileHandler;
43 class SaverFillBufferHandler;
44 class SaverSaveCompletedHandler;
45 class SaverFinishedHandler;
77 virtual ~SaverImpl() {}
85 std::string _leaf_name;
95 void add_ref() {_ref_count++;}
96 void release() {
if (--_ref_count == 0)
delete this;}
98 void send_data_load(
const std::string &file_name);
99 void transfer_data(
void *buffer,
int size);
100 void finished(
bool saved);
104 Saver(SaverImpl *impl);
105 friend class SaverImpl;
132 std::string
leaf_name()
const {
return _impl->_leaf_name;}
149 bool safe()
const {
return _impl->_safe;}
236 std::string _file_name;
246 _saver(saver), _safe(safe), _file_name(file_name)
252 bool safe()
const {
return _safe;}
257 const std::string
file_name()
const {
return _file_name;}
Class to store and fetch information about the WIMP mouse pointer.
Definition: pointerinfo.h:43
void buffer_filled(void *buffer, int size)
Call in a RAM transfer when another buffer has been made available.
Definition: saver.cc:115
virtual void saver_finished(const SaverFinishedEvent &finished)=0
Called when the saver has finished.
Event information for when saver dialogue has been completed.
Definition: saver.h:188
Saver()
Constructor for an uninitialised save operation.
Definition: saver.cc:46
int file_type() const
Get the file type from the save.
Definition: saver.h:137
Saver & operator=(const Saver &other)
Assign this saver from another.
Definition: saver.cc:81
Handler for SaverFillBuffer handler.
Definition: saver.h:300
SaverSaveCompletedEvent(const Saver &saver, bool safe, const std::string &file_name)
Construct save completed event.
Definition: saver.h:245
int file_size() const
Get the file size from the SaveAs object.
Definition: saver.h:142
virtual void saver_fill_buffer(Saver saver, int size, void *buffer, int already_transmitted)=0
Called when the buffer need to be refilled for a RAM transfer (type 3) save.
Class to give the same interface to saving to an external application as the SaveAs dialogue...
Definition: saver.h:60
Listener to handle WimpRecordedMessages (event code 18)
Definition: wimpmessagelistener.h:269
void set_save_to_file_handler(SaverSaveToFileHandler *handler)
Handler called to save to a file.
Definition: saver.h:174
std::string leaf_name() const
Get the proposed leaf name for the file to be saved.
Definition: saver.h:132
void set_fill_buffer_handler(SaverFillBufferHandler *handler)
Handler called to fill the buffers for a RAM transfer.
Definition: saver.h:181
Wimp message received event.
Definition: wimpmessagelistener.h:209
Listener to handle WimpAcnowledgeMessages (event code 19)
Definition: wimpmessagelistener.h:289
Handler to save data to a file.
Definition: saver.h:279
void file_save_completed(bool successful, std::string file_name)
Call this after saving a file in the SaveAsSaveToFileListener.
Definition: saver.cc:126
SaverFinishedEvent(Saver &saver, bool saved)
Construct event from a Saver.
Definition: saver.h:199
Listener to handle WimpUserMessages (event code 17)
Definition: wimpmessagelistener.h:252
bool safe() const
Check if the save was to a safe location (e.g.
Definition: saver.h:252
void set_save_completed_handler(SaverSaveCompletedHandler *handler)
Handler called if the save completed successfully.
Definition: saver.h:167
Event for SaverSaveCompletedHandler.
Definition: saver.h:232
bool safe() const
Check if the save is to a safe locations.
Definition: saver.h:149
bool save_done() const
save_done true if the save was successful
Definition: saver.h:209
bool operator==(const Saver &other) const
Check if two savers are the same underlying save operation.
Definition: saver.h:118
bool operator!=(const Saver &other) const
Check if two savers are not the same underlying save operation.
Definition: saver.h:125
const Saver & saver() const
Return Saver for save that has completed.
Definition: saver.h:204
void save(const PointerInfo &where, const std::string &file_name, int file_type, int file_size)
Start the save.
Definition: saver.cc:98
Listener for when a save has been completed.
Definition: saver.h:263
virtual void saver_save_to_file(Saver saver, std::string file_name)=0
Request to save the file to the specified location.
const std::string file_name() const
Full file name of file location if save was safe.
Definition: saver.h:257
Listener for when the save as dialogue box has been closed.
Definition: saver.h:215
void set_finished_handler(SaverFinishedHandler *handler)
Handler called when the save operation has completed.
Definition: saver.h:161
virtual void saver_save_completed(SaverSaveCompletedEvent &event)=0
Called when a save has been successful.