summaryrefslogtreecommitdiff
path: root/core/launcher/launchertab.h
Unidiff
Diffstat (limited to 'core/launcher/launchertab.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launchertab.h90
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
32class LauncherView;
33
34class LauncherTab : public QTab
35{
36public:
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
52class LauncherTabBar : public QTabBar
53{
54 Q_OBJECT
55public:
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
75public slots:
76 void showTab(const QString&);
77
78protected slots:
79 virtual void layoutTabs();
80
81protected:
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
85private:
86 QList<LauncherTab> items;
87 QDict<LauncherTab> tabs;
88};
89
90#endif