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

Opie::Ui::OFontSelector Class Reference

A widget to select a font. More...

#include </home/clem/local/src/opie/libopie2/opieui/ofontselector.h>

Collaboration diagram for Opie::Ui::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

Internal::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 55 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 129 of file ofontselector.cpp.

References d, fontFamilyClicked(), fontSizeClicked(), fontStyleClicked(), loadFonts(), Opie::Ui::Internal::OFontSelectorPrivate::m_font_family_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_size_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_style_list, Opie::Ui::Internal::OFontSelectorPrivate::m_pointbug, Opie::Ui::Internal::OFontSelectorPrivate::m_preview, qt_version(), and tr.

OFontSelector::~OFontSelector  )  [virtual]
 

Definition at line 174 of file ofontselector.cpp.

References d.


Member Function Documentation

void OFontSelector::changeFont  )  [private]
 

Definition at line 387 of file ofontselector.cpp.

References d, f, fontSelected(), Opie::Ui::Internal::OFontSelectorPrivate::m_preview, and selectedFont().

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

QString OFontSelector::fontCharSet  )  const
 

returns the charset of the font or QString::null

Definition at line 282 of file ofontselector.cpp.

References d, Opie::Ui::Internal::FontListItem::family(), Opie::Ui::Internal::OFontSelectorPrivate::m_fdb, Opie::Ui::Internal::OFontSelectorPrivate::m_font_family_list, and QString::null.

Referenced by TerminalWidget::save().

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 249 of file ofontselector.cpp.

References d, Opie::Ui::Internal::FontListItem::family(), Opie::Ui::Internal::OFontSelectorPrivate::m_font_family_list, and QString::null.

Referenced by TerminalWidget::save().

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

For internal use only.

Definition at line 332 of file ofontselector.cpp.

References begin, changeFont(), d, end, findItemCB(), fontSizeClicked(), fontStyleClicked(), i, Opie::Ui::Internal::OFontSelectorPrivate::m_font_family_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_size_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_style_list, QString::number(), Opie::Ui::Internal::FontListItem::sizes(), and Opie::Ui::Internal::FontListItem::styles().

Referenced by OFontSelector(), and setSelectedFont().

void Opie::Ui::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 271 of file ofontselector.cpp.

References d, Opie::Ui::Internal::OFontSelectorPrivate::m_font_family_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_size_list, and Opie::Ui::Internal::FontListItem::sizes().

Referenced by TerminalWidget::save().

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

For internal use only.

Definition at line 382 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 260 of file ofontselector.cpp.

References d, Opie::Ui::Internal::OFontSelectorPrivate::m_font_family_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_style_list, QString::null, and Opie::Ui::Internal::FontListItem::styles().

Referenced by TerminalWidget::save().

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

For internal use only.

Definition at line 377 of file ofontselector.cpp.

References changeFont().

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

void OFontSelector::loadFonts QListBox *   )  [private]
 

Definition at line 314 of file ofontselector.cpp.

References begin, d, end, f, Opie::Ui::Internal::OFontSelectorPrivate::m_fdb, and Opie::Ui::Internal::OFontSelectorPrivate::m_pointbug.

Referenced by OFontSelector().

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

Definition at line 419 of file ofontselector.cpp.

References d, and Opie::Ui::Internal::OFontSelectorPrivate::m_preview.

QFont OFontSelector::selectedFont  ) 
 

Return the selected font

Definition at line 400 of file ofontselector.cpp.

References d, Opie::Ui::Internal::OFontSelectorPrivate::m_fdb, Opie::Ui::Internal::OFontSelectorPrivate::m_font_family_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_size_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_style_list, 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 293 of file ofontselector.cpp.

References d, Opie::Ui::Internal::OFontSelectorPrivate::m_fdb, Opie::Ui::Internal::OFontSelectorPrivate::m_font_family_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_size_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_style_list, 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 237 of file ofontselector.cpp.

References selectedFont().

Referenced by ConfigureDlg::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 197 of file ofontselector.cpp.

References d, findItemCB(), fontFamilyClicked(), fontSizeClicked(), fontStyleClicked(), Opie::Ui::Internal::OFontSelectorPrivate::m_font_family_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_size_list, Opie::Ui::Internal::OFontSelectorPrivate::m_font_style_list, 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 184 of file ofontselector.cpp.

References d, and Opie::Ui::Internal::OFontSelectorPrivate::m_fdb.

Referenced by ConfigureDlg::ConfigureDlg(), and TerminalWidget::load().


Member Data Documentation

Internal::OFontSelectorPrivate* Opie::Ui::OFontSelector::d [private]
 

Definition at line 99 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 18:01:55 2005 for OPIE by  doxygen 1.4.2