/* 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 Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#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
 *
 * @newin2p10
 *
 * @ingroup Printing
 */
class PrintUnixDialog : public Dialog
{
  _CLASS_GTKOBJECT(PrintUnixDialog, GtkPrintUnixDialog, GTK_PRINT_UNIX_DIALOG, Gtk::Dialog, GtkDialog)
  _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>& print_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_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>)
};

} // namespace Gtk
