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 };
98 PrintDbox(
const std::string &template_name) :
ShowFullObject(template_name) {check_toolbox_class(PrintDbox::TOOLBOX_CLASS);}
158 void page_range(
int start,
int end);
173 void page_range(
int *start,
int *end)
const;
178 void copies(
int number) {int_property(3, number);}
183 int copies()
const {
return int_property(4);}
188 void scale(
int pc) {int_property(5, pc);}
193 int scale()
const {
return int_property(6);}
199 void sideways(
bool value) {bool_property(7, value);}
209 std::string
title()
const {
return string_property(9);}
220 void draft(
bool value) {bool_property(10, value);}
225 bool draft()
const {
return bool_property(11);}
339 bool sideways()
const {
return ((_data.word[3] & 1) != 0);}
344 int start()
const {
return _data.word[4];}
349 int end()
const {
return _data.word[5];}
354 int copies()
const {
return _data.word[6];}
359 int scale()
const {
return _data.word[7];}
412 virtual void printdbox_setup(
const EventInfo &setup_event) = 0;
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:34
void copies(int number)
Set number of copies.
Definition: printdbox.h:178
void sideways(bool value)
Set orientation sideways.
Definition: printdbox.h:199
Window setup_window() const
Setup window that is about to be shown.
Definition: printdbox.h:262
Listener for about to be shown event.
Definition: abouttobeshownlistener.h:76
bool operator==(const Object &other) const
Check if this PrintDbox refers to the same underlying toolbox object as another.
Definition: printdbox.h:135
Point & top_left()
Get reference to top left coordinate so it can be changed in the event.
Definition: printdbox.h:294
int copies() const
Number of copies.
Definition: printdbox.h:354
Structure holding the raw data from a call to Wimp_Poll.
Definition: pollinfo.h:71
int scale() const
Get percentage to scale by.
Definition: printdbox.h:193
Window window() const
Return the underlying toolbox window used to implement the PrintDbox object.
Definition: printdbox.h:150
int end() const
End page.
Definition: printdbox.h:349
Classes to use/edit toolbox resources in memory.
Structure used to specify exact position and size for an object derived from tbx::ShowFullObject.
Definition: showfullspec.h:45
Listener for Setup presses when there is not dialogue associated with the button. ...
Definition: printdbox.h:402
bool sideways() const
true if orientation was set to sideway, false for upright
Definition: printdbox.h:339
PrintDbox & operator=(const Object &other)
Assign this PrintDbox from an Object that refers to a PrintDbox.
Definition: printdbox.h:127
PrintDbox(const Object &other)
Construct a PrintDbox from an Object that refers to a PrintDbox.
Definition: printdbox.h:90
Class for PrintDbox object template.
Definition: resprintdbox.h:36
int scale() const
Scale percentage.
Definition: printdbox.h:359
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 represent a position in two dimensional space.
Definition: point.h:36
unsigned int ObjectId
Type for underlying toolbox object id.
Definition: handles.h:31
PrintDbox & operator=(const PrintDbox &other)
Assign this PrintDbox from another.
Definition: printdbox.h:115
int title_length() const
Return title length.
Definition: printdbox.h:214
PrintDbox(const PrintDbox &other)
Construct a PrintDbox from another PrintDbox.
Definition: printdbox.h:79
ShowType
Enumeration describing how the setup box is about to be shown.
Definition: printdbox.h:267
ShowFullSpec & full_spec()
Get reference to the full specification for the show so it can be modified.
Definition: printdbox.h:302
Class to show a toolbox PrintDbox object.
Definition: printdbox.h:60
ShowType show_type() const
Get how the setup windows was shown.
Definition: printdbox.h:279
The Window object represents a toolbox window.
Definition: window.h:69
void draft(bool value)
Set draft mode.
Definition: printdbox.h:220
int copies() const
Get number of copies.
Definition: printdbox.h:183
Class to provide information on a toolbox event.
Definition: eventinfo.h:48
Print button has been pressed event.
Definition: printdbox.h:324
Base class for all toolbox event listeners.
Definition: listener.h:33
PrintDboxPrintEvent PrintDboxSaveEvent
Event information for the save listener.
Definition: printdbox.h:365
PrintDbox(const std::string &template_name)
Create a PrintDbox from the named template.
Definition: printdbox.h:98
std::string title() const
Return title.
Definition: printdbox.h:209
bool draft() const
Get draft mode.
Definition: printdbox.h:225
Point & top_left() const
Get top left coordinate of where the window will be shown.
Definition: printdbox.h:286
Listener for an object has been hidden event.
Definition: hasbeenhiddenlistener.h:36
Listener for Save selected on PrintDbox.
Definition: printdbox.h:386
Setup dialog is about to be shown listener.
Definition: printdbox.h:308
void scale(int pc)
Set percentage to scale by.
Definition: printdbox.h:188
int start() const
Start page or -1 for all.
Definition: printdbox.h:344
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
PrintDboxSetupAboutToBeShownEvent(IdBlock &id_block, PollBlock &data)
Construct setup about to be shown event from Toolbox and WIMP information.
Definition: printdbox.h:254
Class to manipulate a toolbox object.
Definition: object.h:50
PrintDbox()
Construct creates an unassigned PrintDbox.
Definition: printdbox.h:70
The dialog box associated with the setup button is about to be shown event.
Definition: printdbox.h:245
Listener for Print selected on PrintDbox.
Definition: printdbox.h:370
PrintDboxPrintEvent(IdBlock &id_block, PollBlock &data)
Construct the PrintDboxEvent from the information returned by the Toolbox/WIMP.
Definition: printdbox.h:333
bool sideways() const
Get orientation sideways.
Definition: printdbox.h:204
ObjectId handle() const
Return the underlying toolbox object id this object references.
Definition: object.h:93