Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OFontSelector Class Reference

A widget to select a font. More...

#include </home/clem/local/src/opie/noncore/unsupported/libopie/ofontselector.h>

Collaboration diagram for OFontSelector:

Collaboration graph
[legend]
List of all members.

Signals

void fontSelected (const QFont &)

Public Member Functions

 OFontSelector (bool withpreview, QWidget *parent=0, const char *name=0, WFlags fl=0)
virtual ~OFontSelector ()
bool selectedFont (QString &family, QString &style, int &size)
bool selectedFont (QString &family, QString &style, int &size, QString &charset)
QFont selectedFont ()
bool setSelectedFont (const QFont &)
bool setSelectedFont (const QString &family, const QString &style, int size, const QString &charset=0)
QString fontFamily () const
QString fontStyle () const
int fontSize () const
QString fontCharSet () const

Protected Slots

virtual void fontFamilyClicked (int)
virtual void fontStyleClicked (int)
virtual void fontSizeClicked (int)

Protected Member Functions

virtual void resizeEvent (QResizeEvent *re)

Private Member Functions

void loadFonts (QListBox *)
void changeFont ()

Private Attributes

OFontSelectorPrivated

Detailed Description

A widget to select a font.

This class lets you chose a Font out of a list of Fonts. It can show a preview too. This selector will use all available fonts

See also:
QWidget

QFont

Author:
Rober Griebl

Definition at line 48 of file ofontselector.h.


Constructor & Destructor Documentation

OFontSelector::OFontSelector bool  withpreview,
QWidget *  parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

Constructs the Selector object

Parameters:
withpreview If a font preview should be given
parent The parent of the Font Selector
name The name of the object
fl WidgetFlags

Definition at line 113 of file ofontselector.cpp.

References d, fontFamilyClicked(), fontSizeClicked(), fontStyleClicked(), loadFonts(), qt_version(), and tr.

OFontSelector::~OFontSelector  )  [virtual]
 

Definition at line 157 of file ofontselector.cpp.

References d.


Member Function Documentation

void OFontSelector::changeFont  )  [private]
 

Definition at line 367 of file ofontselector.cpp.

References d, f, fontSelected(), and selectedFont().

Referenced by fontFamilyClicked(), fontSizeClicked(), and fontStyleClicked().

QString OFontSelector::fontCharSet  )  const
 

returns the charset of the font or QString::null

Definition at line 264 of file ofontselector.cpp.

References d, and QString::null.

QString OFontSelector::fontFamily  )  const
 

This method does return the font family or QString::null if there is no font item selected

Returns:
the font family

Definition at line 231 of file ofontselector.cpp.

References d, and QString::null.

void OFontSelector::fontFamilyClicked int   )  [protected, virtual, slot]
 

For internal use only.

Definition at line 314 of file ofontselector.cpp.

References begin, changeFont(), d, end, findItemCB(), fontSizeClicked(), fontStyleClicked(), i, and QString::number().

Referenced by OFontSelector(), and setSelectedFont().

void OFontSelector::fontSelected const QFont &   )  [signal]
 

This signal gets emitted when a font got chosen

Referenced by changeFont().

int OFontSelector::fontSize  )  const
 

This method will return the font size or 10 if no font size is available

Definition at line 253 of file ofontselector.cpp.

References d.

void OFontSelector::fontSizeClicked int   )  [protected, virtual, slot]
 

For internal use only.

Definition at line 362 of file ofontselector.cpp.

References changeFont().

Referenced by fontFamilyClicked(), OFontSelector(), and setSelectedFont().

QString OFontSelector::fontStyle  )  const
 

This method will return the style of the font or QString::null

Returns:
the style of the font

Definition at line 242 of file ofontselector.cpp.

References d, and QString::null.

void OFontSelector::fontStyleClicked int   )  [protected, virtual, slot]
 

For internal use only.

Definition at line 357 of file ofontselector.cpp.

References changeFont().

Referenced by fontFamilyClicked(), OFontSelector(), and setSelectedFont().

void OFontSelector::loadFonts QListBox *   )  [private]
 

Definition at line 298 of file ofontselector.cpp.

References begin, d, end, and f.

Referenced by OFontSelector().

void OFontSelector::resizeEvent QResizeEvent *  re  )  [protected, virtual]
 

Definition at line 399 of file ofontselector.cpp.

References d, and height.

QFont OFontSelector::selectedFont  ) 
 

Return the selected font

Definition at line 380 of file ofontselector.cpp.

References d, and QString::null.

Referenced by changeFont(), and selectedFont().

bool OFontSelector::selectedFont QString family,
QString style,
int &  size,
QString charset
 

Overloaded member function see above

See also:
selectedFont

Definition at line 275 of file ofontselector.cpp.

References d, and QString::null.

bool OFontSelector::selectedFont QString family,
QString style,
int &  size
 

This method returns the name, style and size of the currently selected font or false if no font is selected

Parameters:
family The font family will be written there
style The style will be written there
size The size will be written there
Returns:
success or failure

Definition at line 219 of file ofontselector.cpp.

References selectedFont().

bool OFontSelector::setSelectedFont const QString familyStr,
const QString styleStr,
int  sizeVal,
const QString charset = 0
 

This is an overloaded method

See also:
setSelectedFont
Parameters:
familyStr The family of the font
styleStr The style of the font
sizeVal The size of font
charset The charset to be used. Will be deprecated by QT3

Definition at line 180 of file ofontselector.cpp.

References d, findItemCB(), fontFamilyClicked(), fontSizeClicked(), fontStyleClicked(), QString::number(), and size.

bool OFontSelector::setSelectedFont const QFont &  f  ) 
 

This methods tries to set the font

Parameters:
f The wishes font
Returns:
success or failure

Definition at line 167 of file ofontselector.cpp.

References d.


Member Data Documentation

OFontSelectorPrivate* OFontSelector::d [private]
 

Definition at line 92 of file ofontselector.h.

Referenced by changeFont(), fontCharSet(), fontFamily(), fontFamilyClicked(), fontSize(), fontStyle(), loadFonts(), OFontSelector(), resizeEvent(), selectedFont(), setSelectedFont(), and ~OFontSelector().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:42:36 2005 for OPIE by  doxygen 1.4.2