-rw-r--r-- | libopie/ofontmenu.h | 34 |
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 | |||
@@ -36,19 +36,43 @@ | |||
36 | 36 | ||
37 | #include <qpopupmenu.h> | 37 | #include <qpopupmenu.h> |
38 | #include <qlist.h> | 38 | #include <qlist.h> |
39 | 39 | ||
40 | 40 | /* | |
41 | * @internal | ||
42 | */ | ||
41 | namespace { | 43 | namespace { |
42 | struct WidSize { | 44 | struct WidSize { |
43 | QWidget *wid; | 45 | QWidget *wid; |
44 | int size; | 46 | int size; |
45 | }; | 47 | }; |
46 | 48 | ||
47 | }; | 49 | }; |
48 | 50 | ||
49 | // if i would be on kde this would be a KActionMenu... | 51 | // forward declarations |
50 | class Config; | 52 | class 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 | */ | ||
51 | class OFontMenu : public QPopupMenu { | 75 | class OFontMenu : public QPopupMenu { |
52 | Q_OBJECT | 76 | Q_OBJECT |
53 | public: | 77 | public: |
54 | OFontMenu(QWidget *parent, const char* name, const QList<QWidget> &list ); | 78 | OFontMenu(QWidget *parent, const char* name, const QList<QWidget> &list ); |
@@ -60,15 +84,21 @@ class OFontMenu : public QPopupMenu { | |||
60 | void removeWidget(QWidget *wid ); | 84 | void removeWidget(QWidget *wid ); |
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(); |
74 | virtual void slotLarge(); | 104 | virtual void slotLarge(); |