-rw-r--r-- | libopie/ofontmenu.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/libopie/ofontmenu.h b/libopie/ofontmenu.h new file mode 100644 index 0000000..37a628e --- a/dev/null +++ b/libopie/ofontmenu.h | |||
@@ -0,0 +1,77 @@ | |||
1 | |||
2 | /* | ||
3 | |||
4 | =. This file is part of the OPIE Project | ||
5 | .=l. Copyright (c) 2002 zekce <zecke@handhelds.org> | ||
6 | .>+-= | ||
7 | _;:, .> :=|. This library is free software; you can | ||
8 | .> <`_, > . <= redistribute it and/or modify it under | ||
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
10 | .="- .-=="i, .._ License as published by the Free Software | ||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
12 | ._= =} : or (at your option) any later version. | ||
13 | .%`+i> _;_. | ||
14 | .i_,=:_. -<s. This library is distributed in the hope that | ||
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
16 | : .. .:, . . . without even the implied warranty of | ||
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
19 | ..}^=.= = ; Library General Public License for more | ||
20 | ++= -. .` .: details. | ||
21 | : = ...= . :.=- | ||
22 | -. .:....=;==+<; You should have received a copy of the GNU | ||
23 | -_. . . )=. = Library General Public License along with | ||
24 | -- :-=` this library; see the file COPYING.LIB. | ||
25 | If not, write to the Free Software Foundation, | ||
26 | Inc., 59 Temple Place - Suite 330, | ||
27 | Boston, MA 02111-1307, USA. | ||
28 | |||
29 | */ | ||
30 | |||
31 | |||
32 | |||
33 | |||
34 | #ifndef ofontmenu_h | ||
35 | #define ofontmenu_h | ||
36 | |||
37 | #include <qpopupmenu.h> | ||
38 | #include <qlist.h> | ||
39 | |||
40 | |||
41 | namespace { | ||
42 | struct WidSize { | ||
43 | QWidget *wid; | ||
44 | int size; | ||
45 | }; | ||
46 | |||
47 | }; | ||
48 | |||
49 | // if i would be on kde this would be a KActionMenu... | ||
50 | class OFontMenu : public QPopupMenu { | ||
51 | Q_OBJECT | ||
52 | public: | ||
53 | OFontMenu(QWidget *parent, const char* name, const QList<QWidget> &list ); | ||
54 | void setWidgets(const QList<QWidget> &list ); | ||
55 | void addWidget(QWidget *wid ); | ||
56 | void forceSize(QWidget *wid, int size ); | ||
57 | void removeWidget(QWidget *wid ); | ||
58 | const QList<QWidget> &widgets()const; | ||
59 | |||
60 | private: | ||
61 | QList<QWidget> m_list; | ||
62 | QList<WidSize> m_wids; | ||
63 | class OFontMenuPrivate; | ||
64 | OFontMenuPrivate *d; | ||
65 | private slots: | ||
66 | virtual void slotSmall(); | ||
67 | virtual void slotMedium(); | ||
68 | virtual void slotLarge(); | ||
69 | void setFontSize(int size ); | ||
70 | }; | ||
71 | |||
72 | #endif | ||
73 | |||
74 | |||
75 | |||
76 | |||
77 | |||