c++-gtk-utils: Cgu::FilePrintDialog Class Reference

c++-gtk-utils

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Cgu::FilePrintDialog Class Reference

A print dialog class for FilePrintManager. More...

`#include <c++-gtk-utils/file_print_manager.h>`

Inheritance diagram for Cgu::FilePrintDialog:

## Public Member Functions
GtkPrinter * | get_printer () const
GobjHandle< GtkPrintSettings > | get_settings () const
GtkPageSetup * | get_page_setup () const
| FilePrintDialog (GtkWindow *parent, GtkPrintSettings *print_settings=0, const char *caption=0, GdkPixbuf */const char *window_icon=0)
Public Member Functions inherited from Cgu::WinBase
| WinBase (const WinBase &)=delete
WinBase & | operator= (const WinBase &)=delete
GtkWindow * | get_win () const
int | exec ()
void | show_all ()
void | show ()
| WinBase (const char *caption=0, GdkPixbuf */const char *icon=0, bool modal=false, GtkWindow *parent=0, GtkWindow *window=0)
virtual | ~WinBase ()

## Public Attributes
Emitter | accepted
Emitter | rejected

## Protected Member Functions
virtual void | on_close_request ()
virtual void | on_delete_event ()
Protected Member Functions inherited from Cgu::WinBase
void | close ()
virtual int | get_exec_val () const

## Detailed Description

A print dialog class for FilePrintManager.

See also
  FilePrintManager

This class is not compiled into the library if the library is built with the --without-gtk configuration option.

## Constructor & Destructor Documentation

## ◆ FilePrintDialog()

Cgu::FilePrintDialog::FilePrintDialog | ( | GtkWindow * | parent,
|  | GtkPrintSettings * | print_settings = `0`,
|  | const char * | caption = `0`,
|  | GdkPixbuf */const char * | window_icon = `0`
| ) |  |

The constructor will not throw. A FIlePrintDialog object must be created in the thread in which the main GTK event loop runs.

Parameters

  parent | The parent of the print dialog (NULL may be passed).
  print_settings | The print settings from a previous print job (if any, NULL may be passed if none).
  caption | Window caption (optional, NULL may be passed).
  window_icon | An icon which will comprise the window icon (optional - NULL or nullptr may be passed). For GTK-2 and GTK-3 this is of type GdkPixbuf*. For GTK-4 this is of type const char*, representing an icon theme name rather than the icon itself.

## Member Function Documentation

## ◆ get_page_setup()

GtkPageSetup* Cgu::FilePrintDialog::get_page_setup | ( |  | ) | const

Gets the printer page set-up from the print dialog. It will not throw. It must be called in the thread in which the main GTK event loop runs.

Returns
  The printer page set-up in the print dialog. The return value is owned by GTK - do not unreference it.

## ◆ get_printer()

GtkPrinter* Cgu::FilePrintDialog::get_printer | ( |  | ) | const

Gets the currently selected printer from the print dialog. It will not throw. It must be called in the thread in which the main GTK event loop runs.

Returns
  The currently selected printer in the print dialog. The return value is owned by GTK - do not unreference it.

## ◆ get_settings()

GobjHandle<GtkPrintSettings> Cgu::FilePrintDialog::get_settings | ( |  | ) | const

Gets the print settings from the print dialog. It will not throw. It must be called in the thread in which the main GTK event loop runs.

Returns
  The currently selected printer in the print dialog. Ownership is taken of the return value, by GobjHandle.

## ◆ on_close_request()

virtual void Cgu::FilePrintDialog::on_close_request | ( |  | ) |
| protectedvirtual

Closes the dialog, cleans up and emits the rejected Emitter object. It will not throw, even if a method connected to the rejected Emitter object throws (the exception is caught and reported in order to prevent it trying to propagate through the GTK event system).

This function is only used where the library is compiled against GTK-4. Where this library is compiled against GTK-2 or GTK-3, the on_delete_event() function is used instead.

Since 2.2.16

Reimplemented from Cgu::WinBase.

## ◆ on_delete_event()

virtual void Cgu::FilePrintDialog::on_delete_event | ( |  | ) |
| protectedvirtual

Closes the dialog, cleans up and emits the rejected Emitter object. It will not throw, even if a method connected to the rejected Emitter object throws (the exception is caught and reported in order to prevent it trying to propagate through the GTK event system).

This function is only used where the library is compiled against GTK-2 and GTK-3. Where this library is compiled against GTK-4, the on_close_request() function is used instead.

Reimplemented from Cgu::WinBase.

## Member Data Documentation

## ◆ accepted

Emitter Cgu::FilePrintDialog::accepted

The accepted Emitter object emits if the user choses OK in the print dialog. Emission of accepted by this class will not throw, even if a method connected to the accepted Emitter object throws (the exception is caught and reported in order to prevent it trying to propagate through the GTK event system).

## ◆ rejected

Emitter Cgu::FilePrintDialog::rejected

The rejected Emitter object emits if the user choses Cancel in the print dialog. Emission of rejected by this class will not throw, even if a method connected to the rejected Emitter object throws (the exception is caught and reported in order to prevent it trying to propagate through the GTK event system).

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

- file_print_manager.h