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

OFontMenu Class Reference

PopupMenu which can control the size of Widgets. More...

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

List of all members.

Signals

void fontChanged (int size)

Public Member Functions

 OFontMenu (QWidget *parent, const char *name, const QList< QWidget > &list)
void save (Config *cfg)
void restore (Config *cfg)
void setWidgets (const QList< QWidget > &list)
void addWidget (QWidget *wid)
void forceSize (QWidget *wid, int size)
void removeWidget (QWidget *wid)
const QList< QWidget > & widgets () const

Private Slots

virtual void slotSmall ()
virtual void slotMedium ()
virtual void slotLarge ()
void setFontSize (int size)

Private Attributes

QList< QWidget > m_list
QList< WidSize > m_wids
int m_size
OFontMenuPrivate * d


Detailed Description

PopupMenu which can control the size of Widgets.

This class is a specialised QPopupMenu. It'll display three different font sizes. Small, Normal and large by adding widgets to the Menu you can control the font size of these widgets by using the save and restore method you can also apply font sizes over two different runtimes

 QTable* tbl = new QTable();
 QList<QWidget> wid;
 wid.append( tbl );
 OFontMenu* menu = new OFontMenu(this, "Popup Menu", wid );
 Config cfg("mycfg");
 menu->restore( cfg );
 

Author:
Holger Freyther ( zecke@handhelds.org )
Version:
0.1
See also:
QPopupMenu

Definition at line 75 of file ofontmenu.h.


Constructor & Destructor Documentation

OFontMenu::OFontMenu QWidget *  parent,
const char *  name,
const QList< QWidget > &  list
 

Constructs the FontMenu.

Parameters:
parent The parent widget
name A name for this widget
list The list of widgets to be controlled

Definition at line 14 of file ofontmenu.cc.

References m_list, m_size, m_wids, slotLarge(), slotMedium(), slotSmall(), tr, and TRUE.


Member Function Documentation

void OFontMenu::addWidget QWidget *  wid  ) 
 

add a widget to the list

Parameters:
wid The widget to be added

Definition at line 83 of file ofontmenu.cc.

References m_list.

void OFontMenu::fontChanged int  size  )  [signal]
 

this signal gets emitted when the font size gets changed

Parameters:
size The new size of font

Referenced by setFontSize().

void OFontMenu::forceSize QWidget *  wid,
int  size
 

Forces a size on a widget

Parameters:
wid The widget
size The font size forced onto the widget

Definition at line 110 of file ofontmenu.cc.

References m_wids.

void OFontMenu::removeWidget QWidget *  wid  ) 
 

removes the widget from the list of controlled objects

Parameters:
wid the to be removed widget

Definition at line 92 of file ofontmenu.cc.

References m_list.

void OFontMenu::restore Config cfg  ) 
 

This method restores the font size from a Config object it'll apply the sizes to the widgets and will also set the menu appropriate

Definition at line 47 of file ofontmenu.cc.

References m_size, and setFontSize().

void OFontMenu::save Config cfg  ) 
 

This method saves the font size into a Config object OFontMenu will be used as group and size as key

Parameters:
cfg The Config object to be used

Definition at line 36 of file ofontmenu.cc.

References m_size, Config::setGroup(), and Config::writeEntry().

void OFontMenu::setFontSize int  size  )  [private, slot]
 

Definition at line 138 of file ofontmenu.cc.

References fontChanged(), m_list, m_size, m_wids, and wid.

Referenced by restore(), slotLarge(), slotMedium(), and slotSmall().

void OFontMenu::setWidgets const QList< QWidget > &  list  ) 
 

set the list of widgets

Parameters:
list the widget list

Definition at line 74 of file ofontmenu.cc.

References m_list.

void OFontMenu::slotLarge  )  [private, virtual, slot]
 

Definition at line 131 of file ofontmenu.cc.

References setFontSize().

Referenced by OFontMenu().

void OFontMenu::slotMedium  )  [private, virtual, slot]
 

Definition at line 124 of file ofontmenu.cc.

References setFontSize().

Referenced by OFontMenu().

void OFontMenu::slotSmall  )  [private, virtual, slot]
 

Definition at line 117 of file ofontmenu.cc.

References setFontSize().

Referenced by OFontMenu().

const QList< QWidget > & OFontMenu::widgets  )  const
 

The list of controlled widgets

Definition at line 100 of file ofontmenu.cc.

References m_list.


Member Data Documentation

OFontMenuPrivate* OFontMenu::d [private]
 

Definition at line 98 of file ofontmenu.h.

QList<QWidget> OFontMenu::m_list [private]
 

Definition at line 95 of file ofontmenu.h.

Referenced by addWidget(), OFontMenu(), removeWidget(), setFontSize(), setWidgets(), and widgets().

int OFontMenu::m_size [private]
 

Definition at line 97 of file ofontmenu.h.

Referenced by OFontMenu(), restore(), save(), and setFontSize().

QList<WidSize> OFontMenu::m_wids [private]
 

Definition at line 96 of file ofontmenu.h.

Referenced by forceSize(), OFontMenu(), and setFontSize().


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