32 #ifndef TBX_PRINTDBOX_H_
33 #define TBX_PRINTDBOX_H_
35 #include "showfullobject.h"
37 #include "eventinfo.h"
43 class AboutToBeShownListener;
44 class HasBeenHiddenListener;
45 class PrintDboxSetupAboutToBeShownListener;
46 class PrintDboxSetupListener;
47 class PrintDboxPrintListener;
48 class PrintDboxSaveListener;
63 enum { TOOLBOX_CLASS = 0x82b00 };
void add_has_been_hidden_listener(HasBeenHiddenListener *listener)
This event is raised after the PrintDbox dialog has been completed.
Definition: printdbox.cc:89
void add_setup_listener(PrintDboxSetupListener *listener)
Add listener that is called if setup button is pressed and it has no associated window.
Definition: printdbox.cc:136
void remove_setup_about_to_be_shown_listener(PrintDboxSetupAboutToBeShownListener *listener)
Remove listener that is called before the dialog associated with the setup button is shown.
Definition: printdbox.cc:121
int int_property(int property_id) const
Return the value of a property that returns an integer.
Definition: object.cc:477
Class for PrintDbox object template.
Definition: resprintdbox.h:37
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
ShowType
Enumeration describing how the setup box is about to be shown.
Definition: printdbox.h:268
void add_print_listener(PrintDboxPrintListener *listener)
Add listener for when print is selected on the print dialogue.
Definition: printdbox.cc:159
ObjectId handle() const
Return the underlying toolbox object id this object references.
Definition: object.h:93
@ SHOW_FULL_SPEC
Full details of window used.
Definition: printdbox.h:270
int title_length() const
Return title length.
Definition: printdbox.h:214
ShowType show_type() const
Get how the setup windows was shown.
Definition: printdbox.h:279
@ SHOW_DEFAULT
Shown in default place.
Definition: printdbox.h:269
PrintDboxPrintEvent PrintDboxSaveEvent
Event information for the save listener.
Definition: printdbox.h:365
ObjectId _handle
Handle for toolbox object.
Definition: object.h:175
const IdBlock & id_block() const
IdBlock for the current event.
Definition: eventinfo.h:71
std::string string_property(int property_id) const
Return the value of a property that returns text.
Definition: object.cc:519
PrintDbox(const PrintDbox &other)
Construct a PrintDbox from another PrintDbox.
Definition: printdbox.h:79
The Window object represents a toolbox window.
Definition: window.h:70
ShowFullSpec & full_spec()
Get reference to the full specification for the show so it can be modified.
Definition: printdbox.h:302
PollBlock & _data
raw data from the event
Definition: eventinfo.h:53
std::string title() const
Return title.
Definition: printdbox.h:209
bool draft() const
Get draft mode.
Definition: printdbox.h:225
Class to show a toolbox PrintDbox object.
Definition: printdbox.h:61
int copies() const
Get number of copies.
Definition: printdbox.h:183
Listener for Print selected on PrintDbox.
Definition: printdbox.h:371
void draft(bool value)
Set draft mode.
Definition: printdbox.h:220
void add_about_to_be_shown_listener(AboutToBeShownListener *listener)
This event is raised just before the PrintDbox underlying window is about to be shown.
Definition: printdbox.cc:73
PrintDboxSetupAboutToBeShownEvent(IdBlock &id_block, PollBlock &data)
Construct setup about to be shown event from Toolbox and WIMP information.
Definition: printdbox.h:254
Structure holding the raw data from a call to Wimp_Poll.
Definition: pollinfo.h:72
void remove_setup_listener(PrintDboxSetupListener *listener)
Remove listener that is called if setup button is pressed and it has no associated window.
Definition: printdbox.cc:145
Listener for Save selected on PrintDbox.
Definition: printdbox.h:387
PrintDbox(const std::string &template_name)
Create a PrintDbox from the named template.
Definition: printdbox.h:98
Listener for an object has been hidden event.
Definition: hasbeenhiddenlistener.h:36
void all_pages()
Set to all pages.
Definition: printdbox.cc:53
PrintDbox()
Construct creates an unassigned PrintDbox.
Definition: printdbox.h:70
void scale(int pc)
Set percentage to scale by.
Definition: printdbox.h:188
int string_property_length(int property_id) const
Gets the size of a string properties buffer.
Definition: object.cc:572
int start() const
Start page or -1 for all.
Definition: printdbox.h:344
Information passed back by the Toolbox with each toolbox event providing information on where the eve...
Definition: pollinfo.h:42
Print button has been pressed event.
Definition: printdbox.h:325
Point & top_left() const
Get top left coordinate of where the window will be shown.
Definition: printdbox.h:286
void copies(int number)
Set number of copies.
Definition: printdbox.h:178
void sideways(bool value)
Set orientation sideways.
Definition: printdbox.h:199
virtual void printdbox_print(const PrintDboxPrintEvent &event)=0
Method called when the print button is selected.
void check_toolbox_class(int class_id) const
Check if this objects toolbox class is as specified.
Definition: object.cc:122
bool sideways() const
Get orientation sideways.
Definition: printdbox.h:204
PrintDboxPrintEvent(IdBlock &id_block, PollBlock &data)
Construct the PrintDboxEvent from the information returned by the Toolbox/WIMP.
Definition: printdbox.h:333
bool sideways() const
true if orientation was set to sideway, false for upright
Definition: printdbox.h:339
void remove_has_been_hidden_listener(HasBeenHiddenListener *listener)
Remove has been hidden listener.
Definition: printdbox.cc:97
Listener for about to be shown event.
Definition: abouttobeshownlistener.h:77
int scale() const
Scale percentage.
Definition: printdbox.h:359
bool operator==(const Object &other) const
Check if this PrintDbox refers to the same underlying toolbox object as another.
Definition: printdbox.h:135
Class to manipulate a toolbox object.
Definition: object.h:51
Class to represent a position in two dimensional space.
Definition: point.h:37
Base class for all toolbox event listeners.
Definition: listener.h:34
Window setup_window() const
Setup window that is about to be shown.
Definition: printdbox.h:262
virtual void printdbox_setup_about_to_be_shown(const PrintDboxSetupAboutToBeShownEvent &ev)=0
Method called by the listener when the setup dialog is about to be shown.
int end() const
End page.
Definition: printdbox.h:349
Point & top_left()
Get reference to top left coordinate so it can be changed in the event.
Definition: printdbox.h:294
Objects derived from this class can be shown with there full location and size specified as well as t...
Definition: showfullobject.h:41
void remove_print_listener(PrintDboxPrintListener *listener)
Remove listener for when print is selected on the print dialogue.
Definition: printdbox.cc:167
int scale() const
Get percentage to scale by.
Definition: printdbox.h:193
Setup dialog is about to be shown listener.
Definition: printdbox.h:309
virtual void printdbox_setup(const EventInfo &setup_event)=0
Method called when setup is clicked if there is no dialogue.
unsigned int ObjectId
Type for underlying toolbox object id.
Definition: handles.h:31
Window window() const
Return the underlying toolbox window used to implement the PrintDbox object.
Definition: printdbox.h:150
The dialog box associated with the setup button is about to be shown event.
Definition: printdbox.h:246
virtual void printdbox_save(const PrintDboxPrintEvent &event)=0
Method called when the save button is selected.
Structure used to specify exact position and size for an object derived from tbx::ShowFullObject.
Definition: showfullspec.h:46
bool bool_property(int property_id) const
Get a boolean property from the toolbox Cobject.
Definition: object.cc:595
void add_save_listener(PrintDboxSaveListener *listener)
Add listener for save button on print dialogue.
Definition: printdbox.cc:182
void page_range(int start, int end)
Set range of pages.
Definition: printdbox.cc:45
int word[64]
Array containing information return from Wimp_Poll.
Definition: pollinfo.h:76
Listener for Setup presses when there is not dialogue associated with the button.
Definition: printdbox.h:403
int copies() const
Number of copies.
Definition: printdbox.h:354
void add_setup_about_to_be_shown_listener(PrintDboxSetupAboutToBeShownListener *listener)
Add listener that is called before the dialog associated with the setup button is shown.
Definition: printdbox.cc:112
void remove_save_listener(PrintDboxSaveListener *listener)
Remove listener for save button on print dialogue.
Definition: printdbox.cc:190
bool operator!=(const Object &other) const
Check if this PrintDbox does not refers to the same underlying toolbox object as another.
Definition: printdbox.h:143
Class to provide information on a toolbox event.
Definition: eventinfo.h:49
PrintDbox & operator=(const Object &other)
Assign this PrintDbox from an Object that refers to a PrintDbox.
Definition: printdbox.h:127
PrintDbox & operator=(const PrintDbox &other)
Assign this PrintDbox from another.
Definition: printdbox.h:115
PrintDbox(const Object &other)
Construct a PrintDbox from an Object that refers to a PrintDbox.
Definition: printdbox.h:90
void remove_about_to_be_shown_listener(AboutToBeShownListener *listener)
Remove about to be shown listener.
Definition: printdbox.cc:81