.TH "KFontDialog" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KFontDialog \- A font selection dialog.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kfontdialog.h>\fP
.PP
Inherits \fBKDialogBase\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBfontSelected\fP (const \fBQFont\fP &font)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKFontDialog\fP (\fBQWidget\fP *parent=0L, const char *name=0, bool onlyFixed=false, bool modal=false, const \fBQStringList\fP &fontlist=\fBQStringList\fP(), bool makeFrame=true, bool diff=false, QButton::ToggleState *sizeIsRelativeState=0L)"
.br
.ti -1c
.RI "void \fBsetFont\fP (const \fBQFont\fP &font, bool onlyFixed=false)"
.br
.ti -1c
.RI "\fBQFont\fP \fBfont\fP () const "
.br
.ti -1c
.RI "void \fBsetSizeIsRelative\fP (QButton::ToggleState relative)"
.br
.ti -1c
.RI "QButton::ToggleState \fBsizeIsRelative\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static int \fBgetFont\fP (\fBQFont\fP &theFont, bool onlyFixed=false, \fBQWidget\fP *parent=0L, bool makeFrame=true, QButton::ToggleState *sizeIsRelativeState=0L)"
.br
.ti -1c
.RI "static int \fBgetFontDiff\fP (\fBQFont\fP &theFont, int &diffFlags, bool onlyFixed=false, \fBQWidget\fP *parent=0L, bool makeFrame=true, QButton::ToggleState *sizeIsRelativeState=0L)"
.br
.ti -1c
.RI "static int \fBgetFontAndText\fP (\fBQFont\fP &theFont, \fBQString\fP &theString, bool onlyFixed=false, \fBQWidget\fP *parent=0L, bool makeFrame=true, QButton::ToggleState *sizeIsRelativeState=0L)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBKFontChooser\fP * \fBchooser\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A font selection dialog. 

The KFontDialog provides a dialog for interactive font selection. It is basically a thin wrapper around the \fBKFontChooser\fP widget, which can also be used standalone. In most cases, the simplest use of this class is the static method \fBKFontDialog::getFont()\fP, which pops up the dialog, allows the user to select a font, and returns when the dialog is closed.
.PP
Example:
.PP
.PP
.nf
      QFont myFont;
      int result = KFontDialog::getFont( myFont );
      if ( result == KFontDialog::Accepted )
            ...
.fi
.PP
.PP
KDE Font Dialog 
.PP
\fBAuthor:\fP
.RS 4
Preston Brown <pbrown@kde.org>, Bernd Wuebben <wuebben@kde.org> 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkfontdialog.h\fP 353310 2004-10-10 10:27:49Z bhards 
.RE
.PP
.RE
.PP

.PP
Definition at line 326 of file kfontdialog.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KFontDialog::KFontDialog (\fBQWidget\fP * parent = \fC0L\fP, const char * name = \fC0\fP, bool onlyFixed = \fCfalse\fP, bool modal = \fCfalse\fP, const \fBQStringList\fP & fontlist = \fC\fBQStringList\fP()\fP, bool makeFrame = \fCtrue\fP, bool diff = \fCfalse\fP, QButton::ToggleState * sizeIsRelativeState = \fC0L\fP)"
.PP
Constructs a font selection dialog. 
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP The parent widget of the dialog, if any. 
.br
\fIname\fP The name of the dialog. 
.br
\fImodal\fP Specifies whether the dialog is modal or not. 
.br
\fIonlyFixed\fP only display fonts which have fixed-width character sizes. 
.br
\fIfontlist\fP a list of fonts to display, in XLFD format. If no list is formatted, the internal \fBKDE\fP font list is used. If that has not been created, X is queried, and all fonts available on the system are displayed. 
.br
\fImakeFrame\fP Draws a frame with titles around the contents. 
.br
\fIdiff\fP Display the difference version dialog. See \fBgetFontDiff()\fP. 
.br
\fIsizeIsRelativeState\fP If not zero the widget will show a checkbox where the user may choose whether the font size is to be interpreted as relative size. Initial state of this checkbox will be set according to *sizeIsRelativeState, user choice may be retrieved by calling \fBsizeIsRelative()\fP. 
.RE
.PP

.PP
Definition at line 727 of file kfontdialog.cpp.
.PP
References KDialogBase::setMainWidget().
.SH "Member Function Documentation"
.PP 
.SS "void KFontDialog::setFont (const \fBQFont\fP & font, bool onlyFixed = \fCfalse\fP)\fC [inline]\fP"
.PP
Sets the currently selected font in the dialog. 
.PP
\fBParameters:\fP
.RS 4
\fIfont\fP The font to select. 
.br
\fIonlyFixed\fP readjust the font list to display only fixed width fonts if true, or vice-versa 
.RE
.PP

.PP
Definition at line 365 of file kfontdialog.h.
.PP
Referenced by getFont(), getFontAndText(), and getFontDiff().
.SS "\fBQFont\fP KFontDialog::font () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
The currently selected font in the dialog. 
.RE
.PP

.PP
Definition at line 371 of file kfontdialog.h.
.SS "void KFontDialog::setSizeIsRelative (QButton::ToggleState relative)\fC [inline]\fP"
.PP
Sets the state of the checkbox indicating whether the font size is to be interpreted as relative size. 
.PP
NOTE: If parameter sizeIsRelative was not set in the constructor of the dialog this setting will be ignored. 
.PP
Definition at line 379 of file kfontdialog.h.
.SS "QButton::ToggleState KFontDialog::sizeIsRelative () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
Whether the font size is to be interpreted as relative size (default: false) 
.RE
.PP

.PP
Definition at line 386 of file kfontdialog.h.
.SS "int KFontDialog::getFont (\fBQFont\fP & theFont, bool onlyFixed = \fCfalse\fP, \fBQWidget\fP * parent = \fC0L\fP, bool makeFrame = \fCtrue\fP, QButton::ToggleState * sizeIsRelativeState = \fC0L\fP)\fC [static]\fP"
.PP
Creates a modal font dialog, lets the user choose a font, and returns when the dialog is closed. 
.PP
\fBParameters:\fP
.RS 4
\fItheFont\fP a reference to the font to write the chosen font into. 
.br
\fIonlyFixed\fP if true, only select from fixed-width fonts. 
.br
\fIparent\fP Parent widget of the dialog. Specifying a widget different from 0 (Null) improves centering (looks better). 
.br
\fImakeFrame\fP Draws a frame with titles around the contents. 
.br
\fIsizeIsRelativeState\fP If not zero the widget will show a checkbox where the user may choose whether the font size is to be interpreted as relative size. Initial state of this checkbox will be set according to *sizeIsRelativeState and user choice will be returned therein.
.RE
.PP
\fBReturns:\fP
.RS 4
\fBQDialog::result()\fP. 
.RE
.PP

.PP
Definition at line 759 of file kfontdialog.cpp.
.PP
References chooser, QDialog::exec(), KFontChooser::font, setFont(), and KFontChooser::sizeIsRelative().
.PP
Referenced by KEdit::selectFont().
.SS "int KFontDialog::getFontDiff (\fBQFont\fP & theFont, int & diffFlags, bool onlyFixed = \fCfalse\fP, \fBQWidget\fP * parent = \fC0L\fP, bool makeFrame = \fCtrue\fP, QButton::ToggleState * sizeIsRelativeState = \fC0L\fP)\fC [static]\fP"
.PP
Creates a modal font difference dialog, lets the user choose a selection of changes that should be made to a set of fonts, and returns when the dialog is closed. 
.PP
Useful for choosing slight adjustments to the font set when the user would otherwise have to manually edit a number of fonts.
.PP
\fBParameters:\fP
.RS 4
\fItheFont\fP a reference to the font to write the chosen font into. 
.br
\fIdiffFlags\fP a reference to the int into which the chosen difference selection bitmask should be written. Check the returned bitmask like: 
.PP
.nf
        if ( diffFlags & KFontChooser::FontDiffFamily )
            [...]
        if ( diffFlags & KFontChooser::FontDiffStyle )
            [...]
        if ( diffFlags & KFontChooser::FontDiffSize )
            [...]

.fi
.PP
 
.br
\fIonlyFixed\fP if true, only select from fixed-width fonts. 
.br
\fIparent\fP Parent widget of the dialog. Specifying a widget different from 0 (Null) improves centering (looks better). 
.br
\fImakeFrame\fP Draws a frame with titles around the contents. 
.br
\fIsizeIsRelativeState\fP If not zero the widget will show a checkbox where the user may choose whether the font size is to be interpreted as relative size. Initial state of this checkbox will be set according to *sizeIsRelativeState and user choice will be returned therein.
.RE
.PP
\fBReturns:\fP
.RS 4
\fBQDialog::result()\fP. 
.RE
.PP

.PP
Definition at line 740 of file kfontdialog.cpp.
.PP
References chooser, QDialog::exec(), KFontChooser::font, KFontChooser::fontDiffFlags(), setFont(), and KFontChooser::sizeIsRelative().
.SS "int KFontDialog::getFontAndText (\fBQFont\fP & theFont, \fBQString\fP & theString, bool onlyFixed = \fCfalse\fP, \fBQWidget\fP * parent = \fC0L\fP, bool makeFrame = \fCtrue\fP, QButton::ToggleState * sizeIsRelativeState = \fC0L\fP)\fC [static]\fP"
.PP
When you are not only interested in the font selected, but also in the example string typed in, you can call this method. 
.PP
\fBParameters:\fP
.RS 4
\fItheFont\fP a reference to the font to write the chosen font into. 
.br
\fItheString\fP a reference to the example text that was typed. 
.br
\fIonlyFixed\fP if true, only select from fixed-width fonts. 
.br
\fIparent\fP Parent widget of the dialog. Specifying a widget different from 0 (Null) improves centering (looks better). 
.br
\fImakeFrame\fP Draws a frame with titles around the contents. 
.br
\fIsizeIsRelativeState\fP If not zero the widget will show a checkbox where the user may choose whether the font size is to be interpreted as relative size. Initial state of this checkbox will be set according to *sizeIsRelativeState and user choice will be returned therein. 
.RE
.PP
\fBReturns:\fP
.RS 4
The result of the dialog. 
.RE
.PP

.PP
Definition at line 778 of file kfontdialog.cpp.
.PP
References chooser, QDialog::exec(), KFontChooser::font, KFontChooser::sampleText(), setFont(), and KFontChooser::sizeIsRelative().
.SS "void KFontDialog::fontSelected (const \fBQFont\fP & font)\fC [signal]\fP"
.PP
Emitted whenever the currently selected font changes. 
.PP
Connect to this to monitor the font as it is selected if you are not running modal. 

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
