gtkmm 4.17.0
|
A PrintJob object represents a job that is sent to a printer. More...
#include <gtkmm/printjob.h>
Public Types | |
typedef sigc::slot< void(const Glib::RefPtr< PrintJob > &)> | SlotPrintJobComplete |
For example, void on_print_job_complete(const Glib::RefPtr<PrintJob>& job);. | |
![]() | |
typedef void(*)(gpointer data | DestroyNotify) |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
Public Member Functions | |
PrintJob (PrintJob &&src) noexcept | |
PrintJob & | operator= (PrintJob &&src) noexcept |
~PrintJob () noexcept override | |
GtkPrintJob * | gobj () |
Provides access to the underlying C GObject. | |
const GtkPrintJob * | gobj () const |
Provides access to the underlying C GObject. | |
GtkPrintJob * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::RefPtr< PrintSettings > | get_settings () |
Gets the Gtk::PrintSettings of the print job. | |
Glib::RefPtr< const PrintSettings > | get_settings () const |
Gets the Gtk::PrintSettings of the print job. | |
Glib::RefPtr< Printer > | get_printer () |
Gets the Gtk::Printer of the print job. | |
Glib::RefPtr< const Printer > | get_printer () const |
Gets the Gtk::Printer of the print job. | |
Glib::ustring | get_title () const |
Gets the job title. | |
PrintStatus | get_status () const |
Gets the status of the print job. | |
void | set_source_file (const std::string &filename) |
Make the Gtk::PrintJob send an existing document to the printing system. | |
Cairo::RefPtr< Cairo::Surface > | get_surface () |
Gets a cairo surface onto which the pages of the print job should be rendered. | |
Cairo::RefPtr< const Cairo::Surface > | get_surface () const |
Gets a cairo surface onto which the pages of the print job should be rendered. | |
void | set_track_print_status (bool track_status=true) |
If track_status is true , the print job will try to continue report on the status of the print job in the printer queues and printer. | |
bool | get_track_print_status () const |
Returns whether jobs will be tracked after printing. | |
void | send (const SlotPrintJobComplete & slot) |
Sends the print job off to the printer. | |
PrintPages | get_pages () const |
Gets the Gtk::PrintPages setting for this job. | |
void | set_pages (PrintPages pages) |
Sets the Gtk::PrintPages setting for this job. | |
std::vector< PageRange > | get_page_ranges () const |
void | set_page_ranges (const std::vector< PageRange > & ranges) |
PageSet | get_page_set () const |
Gets the Gtk::PageSet setting for this job. | |
void | set_page_set (PageSet page_set) |
Sets the Gtk::PageSet setting for this job. | |
int | get_num_copies () const |
Gets the number of copies of this job. | |
void | set_num_copies (int num_copies) |
Sets the number of copies for this job. | |
double | get_scale () const |
Gets the scale for this job. | |
void | set_scale (double scale) |
Sets the scale for this job. | |
guint | get_n_up () const |
Gets the n-up setting for this job. | |
void | set_n_up (guint n_up) |
Sets the n-up setting for this job. | |
NumberUpLayout | get_n_up_layout () const |
Gets the n-up layout setting for this job. | |
void | set_n_up_layout (NumberUpLayout layout) |
Sets the n-up layout setting for this job. | |
bool | get_rotate () const |
Gets whether the job is printed rotated. | |
void | set_rotate (bool rotate=true) |
Sets whether this job is printed rotated. | |
bool | get_collate () const |
Gets whether this job is printed collated. | |
void | set_collate (bool collate=true) |
Sets whether this job is printed collated. | |
bool | get_reverse () const |
Gets whether this job is printed reversed. | |
void | set_reverse (bool reverse=true) |
Sets whether this job is printed reversed. | |
Glib::SignalProxy< void()> | signal_status_changed () |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_title () const |
The title of the print job. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Printer > > | property_printer () const |
The printer to send the job to. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< PrintSettings > > | property_settings () const |
Printer settings. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< PageSetup > > | property_page_setup () const |
Page setup. | |
Glib::PropertyProxy< bool > | property_track_print_status () |
true if the print job will continue to emit status-changed signals after the print data has been setn to the printer. | |
Glib::PropertyProxy_ReadOnly< bool > | property_track_print_status () const |
true if the print job will continue to emit status-changed signals after the print data has been setn to the printer. | |
![]() | |
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&src) noexcept | |
Object & | operator= (Object &&src) noexcept |
void * | get_data (const QueryQuark &key) |
void | set_data (const Quark &key, void *data) |
void | set_data_with_c_callback (const Quark &key, void *data, GDestroyNotify notify) |
void | set_data (const Quark &key, void *data, DestroyNotify notify) |
void | remove_data (const QueryQuark &quark) |
void * | steal_data (const QueryQuark &quark) |
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
![]() | |
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
PropertyType | get_property (const Glib::ustring &property_name) const |
sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot) |
sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot) |
void | freeze_notify () |
void | thaw_notify () |
virtual void | reference () const |
virtual void | unreference () const |
GObject * | gobj () |
const GObject * | gobj () const |
GObject * | gobj_copy () const |
![]() | |
trackable () noexcept | |
trackable (const trackable &src) noexcept | |
trackable (trackable &&src) noexcept | |
~trackable () | |
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= (trackable &&src) noexcept |
void | remove_destroy_notify_callback (notifiable *data) const |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
static Glib::RefPtr< PrintJob > | create (const Glib::ustring &title, const Glib::RefPtr< Printer > &printer, const Glib::RefPtr< PrintSettings > &settings, const Glib::RefPtr< PageSetup > &page_setup) |
Protected Member Functions | |
PrintJob (const Glib::ustring &title, const Glib::RefPtr< Printer > &printer, const Glib::RefPtr< PrintSettings > &settings, const Glib::RefPtr< PageSetup > &page_setup) | |
![]() | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
![]() | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::PrintJob > | wrap (GtkPrintJob *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
A PrintJob object represents a job that is sent to a printer.
You only need to deal directly with print jobs if you use the non-portable PrintUnixDialog API.
Use get_surface() to obtain the cairo surface onto which the pages must be drawn. Use send() to send the finished job to the printer.If you don't use cairo then PrintJob also supports printing of manually generated postscript, via set_source_file().
typedef sigc::slot<void(const Glib::RefPtr<PrintJob>&)> Gtk::PrintJob::SlotPrintJobComplete |
For example, void on_print_job_complete(const Glib::RefPtr<PrintJob>& job);.
exception |
|
noexcept |
|
overridenoexcept |
|
explicitprotected |
|
static |
bool Gtk::PrintJob::get_collate | ( | ) | const |
Gets whether this job is printed collated.
guint Gtk::PrintJob::get_n_up | ( | ) | const |
Gets the n-up setting for this job.
NumberUpLayout Gtk::PrintJob::get_n_up_layout | ( | ) | const |
Gets the n-up layout setting for this job.
int Gtk::PrintJob::get_num_copies | ( | ) | const |
Gets the number of copies of this job.
std::vector< PageRange > Gtk::PrintJob::get_page_ranges | ( | ) | const |
PageSet Gtk::PrintJob::get_page_set | ( | ) | const |
Gets the Gtk::PageSet
setting for this job.
Gtk::PageSet
setting. PrintPages Gtk::PrintJob::get_pages | ( | ) | const |
Gets the Gtk::PrintPages
setting for this job.
Gtk::PrintPages
setting. Glib::RefPtr< Printer > Gtk::PrintJob::get_printer | ( | ) |
Gets the Gtk::Printer
of the print job.
Glib::RefPtr< const Printer > Gtk::PrintJob::get_printer | ( | ) | const |
Gets the Gtk::Printer
of the print job.
bool Gtk::PrintJob::get_reverse | ( | ) | const |
Gets whether this job is printed reversed.
bool Gtk::PrintJob::get_rotate | ( | ) | const |
Gets whether the job is printed rotated.
double Gtk::PrintJob::get_scale | ( | ) | const |
Gets the scale for this job.
Glib::RefPtr< PrintSettings > Gtk::PrintJob::get_settings | ( | ) |
Gets the Gtk::PrintSettings
of the print job.
Glib::RefPtr< const PrintSettings > Gtk::PrintJob::get_settings | ( | ) | const |
Gets the Gtk::PrintSettings
of the print job.
PrintStatus Gtk::PrintJob::get_status | ( | ) | const |
Gets the status of the print job.
Cairo::RefPtr< Cairo::Surface > Gtk::PrintJob::get_surface | ( | ) |
Gets a cairo surface onto which the pages of the print job should be rendered.
Glib::Error |
Cairo::RefPtr< const Cairo::Surface > Gtk::PrintJob::get_surface | ( | ) | const |
Gets a cairo surface onto which the pages of the print job should be rendered.
Glib::Error |
Glib::ustring Gtk::PrintJob::get_title | ( | ) | const |
Gets the job title.
bool Gtk::PrintJob::get_track_print_status | ( | ) | const |
Returns whether jobs will be tracked after printing.
For details, see set_track_print_status().
true
if print job status will be reported after printing.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkPrintJob * Gtk::PrintJob::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< PageSetup > > Gtk::PrintJob::property_page_setup | ( | ) | const |
Page setup.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Printer > > Gtk::PrintJob::property_printer | ( | ) | const |
The printer to send the job to.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< PrintSettings > > Gtk::PrintJob::property_settings | ( | ) | const |
Printer settings.
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::PrintJob::property_title | ( | ) | const |
The title of the print job.
Default value: ""
Glib::PropertyProxy< bool > Gtk::PrintJob::property_track_print_status | ( | ) |
true
if the print job will continue to emit status-changed signals after the print data has been setn to the printer.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gtk::PrintJob::property_track_print_status | ( | ) | const |
true
if the print job will continue to emit status-changed signals after the print data has been setn to the printer.
Default value: false
void Gtk::PrintJob::send | ( | const SlotPrintJobComplete & | slot | ) |
Sends the print job off to the printer.
slot | A function to call when the job completes or an error occurs. |
Sets whether this job is printed collated.
collate | Whether the job is printed collated. |
void Gtk::PrintJob::set_n_up | ( | guint | n_up | ) |
Sets the n-up setting for this job.
n_up | The n-up value. |
void Gtk::PrintJob::set_n_up_layout | ( | NumberUpLayout | layout | ) |
Sets the n-up layout setting for this job.
layout | The n-up layout setting. |
void Gtk::PrintJob::set_num_copies | ( | int | num_copies | ) |
Sets the number of copies for this job.
num_copies | The number of copies. |
void Gtk::PrintJob::set_page_ranges | ( | const std::vector< PageRange > & | ranges | ) |
Sets the Gtk::PageSet
setting for this job.
page_set | A Gtk::PageSet setting. |
void Gtk::PrintJob::set_pages | ( | PrintPages | pages | ) |
Sets the Gtk::PrintPages
setting for this job.
pages | The Gtk::PrintPages setting. |
Sets whether this job is printed reversed.
reverse | Whether the job is printed reversed. |
Sets whether this job is printed rotated.
rotate | Whether to print rotated. |
Sets the scale for this job.
1.0 means unscaled.
scale | The scale. |
void Gtk::PrintJob::set_source_file | ( | const std::string & | filename | ) |
Make the Gtk::PrintJob
send an existing document to the printing system.
The file can be in any format understood by the platforms printing system (typically PostScript, but on many platforms PDF may work too). See Gtk::Printer::accepts_pdf() and Gtk::Printer::accepts_ps().
filename | The file to be printed. |
Glib::Error |
If track_status is true
, the print job will try to continue report on the status of the print job in the printer queues and printer.
This can allow your application to show things like “out of paper” issues, and when the print job actually reaches the printer.
This function is often implemented using some form of polling, so it should not be enabled unless needed.
track_status | true to track status after printing. |
Glib::SignalProxy< void()> Gtk::PrintJob::signal_status_changed | ( | ) |
void on_my_status_changed()
Flags: Run Last
Emitted when the status of a job changes.
The signal handler can use Gtk::PrintJob::get_status() to obtain the new status.
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |