Main Page Widgets Namespaces Book

# Gtk::Printer Class Reference
[Printing]

Inheritance diagram for Gtk::Printer:

[legend]
List of all members.

## Detailed Description

A Printer object represents a printer.

You only need to deal directly with printers if you use the non-portable PrintUnixDialog API.

A Printer object allows to get status information about the printer, such as its description, its location, the number of queued jobs, etc. Most importantly, a Printer object can be used to create a PrintJob object, which lets you print to the printer.

Since gtkmm 2.10:

## Public Member Functions

bool | accepts_pdf () const
| Return value: `true` if printer accepts PDF.
bool | accepts_ps () const
| Return value: `true` if printer accepts PostScript.
bool | equal (const Glib::RefPtr<Printer>& other) const
PrintCapabilities | get_capabilities () const
| Return value: the printer's capabilities.
Glib::ustring | get_description () const
| Gets the description of the printer.
Glib::ustring | get_icon_name () const
| Gets the name of the icon to use for the printer.
int | get_job_count () const
| Gets the number of jobs currently queued on the printer.
Glib::ustring | get_location () const
| Return value: the location of printer.
Glib::ustring | get_name () const
| Return value: the name of printer.
Glib::ustring | get_state_message () const
| Return value: the state message of printer.
const GtkPrinter* | gobj () const
| Provides access to the underlying C GObject.
GtkPrinter* | gobj ()
| Provides access to the underlying C GObject.
GtkPrinter* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool | has_details () const
| Return value: `true` if printer details are available.
bool | is_active () const
| Return value: `true` if printer is active.
bool | is_default () const
| Return value: `true` if printer is the default.
bool | is_virtual () const
| Return value: `true` if printer is virtual.
Glib::ListHandle< Glib::RefPtr< const PageSetup > > | list_papers () const
| Lists all the paper sizes printer supports.
Glib::ListHandle< Glib::RefPtr< PageSetup > > | list_papers ()
| Lists all the paper sizes printer supports.
Glib::PropertyProxy_ReadOnly< bool > | property_accepts_pdf () const
| TRUE if this printer can accept PDF.
Glib::PropertyProxy_ReadOnly< bool > | property_accepts_ps () const
| TRUE if this printer can accept PostScript.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_icon_name () const
| The icon name to use for the printer.
Glib::PropertyProxy_ReadOnly< bool > | property_is_virtual () const
| FALSE if this represents a real hardware printer.
Glib::PropertyProxy_ReadOnly< int > | property_job_count () const
| Number of jobs queued in the printer.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_location () const
| The location of the printer.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_name () const
| Name of the printer.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_state_message () const
| String giving the current state of the printer.
void | request_details ()
| Requests the printer details.
Glib::SignalProxy1< void, bool > | signal_details_acquired ()

Prototype:
  `void on_my_details_acquired(bool success)`

virtual | ~Printer ()

## Protected Member Functions

virtual void | on_details_acquired (bool success)

## Related Functions

(Note that these are not member functions.)
void | enumerate_printers (const SlotPrinterEnumerator& slot, bool wait=true)
| Calls a function for all Printers.
bool | operator!= (const Glib::RefPtr<Printer>& lhs, const Glib::RefPtr<Printer>& rhs)
bool | operator== (const Glib::RefPtr<Printer>& lhs, const Glib::RefPtr<Printer>& rhs)
typedef sigc::slot< bool, const Glib::RefPtr<Printer >&> | SlotPrinterEnumerator
| For example, bool on_enumerate_printers(const Glib::RefPtr<Printer>& printer);.
Glib::RefPtr<Gtk::Printer> | wrap (GtkPrinter* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Constructor & Destructor Documentation

virtual Gtk::Printer::~Printer | ( |  | ) | `[virtual]`

## Member Function Documentation

bool Gtk::Printer::accepts_pdf | ( |  | ) | const

Return value: `true` if printer accepts PDF.

Returns:
  `true` if printer accepts PDF

Since gtkmm 2.10:

bool Gtk::Printer::accepts_ps | ( |  | ) | const

Return value: `true` if printer accepts PostScript.

Returns:
  `true` if printer accepts PostScript

Since gtkmm 2.10:

bool Gtk::Printer::equal | ( | const Glib::RefPtr<Printer>& | other | ) | const

PrintCapabilities Gtk::Printer::get_capabilities | ( |  | ) | const

Return value: the printer's capabilities.

Returns:
  The printer's capabilities

Since gtkmm 2.12:

Glib::ustring Gtk::Printer::get_description | ( |  | ) | const

Gets the description of the printer.

Returns:
  The description of printer

Since gtkmm 2.10:

Glib::ustring Gtk::Printer::get_icon_name | ( |  | ) | const

Gets the name of the icon to use for the printer.

Returns:
  The icon name for printer

Since gtkmm 2.10:

int Gtk::Printer::get_job_count | ( |  | ) | const

Gets the number of jobs currently queued on the printer.

Returns:
  The number of jobs on printer

Since gtkmm 2.10:

Glib::ustring Gtk::Printer::get_location | ( |  | ) | const

Return value: the location of printer.

Returns:
  The location of printer

Since gtkmm 2.10:

Glib::ustring Gtk::Printer::get_name | ( |  | ) | const

Return value: the name of printer.

Returns:
  The name of printer

Since gtkmm 2.10:

Glib::ustring Gtk::Printer::get_state_message | ( |  | ) | const

Return value: the state message of printer.

Returns:
  The state message of printer

Since gtkmm 2.10:

const GtkPrinter* Gtk::Printer::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GtkPrinter* Gtk::Printer::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GtkPrinter* Gtk::Printer::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

bool Gtk::Printer::has_details | ( |  | ) | const

Return value: `true` if printer details are available.

Returns:
  `true` if printer details are available

Since gtkmm 2.12:

bool Gtk::Printer::is_active | ( |  | ) | const

Return value: `true` if printer is active.

Returns:
  `true` if printer is active

Since gtkmm 2.10:

bool Gtk::Printer::is_default | ( |  | ) | const

Return value: `true` if printer is the default.

Returns:
  `true` if printer is the default

Since gtkmm 2.10:

bool Gtk::Printer::is_virtual | ( |  | ) | const

Return value: `true` if printer is virtual.

Returns:
  `true` if printer is virtual

Since gtkmm 2.10:

Glib::ListHandle<Glib::RefPtr<const PageSetup>> Gtk::Printer::list_papers | ( |  | ) | const

Lists all the paper sizes printer supports.

This will return an empty list unless the printer's details are available. See has_details() and request_details().

Returns:
  A newly allocated list of newly allocated Gtk::PageSetup s.

Since gtkmm 2.12:

Glib::ListHandle<Glib::RefPtr<PageSetup>> Gtk::Printer::list_papers | ( |  | ) |

Lists all the paper sizes printer supports.

This will return an empty list unless the printer's details are available. See has_details() and request_details().

Returns:
  A newly allocated list of newly allocated Gtk::PageSetup s.

Since gtkmm 2.12:

virtual void Gtk::Printer::on_details_acquired | ( | bool | success | ) | `[protected, virtual]`

Glib::PropertyProxy_ReadOnly<bool> Gtk::Printer::property_accepts_pdf | ( |  | ) | const

TRUE if this printer can accept PDF.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::Printer::property_accepts_ps | ( |  | ) | const

TRUE if this printer can accept PostScript.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::Printer::property_icon_name | ( |  | ) | const

The icon name to use for the printer.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::Printer::property_is_virtual | ( |  | ) | const

FALSE if this represents a real hardware printer.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::Printer::property_job_count | ( |  | ) | const

Number of jobs queued in the printer.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::Printer::property_location | ( |  | ) | const

The location of the printer.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::Printer::property_name | ( |  | ) | const

Name of the printer.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::Printer::property_state_message | ( |  | ) | const

String giving the current state of the printer.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::Printer::request_details | ( |  | ) |

Requests the printer details.

When the details are available, the details_acquired signal will be emitted.

Since gtkmm 2.12:

Glib::SignalProxy1< void,bool > Gtk::Printer::signal_details_acquired | ( |  | ) |

Prototype:
  `void on_my_details_acquired(bool success)`

## Friends And Related Function Documentation

void enumerate_printers | ( | const SlotPrinterEnumerator& | slot,
|  | bool | wait = `true` |
| ) |  |  | `[related]`

Calls a function for all Printers.

If the callback returns true, the enumeration is stopped. A function to call for each printer wait If true, wait in a recursive mainloop until all printers are enumerated; otherwise return early.

bool operator!= | ( | const Glib::RefPtr<Printer>& | lhs,
|  | const Glib::RefPtr<Printer>& | rhs |
| ) |  |  | `[related]`

bool operator== | ( | const Glib::RefPtr<Printer>& | lhs,
|  | const Glib::RefPtr<Printer>& | rhs |
| ) |  |  | `[related]`

typedef sigc::slot<bool, const Glib::RefPtr<Printer>&> SlotPrinterEnumerator`[related]`

For example, bool on_enumerate_printers(const Glib::RefPtr<Printer>& printer);.

Parameters:

  | printer | A printer.
  | result | true to stop the enumeration, false to continue.

Glib::RefPtr<Gtk::Printer> wrap | ( | GtkPrinter * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | 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.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- printer.h