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);
258 void setFamilyList( TQStringList list );
263 virtual TQSize sizeHint(
void )
const;
269 void fontSelected(
const TQFont &font );
272 void toggled_checkbox();
273 void family_chosen_slot(
const TQString&);
274 void size_chosen_slot(
const TQString&);
275 void style_chosen_slot(
const TQString&);
276 void displaySample(
const TQFont &font);
277 void showXLFDArea(
bool);
278 void size_value_slot(
int);
280 void fillFamilyListBox(
bool onlyFixedFonts =
false);
282 TQString style_name(
const TQString &name);
284 static void addFont( TQStringList &list,
const char *xfont );
290 TQStringList fontList;
294 TQLineEdit *sampleEdit;
295 TQLineEdit *xlfdEdit;
297 TQLabel *familyLabel;
299 TQCheckBox *familyCheckbox;
300 TQCheckBox *styleCheckbox;
301 TQCheckBox *sizeCheckbox;
306 TQComboBox *charsetsCombo;
307 TQCheckBox *sizeIsRelativeCheckBox;
311 TQString selectedFamily;
312 TQString selectedStyle;
314 TQMap<TQString, TQString> currentStyles;
319 virtual void virtual_hook(
int id,
void* data );
321 class TDEFontChooserPrivate;
322 TDEFontChooserPrivate *d;
376 bool onlyFixed =
false,
bool modal =
false,
377 const TQStringList &fontlist = TQStringList(),
378 bool makeFrame =
true,
bool diff =
false,
379 TQButton::ToggleState *sizeIsRelativeState = 0L );
388 void setFont(
const TQFont &font,
bool onlyFixed =
false )
389 { chooser->setFont(font, onlyFixed); }
394 TQFont
font()
const {
return chooser->font(); }
403 { chooser->setSizeIsRelative( relative ); }
410 {
return chooser->sizeIsRelative(); }
431 static int getFont( TQFont &theFont,
bool onlyFixed =
false,
432 TQWidget *parent = 0L,
bool makeFrame =
true,
433 TQButton::ToggleState *sizeIsRelativeState = 0L );
467 static int getFontDiff( TQFont &theFont,
int &diffFlags,
bool onlyFixed =
false,
468 TQWidget *parent = 0L,
bool makeFrame =
true,
469 TQButton::ToggleState *sizeIsRelativeState = 0L );
490 static int getFontAndText( TQFont &theFont, TQString &theString,
491 bool onlyFixed =
false, TQWidget *parent = 0L,
492 bool makeFrame =
true,
493 TQButton::ToggleState *sizeIsRelativeState = 0L );
501 void fontSelected(
const TQFont &font );
507 virtual void virtual_hook(
int id,
void* data );
509 class TDEFontDialogPrivate;
510 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.