summaryrefslogtreecommitdiff
path: root/libopie/ofontmenu.h
Unidiff
Diffstat (limited to 'libopie/ofontmenu.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie/ofontmenu.h34
1 files changed, 32 insertions, 2 deletions
diff --git a/libopie/ofontmenu.h b/libopie/ofontmenu.h
index 5fd515f..6e143ca 100644
--- a/libopie/ofontmenu.h
+++ b/libopie/ofontmenu.h
@@ -37,7 +37,9 @@
37#include <qpopupmenu.h> 37#include <qpopupmenu.h>
38#include <qlist.h> 38#include <qlist.h>
39 39
40 40/*
41 * @internal
42 */
41namespace { 43namespace {
42 struct WidSize { 44 struct WidSize {
43 QWidget *wid; 45 QWidget *wid;
@@ -46,8 +48,30 @@ namespace {
46 48
47}; 49};
48 50
49// if i would be on kde this would be a KActionMenu... 51// forward declarations
50class Config; 52class Config;
53
54/**
55 * This class is a specialised QPopupMenu. It'll display three different
56 * font sizes. Small, Normal and large by adding widgets to the Menu
57 * you can control the font size of these widgets
58 * by using the save and restore method you can also apply font sizes
59 * over two different runtimes
60 *
61 * <pre>
62 * QTable* tbl = new QTable();
63 * QList<QWidget> wid;
64 * wid.append( tbl );
65 * OFontMenu* menu = new OFontMenu(this, "Popup Menu", wid );
66 * Config cfg("mycfg");
67 * menu->restore( cfg );
68 * </pre>
69 *
70 * @author Holger Freyther ( zecke@handhelds.org )
71 * @version 0.1
72 * @short PopupMenu which can control the size of Widgets
73 * @see QPopupMenu
74 */
51class OFontMenu : public QPopupMenu { 75class OFontMenu : public QPopupMenu {
52 Q_OBJECT 76 Q_OBJECT
53 public: 77 public:
@@ -61,13 +85,19 @@ class OFontMenu : public QPopupMenu {
61 const QList<QWidget> &widgets()const; 85 const QList<QWidget> &widgets()const;
62 86
63 signals: 87 signals:
88 /**
89 * this signal gets emitted when the font size gets changed
90 * @param size The new size of font
91 */
64 void fontChanged(int size ); 92 void fontChanged(int size );
93
65 private: 94 private:
66 QList<QWidget> m_list; 95 QList<QWidget> m_list;
67 QList<WidSize> m_wids; 96 QList<WidSize> m_wids;
68 int m_size; 97 int m_size;
69 class OFontMenuPrivate; 98 class OFontMenuPrivate;
70 OFontMenuPrivate *d; 99 OFontMenuPrivate *d;
100
71 private slots: 101 private slots:
72 virtual void slotSmall(); 102 virtual void slotSmall();
73 virtual void slotMedium(); 103 virtual void slotMedium();