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;
204 void setSampleText(
const TQString &text )
206 sampleEdit->setText( text );
215 void setSampleBoxVisible(
bool visible )
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);
275 static void addFont( TQStringList &list,
const char *xfont );
281 TQStringList fontList;
285 TQLineEdit *sampleEdit;
286 TQLineEdit *xlfdEdit;
288 TQLabel *familyLabel;
290 TQCheckBox *familyCheckbox;
291 TQCheckBox *styleCheckbox;
292 TQCheckBox *sizeCheckbox;
297 TQComboBox *charsetsCombo;
298 TQCheckBox *sizeIsRelativeCheckBox;
302 TQString selectedStyle;
304 TQMap<TQString, TQString> currentStyles;
309 virtual void virtual_hook(
int id,
void* data );
311 class TDEFontChooserPrivate;
312 TDEFontChooserPrivate *d;
366 bool onlyFixed =
false,
bool modal =
false,
367 const TQStringList &fontlist = TQStringList(),
368 bool makeFrame =
true,
bool diff =
false,
369 TQButton::ToggleState *sizeIsRelativeState = 0L );
378 void setFont(
const TQFont &font,
bool onlyFixed =
false )
379 { chooser->setFont(font, onlyFixed); }
384 TQFont
font()
const {
return chooser->font(); }
392 void setSizeIsRelative( TQButton::ToggleState relative )
393 { chooser->setSizeIsRelative( relative ); }
399 TQButton::ToggleState sizeIsRelative()
const
400 {
return chooser->sizeIsRelative(); }
421 static int getFont( TQFont &theFont,
bool onlyFixed =
false,
422 TQWidget *parent = 0L,
bool makeFrame =
true,
423 TQButton::ToggleState *sizeIsRelativeState = 0L );
457 static int getFontDiff( TQFont &theFont,
int &diffFlags,
bool onlyFixed =
false,
458 TQWidget *parent = 0L,
bool makeFrame =
true,
459 TQButton::ToggleState *sizeIsRelativeState = 0L );
480 static int getFontAndText( TQFont &theFont, TQString &theString,
481 bool onlyFixed =
false, TQWidget *parent = 0L,
482 bool makeFrame =
true,
483 TQButton::ToggleState *sizeIsRelativeState = 0L );
491 void fontSelected(
const TQFont &font );
497 virtual void virtual_hook(
int id,
void* data );
499 class TDEFontDialogPrivate;
500 TDEFontDialogPrivate *d;