Diffstat (limited to 'libopie2/opieui/big-screen/obarcollection.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/big-screen/obarcollection.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/libopie2/opieui/big-screen/obarcollection.h b/libopie2/opieui/big-screen/obarcollection.h new file mode 100644 index 0000000..e3a2935 --- a/dev/null +++ b/libopie2/opieui/big-screen/obarcollection.h | |||
@@ -0,0 +1,116 @@ | |||
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 OBARCOLLECTION_H | ||
30 | #define OBARCOLLECTION_H | ||
31 | |||
32 | /* QT */ | ||
33 | |||
34 | #include <qstring.h> | ||
35 | #include <qwidget.h> | ||
36 | |||
37 | class QAction; | ||
38 | class QPopupMenu; | ||
39 | |||
40 | namespace Opie | ||
41 | { | ||
42 | |||
43 | /* | ||
44 | * ### TODO | ||
45 | * -Consider Life Updates | ||
46 | * -Make ValueBased like Opie-featurelist | ||
47 | */ | ||
48 | |||
49 | /** | ||
50 | * The different screen sizes have different look and feel. On bigger | ||
51 | * screens only a QToolBar feels strange. One is at least known to have | ||
52 | * a Help-Menu, a File Menu with Quit/Exit but instead of providing two | ||
53 | * different ways / two action sets we will group actions to gether and give | ||
54 | * them attributes when and where we might want them to be visible. | ||
55 | * We can also group actions. For example you could Group All Actions | ||
56 | * into the File Group. This means with many actions you would only have more toolbar | ||
57 | * actions but many sub menus in File. On bigger screen this would automatically | ||
58 | * expand to a full blown MenuBar and ToolButtons. | ||
59 | * | ||
60 | * @short Grouping of actions for dynamic Bar Generation | ||
61 | * @version 0.01 | ||
62 | * @author hOlgAr | ||
63 | */ | ||
64 | class OBarGroup | ||
65 | { | ||
66 | public: | ||
67 | enum Preference { Allways, Never, IfPlace }; | ||
68 | OBarGroup( const QString& name, enum Preference groupPreference ); | ||
69 | ~OBarGroup(); | ||
70 | |||
71 | void add( QAction* action, enum Preference menuPreference, | ||
72 | enum Preference toolpreference ); | ||
73 | void add( const QString&, QPopupMenu* ); | ||
74 | |||
75 | void add( OBarGroup* ); | ||
76 | |||
77 | void remove( QAction* action ); | ||
78 | void remove( QMap* ); | ||
79 | |||
80 | protected: | ||
81 | OBarGroup* parent()const; | ||
82 | |||
83 | private: | ||
84 | }; | ||
85 | |||
86 | |||
87 | /** | ||
88 | * Add your groups in order to the bar manager | ||
89 | * and either call createGUI() on it, or tell it | ||
90 | * it the mainwindow and it is listening to the show event | ||
91 | * and then creates the toolbar | ||
92 | */ | ||
93 | class OBarManager : public QObject | ||
94 | { | ||
95 | public: | ||
96 | OBarManager( QWindow* parent ); | ||
97 | ~OBarManager(); | ||
98 | |||
99 | void add( OBarGroup*, int pos = -1 ); | ||
100 | void remove( OBarGroup* ); | ||
101 | |||
102 | bool eventFilter( QObject* , QEvent* ); | ||
103 | |||
104 | public slots: | ||
105 | void createGUI(); | ||
106 | }; | ||
107 | |||
108 | /* | ||
109 | * ### TODO GUI merging | ||
110 | */ | ||
111 | |||
112 | }; | ||
113 | |||
114 | #endif | ||
115 | |||
116 | |||