gtkmm: Gtk::PrintUnixDialog Class Reference

# Gtk::PrintUnixDialog Class Reference
[Printing]

PrintUnixDialog implements a print dialog for platforms which don't provide a native print dialog, like Unix. More...

Inherits Gtk::Dialog.

Collaboration diagram for Gtk::PrintUnixDialog:
[legend]

List of all members.

## Public Member Functions

virtual | ~PrintUnixDialog ()
GtkPrintUnixDialog* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkPrintUnixDialog* | gobj () const
| Provides access to the underlying C GtkObject.
| PrintUnixDialog (Gtk::Window& parent, const Glib::ustring& title)
| PrintUnixDialog (const Glib::ustring& title)
void | set_page_setup (const Glib::RefPtr< PageSetup >& page_setup)
| Sets the page setup of the Gtk::PrintUnixDialog.
Glib::RefPtr< PageSetup > | get_page_setup ()
| Gets the page setup that is used by the Gtk::PrintUnixDialog.
Glib::RefPtr< const PageSetup > | get_page_setup () const
| Gets the page setup that is used by the Gtk::PrintUnixDialog.
void | set_current_page (int current_page)
| Sets the current page number.
int | get_current_page () const
| Gets the current page of the Gtk::PrintDialog.
void | set_settings (const Glib::RefPtr< PrintSettings >& print_settings)
| Sets the Gtk::PrintSettings for the Gtk::PrintUnixDialog.
Glib::RefPtr< PrintSettings > | get_settings ()
| Gets a new Gtk::PrintSettings object that represents the current values in the print dialog.
Glib::RefPtr< const PrintSettings > | get_settings () const
| Gets a new Gtk::PrintSettings object that represents the current values in the print dialog.
Glib::RefPtr< Printer > | get_selected_printer ()
| Gets the currently selected printer.
Glib::RefPtr< const Printer > | get_selected_printer () const
| Gets the currently selected printer.
void | add_custom_tab (const Widget& child, const Glib::ustring& tab_label)
void | add_custom_tab (const Widget& child, const Widget& tab_label)
| Adds a custom tab to the print dialog.
void | set_manual_capabilities (PrintCapabilities capabilities)
| This lets you specify the printing capabilities your application supports.
void | get_support_selection (bool support_selection=true)
| Sets whether the print dialog allows user to print a selection.
bool | get_support_selection () const
| Gets the value of Gtk::PrintUnixDialog::support-selection property.
void | set_has_selection (bool has_selection=true)
| Sets whether a selection exists.
bool | get_has_selection () const
| Gets the value of Gtk::PrintUnixDialog::has-selection property.
void | set_embed_page_setup (bool embed=true)
| Embed page size combo box and orientation combo box into page setup page.
bool | get_embed_page_setup () const
| Gets the value of Gtk::PrintUnixDialog::embed-page-setup property.
bool | get_page_setup_set () const
| Gets the page setup that is used by the Gtk::PrintUnixDialog.
Glib::PropertyProxy < Glib::RefPtr< PageSetup > > | property_page_setup ()
| The GtkPageSetup to use.
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< PageSetup > > | property_page_setup () const
| The GtkPageSetup to use.
Glib::PropertyProxy< int > | property_current_page ()
| The current page in the document.
Glib::PropertyProxy_ReadOnly< int > | property_current_page () const
| The current page in the document.
Glib::PropertyProxy < Glib::RefPtr< PrintSettings > > | property_print_settings ()
| The GtkPrintSettings used for initializing the dialog.
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< PrintSettings > > | property_print_settings () const
| The GtkPrintSettings used for initializing the dialog.
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< Printer > > | property_selected_printer () const
| The GtkPrinter which is selected.
Glib::PropertyProxy< bool > | property_manual_capabilities ()
| Capabilities the application can handle.
Glib::PropertyProxy_ReadOnly < bool > | property_manual_capabilities () const
| Capabilities the application can handle.
Glib::PropertyProxy< bool > | property_support_selection ()
| Whether the dialog supports selection.
Glib::PropertyProxy_ReadOnly < bool > | property_support_selection () const
| Whether the dialog supports selection.
Glib::PropertyProxy< bool > | property_has_selection ()
| Whether the application has a selection.
Glib::PropertyProxy_ReadOnly < bool > | property_has_selection () const
| Whether the application has a selection.
Glib::PropertyProxy< bool > | property_embed_page_setup ()
| TRUE if page setup combos are embedded in GtkPrintUnixDialog.
Glib::PropertyProxy_ReadOnly < bool > | property_embed_page_setup () const
| TRUE if page setup combos are embedded in GtkPrintUnixDialog.

## Related Functions

(Note that these are not member functions.)
Gtk::PrintUnixDialog* | wrap (GtkPrintUnixDialog* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

PrintUnixDialog implements a print dialog for platforms which don't provide a native print dialog, like Unix.

It can be used very much like any other GTK+ dialog, at the cost of the portability offered by the high-level printing API exposed through PrintOperation.

In order to print something with PrintUnixDialog, you need to use get_selected_printer() to obtain a Printer object and use it to construct a PrintJob using PrintJob::create().

PrintUnixDialog uses the following response values:

- RESPONSE_OK for the "Print" button
- RESPONSE_APPLY for the "Preview" button
- RESPONSE_CANCEL for the "Cancel" button

Since gtkmm 2.10:

## Constructor & Destructor Documentation

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

Gtk::PrintUnixDialog::PrintUnixDialog | ( | Gtk::Window& | parent,
|  | const Glib::ustring & | title |
| ) |  |  | `[explicit]`

Gtk::PrintUnixDialog::PrintUnixDialog | ( | const Glib::ustring & | title | ) | `[explicit]`

## Member Function Documentation

void Gtk::PrintUnixDialog::add_custom_tab | ( | const Widget& | child,
|  | const Widget& | tab_label |
| ) |  |  |

Adds a custom tab to the print dialog.

Since gtkmm 2.10:

Parameters:

  | child | The widget to put in the custom tab.
  | tab_label | The widget to use as tab label.

void Gtk::PrintUnixDialog::add_custom_tab | ( | const Widget& | child,
|  | const Glib::ustring & | tab_label |
| ) |  |  |

int Gtk::PrintUnixDialog::get_current_page | ( |  | ) | const

Gets the current page of the Gtk::PrintDialog.

Since gtkmm 2.10:

Returns:
  The current page of dialog.

bool Gtk::PrintUnixDialog::get_embed_page_setup | ( |  | ) | const

Gets the value of Gtk::PrintUnixDialog::embed-page-setup property.

Since gtkmm 2.18:

Returns:
  Whether there is a selection.

bool Gtk::PrintUnixDialog::get_has_selection | ( |  | ) | const

Gets the value of Gtk::PrintUnixDialog::has-selection property.

Since gtkmm 2.18:

Returns:
  Whether there is a selection.

Glib::RefPtr<const PageSetup> Gtk::PrintUnixDialog::get_page_setup | ( |  | ) | const

Gets the page setup that is used by the Gtk::PrintUnixDialog.

Since gtkmm 2.10:

Returns:
  The page setup of dialog.

Glib::RefPtr<PageSetup> Gtk::PrintUnixDialog::get_page_setup | ( |  | ) |

Gets the page setup that is used by the Gtk::PrintUnixDialog.

Since gtkmm 2.10:

Returns:
  The page setup of dialog.

bool Gtk::PrintUnixDialog::get_page_setup_set | ( |  | ) | const

Gets the page setup that is used by the Gtk::PrintUnixDialog.

Since gtkmm 2.18:

Returns:
  Whether a page setup was set by user.

Glib::RefPtr<const Printer> Gtk::PrintUnixDialog::get_selected_printer | ( |  | ) | const

Gets the currently selected printer.

Since gtkmm 2.10:

Returns:
  The currently selected printer.

Glib::RefPtr<Printer> Gtk::PrintUnixDialog::get_selected_printer | ( |  | ) |

Gets the currently selected printer.

Since gtkmm 2.10:

Returns:
  The currently selected printer.

Glib::RefPtr<const PrintSettings> Gtk::PrintUnixDialog::get_settings | ( |  | ) | const

Gets a new Gtk::PrintSettings object that represents the current values in the print dialog.

Note that this creates a <emphasis>new object</emphasis>, and you need to unref it if don't want to keep it.

Since gtkmm 2.10:

Returns:
  A new Gtk::PrintSettings object with the values from dialog.

Glib::RefPtr<PrintSettings> Gtk::PrintUnixDialog::get_settings | ( |  | ) |

Gets a new Gtk::PrintSettings object that represents the current values in the print dialog.

Note that this creates a <emphasis>new object</emphasis>, and you need to unref it if don't want to keep it.

Since gtkmm 2.10:

Returns:
  A new Gtk::PrintSettings object with the values from dialog.

Reimplemented from Gtk::Widget.

bool Gtk::PrintUnixDialog::get_support_selection | ( |  | ) | const

Gets the value of Gtk::PrintUnixDialog::support-selection property.

Since gtkmm 2.18:

Returns:
  Whether the application supports print of selection.

void Gtk::PrintUnixDialog::get_support_selection | ( | bool | support_selection = `true` | ) |

Sets whether the print dialog allows user to print a selection.

Since gtkmm 2.18:

Parameters:

  | support_selection | `true` to allow print selection.

const GtkPrintUnixDialog* Gtk::PrintUnixDialog::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Dialog.

GtkPrintUnixDialog* Gtk::PrintUnixDialog::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Dialog.

Glib::PropertyProxy_ReadOnly<int> Gtk::PrintUnixDialog::property_current_page | ( |  | ) | const

The current page in the document.

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<int> Gtk::PrintUnixDialog::property_current_page | ( |  | ) |

The current page in the document.

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::PrintUnixDialog::property_embed_page_setup | ( |  | ) | const

TRUE if page setup combos are embedded in GtkPrintUnixDialog.

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<bool> Gtk::PrintUnixDialog::property_embed_page_setup | ( |  | ) |

TRUE if page setup combos are embedded in GtkPrintUnixDialog.

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::PrintUnixDialog::property_has_selection | ( |  | ) | const

Whether the application has a selection.

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<bool> Gtk::PrintUnixDialog::property_has_selection | ( |  | ) |

Whether the application has a selection.

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::PrintUnixDialog::property_manual_capabilities | ( |  | ) | const

Capabilities the application can handle.

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<bool> Gtk::PrintUnixDialog::property_manual_capabilities | ( |  | ) |

Capabilities the application can handle.

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::RefPtr<PageSetup> > Gtk::PrintUnixDialog::property_page_setup | ( |  | ) | const

The GtkPageSetup to use.

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< Glib::RefPtr<PageSetup> > Gtk::PrintUnixDialog::property_page_setup | ( |  | ) |

The GtkPageSetup to use.

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::RefPtr<PrintSettings> > Gtk::PrintUnixDialog::property_print_settings | ( |  | ) | const

The GtkPrintSettings used for initializing the dialog.

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< Glib::RefPtr<PrintSettings> > Gtk::PrintUnixDialog::property_print_settings | ( |  | ) |

The GtkPrintSettings used for initializing the dialog.

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::RefPtr<Printer> > Gtk::PrintUnixDialog::property_selected_printer | ( |  | ) | const

The GtkPrinter which is selected.

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::PrintUnixDialog::property_support_selection | ( |  | ) | const

Whether the dialog supports selection.

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<bool> Gtk::PrintUnixDialog::property_support_selection | ( |  | ) |

Whether the dialog supports selection.

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::PrintUnixDialog::set_current_page | ( | int | current_page | ) |

Sets the current page number.

If current_page is not -1, this enables the current page choice for the range of pages to print.

Since gtkmm 2.10:

Parameters:

  | current_page | The current page number.

void Gtk::PrintUnixDialog::set_embed_page_setup | ( | bool | embed = `true` | ) |

Embed page size combo box and orientation combo box into page setup page.

Since gtkmm 2.18:

Parameters:

  | embed | Embed page setup selection.

void Gtk::PrintUnixDialog::set_has_selection | ( | bool | has_selection = `true` | ) |

Sets whether a selection exists.

Since gtkmm 2.18:

Parameters:

  | has_selection | `true` indicates that a selection exists.

void Gtk::PrintUnixDialog::set_manual_capabilities | ( | PrintCapabilities | capabilities | ) |

This lets you specify the printing capabilities your application supports.

For instance, if you can handle scaling the output then you pass Gtk::PRINT_CAPABILITY_SCALE. If you don't pass that, then the dialog will only let you select the scale if the printing system automatically handles scaling.

Since gtkmm 2.10:

Parameters:

  | capabilities | The printing capabilities of your application.

void Gtk::PrintUnixDialog::set_page_setup | ( | const Glib::RefPtr< PageSetup >& | page_setup | ) |

Sets the page setup of the Gtk::PrintUnixDialog.

Since gtkmm 2.10:

Parameters:

  | page_setup | A Gtk::PageSetup.

void Gtk::PrintUnixDialog::set_settings | ( | const Glib::RefPtr< PrintSettings >& | print_settings | ) |

Sets the Gtk::PrintSettings for the Gtk::PrintUnixDialog.

Typically, this is used to restore saved print settings from a previous print operation before the print dialog is shown.

Since gtkmm 2.10:

Parameters:

  | settings | A Gtk::PrintSettings, or `0`.

## Friends And Related Function Documentation

Gtk::PrintUnixDialog* wrap | ( | GtkPrintUnixDialog * | 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:

- gtkmm/printunixdialog.h