/* $Id: fontselection.hg,v 1.2 2003/01/22 23:04:19 murrayc Exp $ */

/* Copyright (C) 1998-2002 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
 */

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


#include <gtkmm/dialog.h>
#include <gtkmm/box.h>


namespace Gtk
{

class Button;
class Entry;
class TreeView;
class RadioButton;


/** A widget for selecting fonts.
 *
 * The Gtk::FontSelection widget lists the available fonts, styles and
 * sizes, allowing the user to select a font. It is used in the
 * Gtk::FontSelectionDialog widget to provide a dialog box for selecting
 * fonts.
 *
 * @ingroup Widgets
 */
class FontSelection : public VBox
{
  _CLASS_GTKOBJECT(FontSelection,GtkFontSelection,GTK_FONT_SELECTION,Gtk::VBox,GtkVBox)
  _IGNORE(gtk_font_selection_get_font) //deprecated
public:
  _CTOR_DEFAULT()

  _WRAP_METHOD(TreeView* get_family_list(), gtk_font_selection_get_family_list)
  _WRAP_METHOD(const TreeView* get_family_list() const, gtk_font_selection_get_family_list, constversion)

  _WRAP_METHOD(TreeView* get_face_list(), gtk_font_selection_get_face_list)
  _WRAP_METHOD(const TreeView* get_face_list() const, gtk_font_selection_get_face_list, constversion)

  _WRAP_METHOD(Entry* get_size_entry(), gtk_font_selection_get_size_entry)
  _WRAP_METHOD(const Entry* get_size_entry() const, gtk_font_selection_get_size_entry, constversion)

  _WRAP_METHOD(TreeView* get_size_list(), gtk_font_selection_get_size_list)
  _WRAP_METHOD(const TreeView* get_size_list() const, gtk_font_selection_get_size_list, constversion)

  _WRAP_METHOD(Entry* get_preview_entry(), gtk_font_selection_get_preview_entry)
  _WRAP_METHOD(const Entry* get_preview_entry() const, gtk_font_selection_get_preview_entry)

  _WRAP_METHOD(Glib::RefPtr<Pango::FontFamily> get_family(), gtk_font_selection_get_family, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Pango::FontFamily> get_family() const, gtk_font_selection_get_family, refreturn, constversion)

  _WRAP_METHOD(Glib::RefPtr<Pango::FontFace> get_face(), gtk_font_selection_get_face, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Pango::FontFace> get_face() const, gtk_font_selection_get_face, refreturn, constversion)

  _WRAP_METHOD(int get_size() const, gtk_font_selection_get_size)

  _WRAP_METHOD(Glib::ustring get_font_name() const, gtk_font_selection_get_font_name)
  _WRAP_METHOD(bool set_font_name(const Glib::ustring& fontname), gtk_font_selection_set_font_name)
  _WRAP_METHOD(Glib::ustring get_preview_text() const, gtk_font_selection_get_preview_text)
  _WRAP_METHOD(void set_preview_text(const Glib::ustring& fontname),gtk_font_selection_set_preview_text)

  //TODO: Remove these accessors when we can break ABI.
  //They probably all return null now anyway.

  //Note: The GdkFont "font" property is deprecated, or should be.
  _WRAP_PROPERTY("font_name", Glib::ustring)
  _WRAP_PROPERTY("preview_text", Glib::ustring)
};

/** A dialog box for selecting fonts.
 *
 * The Gtk::FontSelectionDialog widget is a dialog box for selecting a font.
 *
 * A FontSelectionDialog looks like this:
 * @image html fontselectiondialog1.png
 *
 * @ingroup Dialogs
 */
class FontSelectionDialog : public Dialog
{
  _CLASS_GTKOBJECT(FontSelectionDialog,GtkFontSelectionDialog,GTK_FONT_SELECTION_DIALOG,Gtk::Dialog,GtkDialog)
  _IGNORE(gtk_font_selection_dialog_get_font)
  _UNMANAGEABLE()
public:

  _CTOR_DEFAULT()
  _WRAP_CTOR(FontSelectionDialog(const Glib::ustring& title), gtk_font_selection_dialog_new)

  _WRAP_METHOD(bool set_font_name(const Glib::ustring& fontname),gtk_font_selection_dialog_set_font_name)
  _WRAP_METHOD(Glib::ustring get_font_name() const, gtk_font_selection_dialog_get_font_name)
  _WRAP_METHOD(Glib::ustring get_preview_text() const,gtk_font_selection_dialog_get_preview_text)
  _WRAP_METHOD(void set_preview_text(const Glib::ustring& fontname), gtk_font_selection_dialog_set_preview_text)

  _WRAP_METHOD(Button* get_ok_button(), gtk_font_selection_dialog_get_ok_button)
  _WRAP_METHOD(const Button* get_ok_button() const, gtk_font_selection_dialog_get_ok_button, constversion)

  _WRAP_METHOD(Button* get_cancel_button(), gtk_font_selection_dialog_get_cancel_button)
  _WRAP_METHOD(const Button* get_cancel_button() const, gtk_font_selection_dialog_get_cancel_button, constversion)

  _IGNORE(gtk_font_selection_dialog_get_apply_button) //deprecated
};

} // namespace Gtk
