author | zecke <zecke> | 2003-09-07 12:47:42 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-09-07 12:47:42 (UTC) |
commit | dbea3ba9d8315f94d102af7e4a7244b1fb507f85 (patch) (unidiff) | |
tree | 2c1fe2aa303b6a900f2fffe7a18f91a949fc2d99 /libopie/big-screen/obarcollection.h | |
parent | e06de75edc6c01d97248050030f197bd8f21fb10 (diff) | |
download | opie-dbea3ba9d8315f94d102af7e4a7244b1fb507f85.zip opie-dbea3ba9d8315f94d102af7e4a7244b1fb507f85.tar.gz opie-dbea3ba9d8315f94d102af7e4a7244b1fb507f85.tar.bz2 |
Add thoughts and interface about dynamic ToolBar/MenuBar generation
and a modal helper template class
Diffstat (limited to 'libopie/big-screen/obarcollection.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/big-screen/obarcollection.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/libopie/big-screen/obarcollection.h b/libopie/big-screen/obarcollection.h new file mode 100644 index 0000000..5822360 --- a/dev/null +++ b/libopie/big-screen/obarcollection.h | |||
@@ -0,0 +1,107 @@ | |||
1 | /* | ||
2 | =. This file is part of the OPIE Project | ||
3 | .=l. Copyright (c) 2003 hOlgAr <zecke@handhelds.org> | ||
4 | .>+-= | ||
5 | _;:, .> :=|. This library is free software; you can | ||
6 | .> <`_, > . <= redistribute it and/or modify it under | ||
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
8 | .="- .-=="i, .._ License as published by the Free Software | ||
9 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
10 | ._= =} : or (at your option) any later version. | ||
11 | .%`+i> _;_. | ||
12 | .i_,=:_. -<s. This library is distributed in the hope that | ||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
14 | : .. .:, . . . without even the implied warranty of | ||
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
17 | ..}^=.= = ; Library General Public License for more | ||
18 | ++= -. .` .: details. | ||
19 | : = ...= . :.=- | ||
20 | -. .:....=;==+<; You should have received a copy of the GNU | ||
21 | -_. . . )=. = Library General Public License along with | ||
22 | -- :-=` this library; see the file COPYING.LIB. | ||
23 | If not, write to the Free Software Foundation, | ||
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
28 | |||
29 | #ifndef HAZE_OBAR_EXTENSION | ||
30 | #define HAZE_OBAR_EXTENSION | ||
31 | |||
32 | #include <qstring.h> | ||
33 | #include <qwidget.h> | ||
34 | |||
35 | class QAction; | ||
36 | class QPopupMenu; | ||
37 | |||
38 | /* | ||
39 | * ### TODO | ||
40 | * -Consider Life Updates | ||
41 | * -Make ValueBased like Opie-featurelist | ||
42 | */ | ||
43 | |||
44 | /** | ||
45 | * The different screen sizes have different look and feel. On bigger | ||
46 | * screens only a QToolBar feels strange. One is at least known to have | ||
47 | * a Help-Menu, a File Menu with Quit/Exit but instead of providing two | ||
48 | * different ways / two action sets we will group actions to gether and give | ||
49 | * them attributes when and where we might want them to be visible. | ||
50 | * We can also group actions. For example you could Group All Actions | ||
51 | * into the File Group. This means with many actions you would only have more toolbar | ||
52 | * actions but many sub menus in File. On bigger screen this would automatically | ||
53 | * expand to a full blown MenuBar and ToolButtons. | ||
54 | * | ||
55 | * @short Grouping of actions for dynamic Bar Generation | ||
56 | * @version 0.01 | ||
57 | * @author hOlgAr | ||
58 | */ | ||
59 | class OBarGroup { | ||
60 | public: | ||
61 | enum Preference { Allways, Never, IfPlace }; | ||
62 | OBarGroup( const QString& name, enum Preference groupPreference ); | ||
63 | ~OBarGroup(); | ||
64 | |||
65 | void add( QAction* action, enum Preference menuPreference, | ||
66 | enum Preference toolpreference ); | ||
67 | void add( const QString&, QPopupMenu* ); | ||
68 | |||
69 | void add( OBarGroup* ); | ||
70 | |||
71 | void remove( QAction* action ); | ||
72 | void remove( QMap* ); | ||
73 | |||
74 | protected: | ||
75 | OBarGroup* parent()const; | ||
76 | |||
77 | private: | ||
78 | }; | ||
79 | |||
80 | |||
81 | /** | ||
82 | * Add your groups in order to the bar manager | ||
83 | * and either call createGUI() on it, or tell it | ||
84 | * it the mainwindow and it is listening to the show event | ||
85 | * and then creates the toolbar | ||
86 | */ | ||
87 | class OBarManager : public QObject{ | ||
88 | public: | ||
89 | OBarManager( QWindow* parent ); | ||
90 | ~OBarManager(); | ||
91 | |||
92 | void add( OBarGroup*, int pos = -1 ); | ||
93 | void remove( OBarGroup* ); | ||
94 | |||
95 | bool eventFilter( QObject* , QEvent* ); | ||
96 | |||
97 | public slots: | ||
98 | void createGUI(); | ||
99 | }; | ||
100 | |||
101 | /* | ||
102 | * ### TODO GUI merging | ||
103 | */ | ||
104 | |||
105 | #endif | ||
106 | |||
107 | |||