kdeui Library API Documentation

KFontCombo Class Reference

A combobox that lists the available fonts. A combobox to choose a font. More...

#include <kfontcombo.h>

Inheritance diagram for KFontCombo:

Inheritance graph
[legend]
Collaboration diagram for KFontCombo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 KFontCombo (QWidget *parent, const char *name=0)
 Constructor.

 KFontCombo (const QStringList &fonts, QWidget *parent, const char *name=0)
 Constructor that takes an already initialzed font list.

virtual ~KFontCombo ()
 Destructor.

void setFonts (const QStringList &fonts)
 Sets the font list.

void setCurrentFont (const QString &family)
 Sets the currently selected font.

QString currentFont () const
void setBold (bool bold)
 Sets the listed fonts to bold or normal.

bool bold () const
 Returns the current bold status.

void setItalic (bool bold)
 Sets the listed fonts to italic or regular.

bool italic () const
 Returns the current italic status.

void setUnderline (bool bold)
 Sets the listed fonts to underlined or not underlined.

bool underline () const
 Returns the current underline status.

void setStrikeOut (bool bold)
 Sets the listed fonts to striked out or not.

bool strikeOut () const
 Returns the current strike out status.

void setSize (int size)
 Sets the listed fonts' size.

int size () const
 Returns the current font size.

virtual void setCurrentItem (int i)

Static Public Member Functions

bool displayFonts ()
 Returns the user's setting of whether the items should be painted in the respective fonts or not.


Protected Member Functions

void updateFonts ()
 Updated the combo's listBox() to reflect changes made to the fonts' attributed.

virtual void virtual_hook (int id, void *data)

Friends

class KFontListItem

Detailed Description

A combobox that lists the available fonts. A combobox to choose a font.

The items are painted using the respective font itself, so the user can easily choose a font based on its look. This can be turned off globally if the user wishes so.

Author:
Malte Starostik <malte@kde.org>
Version:
Id
kfontcombo.h,v 1.8.4.1 2003/07/14 02:48:17 bmeyer Exp

Definition at line 37 of file kfontcombo.h.


Constructor & Destructor Documentation

KFontCombo::KFontCombo QWidget parent,
const char *  name = 0
 

Constructor.

Parameters:
parent The parent widget
name The object name for the widget

Definition at line 163 of file kfontcombo.cpp.

References KFontChooser::getFontList(), KStdAccel::name(), and setFonts().

KFontCombo::KFontCombo const QStringList fonts,
QWidget parent,
const char *  name = 0
 

Constructor that takes an already initialzed font list.

Parameters:
fonts A list of fonts to show
parent The parent widget
name The object name for the widget

Definition at line 172 of file kfontcombo.cpp.

References KStdAccel::name(), and setFonts().

KFontCombo::~KFontCombo  )  [virtual]
 

Destructor.

Definition at line 252 of file kfontcombo.cpp.


Member Function Documentation

void KFontCombo::setFonts const QStringList fonts  ) 
 

Sets the font list.

Parameters:
fonts Font list to show

Definition at line 179 of file kfontcombo.cpp.

References QComboBox::clear().

Referenced by KFontCombo().

void KFontCombo::setCurrentFont const QString family  ) 
 

Sets the currently selected font.

Parameters:
family Font to select.

Definition at line 189 of file kfontcombo.cpp.

References QComboBox::count(), QString::find(), QString::left(), QString::lower(), KComboBox::setCurrentItem(), and QComboBox::text().

QString KFontCombo::currentFont  )  const
 

Returns:
the currently selected font.

Definition at line 230 of file kfontcombo.cpp.

References QComboBox::currentText().

void KFontCombo::setBold bool  bold  ) 
 

Sets the listed fonts to bold or normal.

Parameters:
bold Set to true to display fonts in bold

Definition at line 257 of file kfontcombo.cpp.

References updateFonts().

bool KFontCombo::bold  )  const
 

Returns the current bold status.

Returns:
true if fonts are bold

Definition at line 265 of file kfontcombo.cpp.

void KFontCombo::setItalic bool  bold  ) 
 

Sets the listed fonts to italic or regular.

Parameters:
italic Set to true to display fonts italic

Definition at line 270 of file kfontcombo.cpp.

References updateFonts().

bool KFontCombo::italic  )  const
 

Returns the current italic status.

Returns:
True if fonts are italic

Definition at line 278 of file kfontcombo.cpp.

void KFontCombo::setUnderline bool  bold  ) 
 

Sets the listed fonts to underlined or not underlined.

Parameters:
underline Set to true to display fonts underlined

Definition at line 283 of file kfontcombo.cpp.

References updateFonts().

bool KFontCombo::underline  )  const
 

Returns the current underline status.

Returns:
True if fonts are underlined

Definition at line 291 of file kfontcombo.cpp.

void KFontCombo::setStrikeOut bool  bold  ) 
 

Sets the listed fonts to striked out or not.

Parameters:
strikeOut Set to true to display fonts striked out

Definition at line 296 of file kfontcombo.cpp.

References updateFonts().

bool KFontCombo::strikeOut  )  const
 

Returns the current strike out status.

Returns:
True if fonts are striked out

Definition at line 304 of file kfontcombo.cpp.

void KFontCombo::setSize int  size  ) 
 

Sets the listed fonts' size.

Parameters:
size Set to the point size to display the fonts in

Definition at line 309 of file kfontcombo.cpp.

References QFontMetrics::lineSpacing(), QFont::setPointSize(), and updateFonts().

int KFontCombo::size  )  const
 

Returns the current font size.

Returns:
The point size of the fonts

Definition at line 321 of file kfontcombo.cpp.

bool KFontCombo::displayFonts  )  [static]
 

Returns the user's setting of whether the items should be painted in the respective fonts or not.

Returns:
True if the respective fonts are used for painting

Definition at line 338 of file kfontcombo.cpp.

References KGlobal::config(), and KConfigBase::readBoolEntry().

void KFontCombo::updateFonts  )  [protected]
 

Updated the combo's listBox() to reflect changes made to the fonts' attributed.

Definition at line 326 of file kfontcombo.cpp.

References QComboBox::listBox().

Referenced by setBold(), setItalic(), setSize(), setStrikeOut(), and setUnderline().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:01:00 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001