/* Copyright (C) 2006 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
 */

#include <gtkmm/dialog.h>
#include <gtkmm/pagesetup.h>
#include <gtkmm/printer.h>
#include <gtkmm/printjob.h>
#include <gtkmm/printsettings.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/dialog_p.h)

namespace Gtk
{

/** 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
 *
 * @ingroup Printing
 */
class GTKMM_API PrintUnixDialog : public Dialog
{
  _CLASS_GTKOBJECT(PrintUnixDialog, GtkPrintUnixDialog, GTK_PRINT_UNIX_DIALOG, Gtk::Dialog, GtkDialog, , , GTKMM_API)
  _UNMANAGEABLE
  _GTKMMPROC_WIN32_NO_WRAP

public:
  explicit PrintUnixDialog(Gtk::Window& parent, const Glib::ustring& title);
  explicit PrintUnixDialog(const Glib::ustring& title);

  _WRAP_METHOD(void set_page_setup(const Glib::RefPtr<PageSetup>& page_setup), gtk_print_unix_dialog_set_page_setup)
  _WRAP_METHOD(Glib::RefPtr<PageSetup> get_page_setup(), gtk_print_unix_dialog_get_page_setup, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const PageSetup> get_page_setup() const, gtk_print_unix_dialog_get_page_setup, refreturn, constversion)

  _WRAP_METHOD(void set_current_page(int current_page), gtk_print_unix_dialog_set_current_page)
  _WRAP_METHOD(int get_current_page() const, gtk_print_unix_dialog_get_current_page)

  _WRAP_METHOD(void set_settings(const Glib::RefPtr<PrintSettings>& settings), gtk_print_unix_dialog_set_settings)
  _WRAP_METHOD(Glib::RefPtr<PrintSettings> get_settings(), gtk_print_unix_dialog_get_settings, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const PrintSettings> get_settings() const, gtk_print_unix_dialog_get_settings, refreturn, constversion)

  #m4 _CONVERSION(`GtkPrinter*',`Glib::RefPtr<Printer>',`Glib::wrap($3)')
  #m4 _CONVERSION(`GtkPrinter*',`Glib::RefPtr<const Printer>',`Glib::wrap($3)')

  _WRAP_METHOD(Glib::RefPtr<Printer> get_selected_printer(), gtk_print_unix_dialog_get_selected_printer, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Printer> get_selected_printer() const, gtk_print_unix_dialog_get_selected_printer, refreturn, constversion)

  void add_custom_tab(const Widget& child, const Glib::ustring& tab_label);
  _WRAP_METHOD(void add_custom_tab(const Widget& child, const Widget& tab_label), gtk_print_unix_dialog_add_custom_tab)
  _WRAP_METHOD(void set_manual_capabilities(PrintCapabilities capabilities), gtk_print_unix_dialog_set_manual_capabilities)
  _WRAP_METHOD(PrintCapabilities get_manual_capabilities() const, gtk_print_unix_dialog_get_manual_capabilities)

  _WRAP_METHOD(void get_support_selection(bool support_selection = true), gtk_print_unix_dialog_set_support_selection)
  _WRAP_METHOD(bool get_support_selection() const, gtk_print_unix_dialog_get_support_selection)
  _WRAP_METHOD(void set_has_selection(bool has_selection = true), gtk_print_unix_dialog_set_has_selection)
  _WRAP_METHOD(bool get_has_selection() const, gtk_print_unix_dialog_get_has_selection)
  _WRAP_METHOD(void set_embed_page_setup(bool embed = true), gtk_print_unix_dialog_set_embed_page_setup)
  _WRAP_METHOD(bool get_embed_page_setup() const, gtk_print_unix_dialog_get_embed_page_setup)
  _WRAP_METHOD(bool get_page_setup_set() const, gtk_print_unix_dialog_get_page_setup_set)

  _WRAP_PROPERTY("page_setup",  Glib::RefPtr<PageSetup>)
  _WRAP_PROPERTY("current_page", int)
  _WRAP_PROPERTY("print_settings",  Glib::RefPtr<PrintSettings>)
  _WRAP_PROPERTY("selected_printer", Glib::RefPtr<Printer>)
  _WRAP_PROPERTY("manual-capabilities", bool)
  _WRAP_PROPERTY("support-selection", bool)
  _WRAP_PROPERTY("has-selection", bool)
  _WRAP_PROPERTY("embed-page-setup", bool)

};

} // namespace Gtk
