/* $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 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.
 */

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

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


namespace Gtk
{

class Button;
class Entry;
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)
public:
  _CTOR_DEFAULT()

  _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)

  // Font page
  _MEMBER_GET_PTR(font_entry,font_entry,Entry*,GtkWidget*)
  _MEMBER_GET_PTR(font_style_entry,font_style_entry,Entry*,GtkWidget*)
  _MEMBER_GET_PTR(size_entry,size_entry,Entry*,GtkWidget*)

  _MEMBER_GET_PTR(pixels_button,pixels_button,RadioButton*,GtkWidget*)
  _MEMBER_GET_PTR(points_button,points_button,RadioButton*,GtkWidget*)
  _MEMBER_GET_PTR(filter_button,filter_button,Button*,GtkWidget*)

  _MEMBER_GET_PTR(preview_entry,preview_entry,Entry*,GtkWidget*)

  _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. 
 *
 * @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)

  _MEMBER_GET_PTR(font_selection,fontsel,FontSelection*,GtkWidget*)
  _MEMBER_GET_PTR(ok_button,ok_button,Button*,GtkWidget*)
  _MEMBER_GET_PTR(apply_button,apply_button,Button*,GtkWidget*)
  _MEMBER_GET_PTR(cancel_button,cancel_button,Button*,GtkWidget*)
};

} // namespace Gtk

