35 #include "showfullobject.h" 37 #include "eventinfo.h" 43 class AboutToBeShownListener;
44 class HasBeenHiddenListener;
45 class SaveAsDialogueCompletedListener;
46 class SaveAsSaveToFileHandler;
47 class SaveAsFillBufferHandler;
48 class SaveAsSaveCompletedListener;
67 enum { TOOLBOX_CLASS = 0x82bc0 };
102 SaveAs(
const std::string &template_name) :
ShowFullObject(template_name) {check_toolbox_class(SaveAs::TOOLBOX_CLASS);}
159 void title(std::string value) {string_property(1, value);}
164 std::string
title()
const {
return string_property(2);}
169 void file_name(std::string value) {string_property(3, value);}
174 std::string
file_name()
const {
return string_property(4);}
201 void set_data_address(
void *data,
int size,
void *selection = 0,
int selection_size = 0);
202 void buffer_filled(
void *buffer,
int size);
203 void file_save_completed(
bool successful, std::string file_name);
241 bool save_done()
const {
return ((_data.word[3]&1) != 0);}
283 bool safe()
const {
return (_data.word[3] & 2) != 0;}
294 const std::string
file_name()
const {
return reinterpret_cast<const char *
>(&_data.word[5]);}
329 virtual void saveas_save_to_file(
SaveAs saveas,
bool selection, std::string file_name) = 0;
358 virtual void saveas_fill_buffer(
SaveAs saveas,
bool selection,
int size,
void *buffer,
int already_transmitted) = 0;
bool selection_saved() const
Check if save was of the selection.
Definition: saveas.h:278
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:34
SaveAs()
Construct creates an unassigned SaveAs.
Definition: saveas.h:74
std::string title() const
Get the title for the SaveAs object.
Definition: saveas.h:164
Event information for when saveas dialogue has been completed.
Definition: saveas.h:222
Listener for about to be shown event.
Definition: abouttobeshownlistener.h:76
SaveAsSaveCompletedEvent(IdBlock &id_block, PollBlock &data)
Construct the event from Toolbox and WIMP event data.
Definition: saveas.h:271
Structure holding the raw data from a call to Wimp_Poll.
Definition: pollinfo.h:71
SaveAsDialogueCompletedEvent(IdBlock &id_block, PollBlock &data)
Construct the event from Toolbox and WIMP event data.
Definition: saveas.h:231
SaveAs & operator=(const SaveAs &other)
Assign this SaveAs from another.
Definition: saveas.h:119
Classes to use/edit toolbox resources in memory.
const std::string file_name() const
Full file name of file location if save was safe.
Definition: saveas.h:294
Handler for SaveAsSaveToFile message.
Definition: saveas.h:316
bool save_done() const
Check if the dialogue was closed after a successful save.
Definition: saveas.h:241
SaveAs & operator=(const Object &other)
Assign this SaveAs from an Object that refers to a SaveAs.
Definition: saveas.h:131
std::string file_name() const
Get the file name for the SaveAs object.
Definition: saveas.h:174
void title(std::string value)
Set the title for the SaveAs object.
Definition: saveas.h:159
bool safe() const
Check if the save was to a safe location (e.g.
Definition: saveas.h:283
unsigned int ObjectId
Type for underlying toolbox object id.
Definition: handles.h:31
Event for SaveAsSaveCompletedListener.
Definition: saveas.h:262
int file_type() const
Get the file type from the SaveAs object.
Definition: saveas.h:184
Listener for when the save as dialogue box has been closed.
Definition: saveas.h:247
void file_size(int value)
Set the file size for the SaveAs object.
Definition: saveas.h:189
bool operator==(const Object &other) const
Check if this SaveAs refers to the same underlying toolbox object as another.
Definition: saveas.h:139
int file_size() const
Get the file size from the SaveAs object.
Definition: saveas.h:194
The Window object represents a toolbox window.
Definition: window.h:69
void selection_available(bool available)
Set if a selection is available.
Definition: saveas.h:199
Class to provide information on a toolbox event.
Definition: eventinfo.h:48
Base class for all toolbox event listeners.
Definition: listener.h:33
Class for SaveAs object template.
Definition: ressaveas.h:36
int message_id() const
Wimp message of original datasave message or 0 if save wasn't by a drag.
Definition: saveas.h:289
Listener for an object has been hidden event.
Definition: hasbeenhiddenlistener.h:36
SaveAs(const SaveAs &other)
Construct a SaveAs from another SaveAs.
Definition: saveas.h:83
void file_type(int value)
Set the file type for the SaveAs object.
Definition: saveas.h:179
Window window() const
Return the underlying toolbox window used to implement the SaveAs object.
Definition: saveas.h:154
Listener for when a save has been completed.
Definition: saveas.h:300
Objects derived from this class can be shown with there full location and size specified as well as t...
Definition: showfullobject.h:40
Information passed back by the Toolbox with each toolbox event providing information on where the eve...
Definition: pollinfo.h:41
SaveAs(const std::string &template_name)
Create a SaveAs from the named template.
Definition: saveas.h:102
Class to manipulate a toolbox object.
Definition: object.h:50
Handler for SaveAsFillBuffer message.
Definition: saveas.h:337
SaveAs(const Object &other)
Construct a SaveAs from an Object that refers to a SaveAs.
Definition: saveas.h:94
bool operator!=(const Object &other) const
Check if this SaveAs does not refers to the same underlying toolbox object as another.
Definition: saveas.h:147
Class to show the RISC OS SaveAs dialog box and generate events to allow the application to do the Sa...
Definition: saveas.h:64
ObjectId handle() const
Return the underlying toolbox object id this object references.
Definition: object.h:93
void file_name(std::string value)
Set the file name for the save as object.
Definition: saveas.h:169