• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
TDEFontChooser Class Reference

#include <tdefontdialog.h>

Inherits TQWidget.

Public Types

enum  FontColumn { FamilyList =0x01 , StyleList =0x02 , SizeList =0x04 }
 
enum  FontDiff { FontDiffFamily =0x01 , FontDiffStyle =0x02 , FontDiffSize =0x04 }
 
enum  FontListCriteria { FixedWidthFonts =0x01 , ScalableFonts =0x02 , SmoothScalableFonts =0x04 }
 

Signals

void fontSelected (const TQFont &font)
 

Public Member Functions

 TDEFontChooser (TQWidget *parent=0L, const char *name=0L, bool onlyFixed=false, const TQStringList &fontList=TQStringList(), bool makeFrame=true, int visibleListSize=8, bool diff=false, TQButton::ToggleState *sizeIsRelativeState=0L)
 
virtual ~TDEFontChooser ()
 
void enableColumn (int column, bool state)
 
void setFont (const TQFont &font, bool onlyFixed=false)
 
int fontDiffFlags ()
 
TQFont font () const
 
void setColor (const TQColor &col)
 
TQColor color () const
 
void setBackgroundColor (const TQColor &col)
 
TQColor backgroundColor () const
 
void setSizeIsRelative (TQButton::ToggleState relative)
 
TQButton::ToggleState sizeIsRelative () const
 
TQString sampleText () const
 
void setSampleText (const TQString &text)
 
void setSampleBoxVisible (bool visible)
 
void setFamilyList (TQStringList list)
 
virtual TQSize sizeHint (void) const
 

Static Public Member Functions

static TQString getXLFD (const TQFont &theFont)
 
static void getFontList (TQStringList &list, uint fontListCriteria)
 

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 

Detailed Description

A font selection widget.

While TDEFontChooser as an ordinary widget can be embedded in custom dialogs and therefore is very flexible, in most cases it is preferable to use the convenience functions in TDEFontDialog.

KDE Font Chooser
Author
Preston Brown pbrow.nosp@m.n@kd.nosp@m.e.org, Bernd Wuebben wuebb.nosp@m.en@k.nosp@m.de.or.nosp@m.g
Version
$Id$

Definition at line 54 of file tdefontdialog.h.

Member Enumeration Documentation

◆ FontColumn

enum TDEFontChooser::FontColumn
  • FamilyList - Identifies the family (leftmost) list.
  • StyleList - Identifies the style (center) list.
  • SizeList - Identifies the size (rightmost) list.

Definition at line 65 of file tdefontdialog.h.

◆ FontDiff

enum TDEFontChooser::FontDiff
  • FontDiffFamily - Identifies a requested change in the font family.
  • FontDiffStyle - Identifies a requested change in the font style.
  • FontDiffSize - Identifies a requested change in the font size.

Definition at line 72 of file tdefontdialog.h.

◆ FontListCriteria

enum TDEFontChooser::FontListCriteria

The selection criteria for the font families shown in the dialog.

  • FixedWidthFont when included only fixed-width fonts are returned. The fonts where the width of every character is equal.
  • ScalableFont when included only scalable fonts are returned; certain configurations allow bitmap fonts to remain unscaled and thus these fonts have limited number of sizes.
  • SmoothScalableFont when included only return smooth scalable fonts. this will return only non-bitmap fonts which are scalable to any size requested. Setting this option to true will mean the "scalable" flag is irrelavant.

Definition at line 241 of file tdefontdialog.h.

Constructor & Destructor Documentation

◆ TDEFontChooser()

TDEFontChooser::TDEFontChooser ( TQWidget *  parent = 0L,
const char *  name = 0L,
bool  onlyFixed = false,
const TQStringList &  fontList = TQStringList(),
bool  makeFrame = true,
int  visibleListSize = 8,
bool  diff = false,
TQButton::ToggleState *  sizeIsRelativeState = 0L 
)

Constructs a font picker widget.

It normally comes up with all font families present on the system; the getFont method below does allow some more fine-tuning of the selection of fonts that will be displayed in the dialog.

Consider the following code snippet;

TQStringList list;
TDEFontChooser::getFontList(list,SmoothScalableFonts);
TDEFontChooser chooseFont = new TDEFontChooser(0, "FontList", false, list);
TDEFontChooser
A font selection widget.
Definition: tdefontdialog.h:55
TDEFontChooser::TDEFontChooser
TDEFontChooser(TQWidget *parent=0L, const char *name=0L, bool onlyFixed=false, const TQStringList &fontList=TQStringList(), bool makeFrame=true, int visibleListSize=8, bool diff=false, TQButton::ToggleState *sizeIsRelativeState=0L)
Constructs a font picker widget.
Definition: tdefontdialog.cpp:93
TDEFontChooser::getFontList
static void getFontList(TQStringList &list, uint fontListCriteria)
Creates a list of font strings.
Definition: tdefontdialog.cpp:674

The above creates a font chooser dialog with only SmoothScaleble fonts.

Parameters
parentThe parent widget.
nameThe widget name.
onlyFixedOnly display fonts which have fixed-width character sizes.
fontListA list of fonts to display, in XLFD format. If no list is formatted, the internal KDE font list is used. If that has not been created, X is queried, and all fonts available on the system are displayed.
diffDisplay the difference version dialog. See TDEFontDialog::getFontDiff().
makeFrameDraws a frame with titles around the contents.
visibleListSizeThe minimum number of visible entries in the fontlists.
sizeIsRelativeStateIf 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 sizeIsRelative().

Definition at line 93 of file tdefontdialog.cpp.

◆ ~TDEFontChooser()

TDEFontChooser::~TDEFontChooser ( )
virtual

Destructs the font chooser.

Definition at line 339 of file tdefontdialog.cpp.

Member Function Documentation

◆ backgroundColor()

TQColor TDEFontChooser::backgroundColor ( ) const
Returns
The background color currently used in the preview (default: the base color of the active colorgroup)

Definition at line 384 of file tdefontdialog.cpp.

◆ color()

TQColor TDEFontChooser::color ( ) const
Returns
The color currently used in the preview (default: the text color of the active color group)

Definition at line 371 of file tdefontdialog.cpp.

◆ enableColumn()

void TDEFontChooser::enableColumn ( int  column,
bool  state 
)

Enables or disable a font column in the chooser.

Use this function if your application does not need or supports all font properties.

Parameters
columnSpecify the columns. An or'ed combination of FamilyList, StyleList and SizeList is possible.
stateIf false the columns are disabled.

Definition at line 413 of file tdefontdialog.cpp.

◆ font()

TQFont TDEFontChooser::font ( ) const
inline
Returns
The currently selected font in the chooser.

Definition at line 150 of file tdefontdialog.h.

◆ fontDiffFlags()

int TDEFontChooser::fontDiffFlags ( )
Returns
The bitmask corresponding to the attributes the user wishes to change.

Definition at line 447 of file tdefontdialog.cpp.

◆ fontSelected

void TDEFontChooser::fontSelected ( const TQFont &  font)
signal

Emitted whenever the selected font changes.

◆ getFontList()

void TDEFontChooser::getFontList ( TQStringList &  list,
uint  fontListCriteria 
)
static

Creates a list of font strings.

Parameters
listThe list is returned here.
fontListCriteriashould contain all the restrictions for font selection as OR-ed values
See also
TDEFontChooser::FontListCriteria for the individual values

Definition at line 674 of file tdefontdialog.cpp.

◆ getXLFD()

static TQString TDEFontChooser::getXLFD ( const TQFont &  theFont)
inlinestatic

Converts a TQFont into the corresponding X Logical Font Description (XLFD).

Parameters
theFontThe font to convert.
Returns
A string representing the given font in XLFD format.

Definition at line 227 of file tdefontdialog.h.

◆ sampleText()

TQString TDEFontChooser::sampleText ( ) const
inline
Returns
The current text in the sample text input area.

Definition at line 192 of file tdefontdialog.h.

◆ setBackgroundColor()

void TDEFontChooser::setBackgroundColor ( const TQColor &  col)

Sets the background color to use in the preview.

Definition at line 376 of file tdefontdialog.cpp.

◆ setColor()

void TDEFontChooser::setColor ( const TQColor &  col)

Sets the color to use in the preview.

Definition at line 363 of file tdefontdialog.cpp.

◆ setFamilyList()

void TDEFontChooser::setFamilyList ( TQStringList  list)

Fill the font family list of the TDEFontChooser.

Parameters
listThe font list.

Definition at line 707 of file tdefontdialog.cpp.

◆ setFont()

void TDEFontChooser::setFont ( const TQFont &  font,
bool  onlyFixed = false 
)

Sets the currently selected font in the chooser.

Parameters
fontThe font to select.
onlyFixedReadjust the font list to display only fixed width fonts if true, or vice-versa.

Definition at line 430 of file tdefontdialog.cpp.

◆ setSampleBoxVisible()

void TDEFontChooser::setSampleBoxVisible ( bool  visible)
inline

Shows or hides the sample text box.

Parameters
visibleSet it to true to show the box, to false to hide it.
Since
3.5

Definition at line 215 of file tdefontdialog.h.

◆ setSampleText()

void TDEFontChooser::setSampleText ( const TQString &  text)
inline

Sets the sample text.

Normally you should not change this text, but it can be better to do this if the default text is too large for the edit area when using the default font of your application.

Parameters
textThe new sample text. The current will be removed.

Definition at line 204 of file tdefontdialog.h.

◆ setSizeIsRelative()

void TDEFontChooser::setSizeIsRelative ( TQButton::ToggleState  relative)

Sets the state of the checkbox indicating whether the font size is to be interpreted as relative size.

NOTE: If parameter sizeIsRelative was not set in the constructor of the widget this setting will be ignored.

Definition at line 389 of file tdefontdialog.cpp.

◆ sizeHint()

TQSize TDEFontChooser::sizeHint ( void  ) const
virtual

Reimplemented for internal reasons.

Definition at line 407 of file tdefontdialog.cpp.

◆ sizeIsRelative()

TQButton::ToggleState TDEFontChooser::sizeIsRelative ( ) const
Returns
Whether the font size is to be interpreted as relative size (default: TQButton:Off)

Definition at line 400 of file tdefontdialog.cpp.

◆ virtual_hook()

void TDEFontChooser::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 837 of file tdefontdialog.cpp.


The documentation for this class was generated from the following files:
  • tdefontdialog.h
  • tdefontdialog.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.