/*
 * Copyright 2003 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gtk/gtk.h>


namespace Gtk
{

FileChooserDialog::FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, FileChooserAction action)
:
  _CONSTRUCT("title", title.c_str(), "action", static_cast<GtkFileChooserAction>(action))
{
  set_transient_for(parent);
}

FileChooserDialog::FileChooserDialog(const Glib::ustring& title, FileChooserAction action)
:
  _CONSTRUCT("title", title.c_str(), "action", static_cast<GtkFileChooserAction>(action))
{
}

FileChooserDialog::FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title,
  FileChooserAction action, DialogFlags flags)
:
  _CONSTRUCT("transient-for", parent.gobj(),
             "title", title.c_str(),
             "action", static_cast<GtkFileChooserAction>(action),
             "use-header-bar", (flags & DIALOG_USE_HEADER_BAR) != 0,
             "modal", (flags & DIALOG_MODAL) != 0,
             "destroy-with-parent", (flags & DIALOG_DESTROY_WITH_PARENT) != 0)
{
}

FileChooserDialog::FileChooserDialog(const Glib::ustring& title, FileChooserAction action,
  DialogFlags flags)
:
  _CONSTRUCT("title", title.c_str(),
             "action", static_cast<GtkFileChooserAction>(action),
             "use-header-bar", (flags & DIALOG_USE_HEADER_BAR) != 0,
             "modal", (flags & DIALOG_MODAL) != 0,
             "destroy-with-parent", (flags & DIALOG_DESTROY_WITH_PARENT) != 0)
{
}

_DEPRECATE_IFDEF_START
FileChooserDialog::FileChooserDialog(const Glib::ustring& title, FileChooserAction action, const Glib::ustring& backend)
:
  _CONSTRUCT("title", title.c_str(), "action", static_cast<GtkFileChooserAction>(action), "file-system-backend", backend.c_str())
{
}

FileChooserDialog::FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, FileChooserAction action, const Glib::ustring& backend)
:
  _CONSTRUCT("title", title.c_str(), "action", static_cast<GtkFileChooserAction>(action), "file-system-backend", backend.c_str())
{
  set_transient_for(parent);
}
_DEPRECATE_IFDEF_END

} // namespace Gtk

