1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_VCL_UNX_GTK_INC_GTKPRINTWRAPPER_HXX
11 #define INCLUDED_VCL_UNX_GTK_INC_GTKPRINTWRAPPER_HXX
15 #if defined ENABLE_GTK_PRINT || GTK_CHECK_VERSION(3,0,0)
16 #include <gtk/gtkunixprint.h>
18 #include <osl/module.hxx>
19 #include <sal/types.h>
31 GtkPrintWrapper(const GtkPrintWrapper
&) = delete;
32 GtkPrintWrapper
& operator=(const GtkPrintWrapper
&) = delete;
33 #if defined ENABLE_GTK_PRINT || GTK_CHECK_VERSION(3,0,0)
38 bool supportsPrinting() const;
39 bool supportsPrintSelection() const;
41 // general printing support, since 2.10.0
42 GtkPageSetup
* page_setup_new() const;
44 GtkPrintJob
* print_job_new(const gchar
* title
, GtkPrinter
* printer
, GtkPrintSettings
* settings
, GtkPageSetup
* page_setup
) const;
45 void print_job_send(GtkPrintJob
* job
, GtkPrintJobCompleteFunc callback
, gpointer user_data
, GDestroyNotify dnotify
) const;
46 gboolean
print_job_set_source_file(GtkPrintJob
* job
, const gchar
* filename
, GError
** error
) const;
48 const gchar
* print_settings_get(GtkPrintSettings
* settings
, const gchar
* key
) const;
49 gboolean
print_settings_get_collate(GtkPrintSettings
* settings
) const;
50 void print_settings_set_collate(GtkPrintSettings
* settings
, gboolean collate
) const;
51 gint
print_settings_get_n_copies(GtkPrintSettings
* settings
) const;
52 void print_settings_set_n_copies(GtkPrintSettings
* settings
, gint num_copies
) const;
53 GtkPageRange
* print_settings_get_page_ranges(GtkPrintSettings
* settings
, gint
* num_ranges
) const;
54 void print_settings_set_print_pages(GtkPrintSettings
* settings
, GtkPrintPages pages
) const;
56 GtkWidget
* print_unix_dialog_new() const;
57 void print_unix_dialog_add_custom_tab(GtkPrintUnixDialog
* dialog
, GtkWidget
* child
, GtkWidget
* tab_label
) const;
58 GtkPrinter
* print_unix_dialog_get_selected_printer(GtkPrintUnixDialog
* dialog
) const;
59 void print_unix_dialog_set_manual_capabilities(GtkPrintUnixDialog
* dialog
, GtkPrintCapabilities capabilities
) const;
60 GtkPrintSettings
* print_unix_dialog_get_settings(GtkPrintUnixDialog
* dialog
) const;
61 void print_unix_dialog_set_settings(GtkPrintUnixDialog
* dialog
, GtkPrintSettings
* settings
) const;
63 // print selection support, since 2.17.4
64 void print_unix_dialog_set_support_selection(GtkPrintUnixDialog
* dialog
, gboolean support_selection
) const;
65 void print_unix_dialog_set_has_selection(GtkPrintUnixDialog
* dialog
, gboolean has_selection
) const;
67 #if !GTK_CHECK_VERSION(3,0,0)
72 typedef GtkPageSetup
* (* page_setup_new_t
)();
73 typedef GtkPrintJob
* (* print_job_new_t
)(const gchar
*, GtkPrinter
*, GtkPrintSettings
*, GtkPageSetup
*);
74 typedef void (* print_job_send_t
)(GtkPrintJob
*, GtkPrintJobCompleteFunc
, gpointer
, GDestroyNotify
);
75 typedef gboolean (* print_job_set_source_file_t
)(GtkPrintJob
*, const gchar
*, GError
**);
76 typedef const gchar
* (* print_settings_get_t
)(GtkPrintSettings
*, const gchar
*);
77 typedef gboolean (* print_settings_get_collate_t
)(GtkPrintSettings
*);
78 typedef void (* print_settings_set_collate_t
)(GtkPrintSettings
*, gboolean
);
79 typedef gint (* print_settings_get_n_copies_t
)(GtkPrintSettings
*);
80 typedef void (* print_settings_set_n_copies_t
)(GtkPrintSettings
*, gint
);
81 typedef GtkPageRange
* (* print_settings_get_page_ranges_t
)(GtkPrintSettings
*, gint
*);
82 typedef void (* print_settings_set_print_pages_t
)(GtkPrintSettings
*, GtkPrintPages
);
83 typedef GtkWidget
* (* print_unix_dialog_new_t
)(const gchar
*, GtkWindow
*);
84 typedef void (* print_unix_dialog_add_custom_tab_t
)(GtkPrintUnixDialog
*, GtkWidget
*, GtkWidget
*);
85 typedef GtkPrinter
* (* print_unix_dialog_get_selected_printer_t
)(GtkPrintUnixDialog
*);
86 typedef void (* print_unix_dialog_set_manual_capabilities_t
)(GtkPrintUnixDialog
*, GtkPrintCapabilities
);
87 typedef GtkPrintSettings
* (* print_unix_dialog_get_settings_t
)(GtkPrintUnixDialog
*);
88 typedef void (* print_unix_dialog_set_settings_t
)(GtkPrintUnixDialog
*, GtkPrintSettings
*);
89 typedef void (* print_unix_dialog_set_support_selection_t
)(GtkPrintUnixDialog
*, gboolean
);
90 typedef void (* print_unix_dialog_set_has_selection_t
)(GtkPrintUnixDialog
*, gboolean
);
93 osl::Module m_aModule
;
95 // general printing support, since 2.10.0
96 page_setup_new_t m_page_setup_new
;
97 print_job_new_t m_print_job_new
;
98 print_job_send_t m_print_job_send
;
99 print_job_set_source_file_t m_print_job_set_source_file
;
100 print_settings_get_t m_print_settings_get
;
101 print_settings_get_collate_t m_print_settings_get_collate
;
102 print_settings_set_collate_t m_print_settings_set_collate
;
103 print_settings_get_n_copies_t m_print_settings_get_n_copies
;
104 print_settings_set_n_copies_t m_print_settings_set_n_copies
;
105 print_settings_get_page_ranges_t m_print_settings_get_page_ranges
;
106 print_settings_set_print_pages_t m_print_settings_set_print_pages
;
107 print_unix_dialog_new_t m_print_unix_dialog_new
;
108 print_unix_dialog_add_custom_tab_t m_print_unix_dialog_add_custom_tab
;
109 print_unix_dialog_get_selected_printer_t m_print_unix_dialog_get_selected_printer
;
110 print_unix_dialog_set_manual_capabilities_t m_print_unix_dialog_set_manual_capabilities
;
111 print_unix_dialog_get_settings_t m_print_unix_dialog_get_settings
;
112 print_unix_dialog_set_settings_t m_print_unix_dialog_set_settings
;
114 // print selection support, since 2.17.4
115 print_unix_dialog_set_support_selection_t m_print_unix_dialog_set_support_selection
;
116 print_unix_dialog_set_has_selection_t m_print_unix_dialog_set_has_selection
;
124 #endif // INCLUDED_VCL_UNX_GTK_INC_GTKPRINTWRAPPER_HXX
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */