Main Page - Header
Author: The Inti Development Team

Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# fontselection.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002-2003 The Inti Development Team.
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Library General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00025
    00026 #ifndef INTI_GTK_FONT_SELECTION_H
    00027 #define INTI_GTK_FONT_SELECTION_H
    00028
    00029 #ifndef INTI_GTK_VBOX_H
    00030 #include <inti/gtk/box.h>
    00031 #endif
    00032
    00033 #ifndef INTI_GTK_DIALOG_H
    00034 #include <inti/gtk/dialog.h>
    00035 #endif
    00036
    00037 #ifndef __GTK_FONTSEL_H__
    00038 #include <gtk/gtkfontsel.h>
    00039 #endif
    00040
    00041 namespace Inti {
    00042
    00043 namespace Pango {
    00044 class FontFace;
    00045 class FontFamily;
    00046 }
    00047
    00048 namespace Gtk {
    00049
    00050 class Button;
    00051 class Entry;
    00052 class FontSelectionClass;
    00053 class FontSelectionDialogClass;
    00054 class Label;
    00055
    00066
    00067 class FontSelection : public VBox
    00068 {
    00069         friend class G::Object;
    00070         friend class FontSelectionClass;
    00071
    00072         FontSelection(const FontSelection&);
    00073         FontSelection& operator=(const FontSelection&);
    00074
    00075 protected:
    00078
    00079         explicit FontSelection(GtkFontSelection *font_selection, bool reference = false);
    00086
    00088 //  Properties
    00089
    00090         typedef G::Property<String> FontNamePropertyType;
    00091         typedef G::PropertyProxy<G::Object, FontNamePropertyType> FontNamePropertyProxy;
    00092         static const FontNamePropertyType font_name_property;
    00093
    00094         typedef G::Property<String> PreviewTextPropertyType;
    00095         typedef G::PropertyProxy<G::Object, PreviewTextPropertyType> PreviewTextPropertyProxy;
    00096         static const PreviewTextPropertyType preview_text_property;
    00097
    00098 public:
    00101
    00102         FontSelection();
    00104
    00105         virtual ~FontSelection();
    00107
    00111
    00112         GtkFontSelection* gtk_font_selection() const { return (GtkFontSelection*)instance; }
    00114
    00115         GtkFontSelectionClass* gtk_font_selection_class() const;
    00117
    00118         operator GtkFontSelection* () const;
    00120
    00121         Entry* size_entry() const;
    00123
    00124         Entry* preview_entry() const;
    00126
    00127         Pango::FontFamily* get_font_family() const;
    00129
    00130         Pango::FontFace* get_font_face() const;
    00132
    00133         String get_font_name() const;
    00135
    00136         String get_preview_text() const;
    00138
    00142
    00143         bool set_font_name(const String& fontname);
    00147
    00148         void set_preview_text(const String& text);
    00151
    00155
    00156         const FontNamePropertyProxy prop_font_name()
    00157         {
    00158                 return FontNamePropertyProxy(this, &font_name_property);
    00159         }
    00161
    00162         const PreviewTextPropertyProxy prop_preview_text()
    00163         {
    00164                 return PreviewTextPropertyProxy(this, &preview_text_property);
    00165         }
    00167
    00169 };
    00170
    00178
    00179 class FontSelectionDialog : public Dialog
    00180 {
    00181         friend class G::Object;
    00182         friend class FontSelectionDialogClass;
    00183
    00184         FontSelectionDialog(const FontSelectionDialog&);
    00185         FontSelectionDialog& operator=(const FontSelectionDialog&);
    00186
    00187 protected:
    00190
    00191         explicit FontSelectionDialog(GtkFontSelectionDialog *font_selection_dialog, bool reference = false);
    00198
    00200
    00201 public:
    00204
    00205         FontSelectionDialog();
    00207
    00208         explicit FontSelectionDialog(const String& title);
    00211
    00212         virtual ~FontSelectionDialog();
    00214
    00218
    00219         GtkFontSelectionDialog* gtk_font_selection_dialog() const { return (GtkFontSelectionDialog*)instance; }
    00221
    00222         GtkFontSelectionDialogClass* gtk_font_selection_dialog_class() const;
    00224
    00225         operator GtkFontSelectionDialog* () const;
    00227
    00228         FontSelection* fontsel() const;
    00230
    00231         Button* ok_button() const;
    00233
    00234         Button* apply_button() const;
    00236
    00237         Button* cancel_button() const;
    00239
    00240         String get_font_name() const;
    00242
    00243         String get_preview_text() const;
    00245
    00249
    00250         bool set_font_name(const String& fontname);
    00254
    00255         void set_preview_text(const String& text);
    00258
    00260 };
    00261
    00262 } // namespace Gtk
    00263
    00264 } // namespace Inti
    00265
    00266 #endif // INTI_GTK_FONT_SELECTION_H
    00267

Main Page - Footer