26 #ifndef _TDE_FONT_DIALOG_H_ 27 #define _TDE_FONT_DIALOG_H_ 29 #include <tqlineedit.h> 31 #include <kdialogbase.h> 57 TQ_PROPERTY( TQFont font READ font WRITE setFont )
65 enum FontColumn { FamilyList=0x01, StyleList=0x02, SizeList=0x04};
72 enum FontDiff { FontDiffFamily=0x01, FontDiffStyle=0x02, FontDiffSize=0x04 };
109 bool onlyFixed =
false,
110 const TQStringList &fontList = TQStringList(),
111 bool makeFrame =
true,
int visibleListSize=8,
112 bool diff =
false, TQButton::ToggleState *sizeIsRelativeState = 0L );
130 void enableColumn(
int column,
bool state );
139 void setFont(
const TQFont &font,
bool onlyFixed =
false );
150 TQFont
font()
const {
return selFont; }
155 void setColor(
const TQColor & col );
161 TQColor color()
const;
166 void setBackgroundColor(
const TQColor & col );
172 TQColor backgroundColor()
const;
180 void setSizeIsRelative( TQButton::ToggleState relative );
186 TQButton::ToggleState sizeIsRelative()
const;
206 sampleEdit->setText( text );
217 sampleEdit->setShown( visible );
227 static TQString
getXLFD(
const TQFont &theFont )
228 {
return theFont.rawName(); }
241 enum FontListCriteria { FixedWidthFonts=0x01, ScalableFonts=0x02, SmoothScalableFonts=0x04 };
250 static void getFontList( TQStringList &list, uint fontListCriteria);
255 virtual TQSize sizeHint(
void )
const;
261 void fontSelected(
const TQFont &font );
264 void toggled_checkbox();
265 void family_chosen_slot(
const TQString&);
266 void size_chosen_slot(
const TQString&);
267 void style_chosen_slot(
const TQString&);
268 void displaySample(
const TQFont &font);
269 void showXLFDArea(
bool);
270 void size_value_slot(
int);
272 void fillFamilyListBox(
bool onlyFixedFonts =
false);
274 TQString style_name(
const TQString &name);
276 static void addFont( TQStringList &list,
const char *xfont );
282 TQStringList fontList;
286 TQLineEdit *sampleEdit;
287 TQLineEdit *xlfdEdit;
289 TQLabel *familyLabel;
291 TQCheckBox *familyCheckbox;
292 TQCheckBox *styleCheckbox;
293 TQCheckBox *sizeCheckbox;
298 TQComboBox *charsetsCombo;
299 TQCheckBox *sizeIsRelativeCheckBox;
303 TQString selectedStyle;
305 TQMap<TQString, TQString> currentStyles;
310 virtual void virtual_hook(
int id,
void* data );
312 class TDEFontChooserPrivate;
313 TDEFontChooserPrivate *d;
367 bool onlyFixed =
false,
bool modal =
false,
368 const TQStringList &fontlist = TQStringList(),
369 bool makeFrame =
true,
bool diff =
false,
370 TQButton::ToggleState *sizeIsRelativeState = 0L );
379 void setFont(
const TQFont &font,
bool onlyFixed =
false )
380 { chooser->setFont(font, onlyFixed); }
385 TQFont
font()
const {
return chooser->font(); }
394 { chooser->setSizeIsRelative( relative ); }
401 {
return chooser->sizeIsRelative(); }
422 static int getFont( TQFont &theFont,
bool onlyFixed =
false,
423 TQWidget *parent = 0L,
bool makeFrame =
true,
424 TQButton::ToggleState *sizeIsRelativeState = 0L );
458 static int getFontDiff( TQFont &theFont,
int &diffFlags,
bool onlyFixed =
false,
459 TQWidget *parent = 0L,
bool makeFrame =
true,
460 TQButton::ToggleState *sizeIsRelativeState = 0L );
481 static int getFontAndText( TQFont &theFont, TQString &theString,
482 bool onlyFixed =
false, TQWidget *parent = 0L,
483 bool makeFrame =
true,
484 TQButton::ToggleState *sizeIsRelativeState = 0L );
492 void fontSelected(
const TQFont &font );
498 virtual void virtual_hook(
int id,
void* data );
500 class TDEFontDialogPrivate;
501 TDEFontDialogPrivate *d;
FontListCriteria
The selection criteria for the font families shown in the dialog.
void setSizeIsRelative(TQButton::ToggleState relative)
Sets the state of the checkbox indicating whether the font size is to be interpreted as relative size...
void setSampleBoxVisible(bool visible)
Shows or hides the sample text box.
A dialog base class with standard buttons and predefined layouts.
TQString sampleText() const
TQButton::ToggleState sizeIsRelative() const
static TQString getXLFD(const TQFont &theFont)
Converts a TQFont into the corresponding X Logical Font Description (XLFD).
A variant of TQListBox that honors KDE's system-wide settings.
void setSampleText(const TQString &text)
Sets the sample text.
void setFont(const TQFont &font, bool onlyFixed=false)
Sets the currently selected font in the dialog.