author | zecke <zecke> | 2003-08-25 15:00:50 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-08-25 15:00:50 (UTC) |
commit | bf3c4abb9dff716e098f05852d9a3d8ac8cbcb44 (patch) (unidiff) | |
tree | f74d4765868000d27c45771573032515ac8db8be /core/launcher/launchertab.h | |
parent | 292b097e7db25dd231381c5b09307a1fbe81a492 (diff) | |
download | opie-bf3c4abb9dff716e098f05852d9a3d8ac8cbcb44.zip opie-bf3c4abb9dff716e098f05852d9a3d8ac8cbcb44.tar.gz opie-bf3c4abb9dff716e098f05852d9a3d8ac8cbcb44.tar.bz2 |
Initial revision
-rw-r--r-- | core/launcher/launchertab.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/core/launcher/launchertab.h b/core/launcher/launchertab.h new file mode 100644 index 0000000..653919b --- a/dev/null +++ b/core/launcher/launchertab.h | |||
@@ -0,0 +1,90 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of the Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef LAUNCHERTAB_H | ||
21 | #define LAUNCHERTAB_H | ||
22 | |||
23 | #include <qcolor.h> | ||
24 | #include <qstring.h> | ||
25 | #include <qwidget.h> | ||
26 | #include <qrect.h> | ||
27 | #include <qiconset.h> | ||
28 | #include <qlist.h> | ||
29 | #include <qdict.h> | ||
30 | #include <qtabbar.h> | ||
31 | |||
32 | class LauncherView; | ||
33 | |||
34 | class LauncherTab : public QTab | ||
35 | { | ||
36 | public: | ||
37 | LauncherTab( const QString &idStr, LauncherView *viewPtr, | ||
38 | const QIconSet &iconSet, | ||
39 | const QString &textStr=QString::null ) | ||
40 | : QTab( iconSet, textStr ) | ||
41 | { | ||
42 | type = idStr; | ||
43 | view = viewPtr; | ||
44 | } | ||
45 | |||
46 | QString type; | ||
47 | LauncherView *view; | ||
48 | QColor bgColor; | ||
49 | QColor fgColor; | ||
50 | }; | ||
51 | |||
52 | class LauncherTabBar : public QTabBar | ||
53 | { | ||
54 | Q_OBJECT | ||
55 | public: | ||
56 | LauncherTabBar( QWidget *parent=0, const char *name=0 ); | ||
57 | ~LauncherTabBar(); | ||
58 | |||
59 | void insertTab( LauncherTab *, int index = -1 ); | ||
60 | void removeTab( QTab * ); | ||
61 | |||
62 | LauncherView *currentView() { | ||
63 | return currentLauncherTab()->view; | ||
64 | } | ||
65 | |||
66 | LauncherTab *currentLauncherTab() { | ||
67 | return (LauncherTab*) tab( currentTab() ); | ||
68 | } | ||
69 | |||
70 | LauncherTab *launcherTab( const QString &id ) const { return tabs[id]; } | ||
71 | |||
72 | void nextTab(); | ||
73 | void prevTab(); | ||
74 | |||
75 | public slots: | ||
76 | void showTab(const QString&); | ||
77 | |||
78 | protected slots: | ||
79 | virtual void layoutTabs(); | ||
80 | |||
81 | protected: | ||
82 | virtual void paint( QPainter *p, QTab *t, bool f ) const; | ||
83 | void paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const; | ||
84 | |||
85 | private: | ||
86 | QList<LauncherTab> items; | ||
87 | QDict<LauncherTab> tabs; | ||
88 | }; | ||
89 | |||
90 | #endif | ||