summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/otabwidget.h
Unidiff
Diffstat (limited to 'noncore/settings/sysinfo/otabwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/otabwidget.h97
1 files changed, 0 insertions, 97 deletions
diff --git a/noncore/settings/sysinfo/otabwidget.h b/noncore/settings/sysinfo/otabwidget.h
deleted file mode 100644
index 7450d51..0000000
--- a/noncore/settings/sysinfo/otabwidget.h
+++ b/dev/null
@@ -1,97 +0,0 @@
1/**********************************************************************
2** OTabWidget
3**
4** Modified tab widget control
5**
6** Copyright (C) 2002, Dan Williams
7** williamsdr@acm.org
8** http://draknor.net
9**
10** This file may be distributed and/or modified under the terms of the
11** GNU General Public License version 2 as published by the Free Software
12** Foundation and appearing in the file LICENSE.GPL included in the
13** packaging of this file.
14**
15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17**
18**********************************************************************/
19
20#ifndef OTABWIDGET_H
21#define OTABWIDGET_H
22
23#include <qwidget.h>
24#include <qlist.h>
25
26class QComboBox;
27class QPixmap;
28class QTabBar;
29class QWidgetStack;
30
31class TabInfo
32{
33public:
34 TabInfo() : i( -1 ), c( 0 ), p( 0 ), l( QString::null ) {}
35 TabInfo( int id, QWidget *control, const QString &icon, const QString &label )
36 : i( id ), c( control ), p( icon ), l( label ) {}
37 int id() const { return i; }
38 QString label() const { return l; }
39 QWidget *control() const { return c; }
40 QString icon() const { return p; }
41
42private:
43 int i;
44 QWidget *c;
45 QString p;
46 QString l;
47};
48
49typedef QList<TabInfo> TabInfoList;
50
51class OTabWidget : public QWidget
52{
53 Q_OBJECT
54public:
55 enum TabStyle { Global, TextTab, IconTab, TextList, IconList };
56 TabStyle tabStyle() const;
57 void setTabStyle( TabStyle );
58
59 enum TabPosition { Top, Bottom };
60 TabPosition tabPosition() const;
61 void setTabPosition( TabPosition );
62
63 OTabWidget( QWidget *, const char *, TabStyle, TabPosition );
64 ~OTabWidget();
65
66 void addTab( QWidget *, const QString &, const QString & );
67 void setCurrentTab( QWidget * );
68 void setCurrentTab( QString );
69 QSize sizeHint() const;
70
71
72protected:
73 void resizeEvent( QResizeEvent * );
74
75private:
76 TabInfoList tabs;
77 TabInfo *currentTab;
78
79 TabStyle tabBarStyle;
80 TabPosition tabBarPosition;
81
82 QWidgetStack *tabBarStack;
83 QTabBar *tabBar;
84 QComboBox *tabList;
85
86 QWidgetStack *widgetStack;
87
88 QPixmap loadSmooth( const QString & );
89 void selectTab( TabInfo * );
90 void setUpLayout();
91
92private slots:
93 void slotTabBarSelected( int );
94 void slotTabListSelected( int );
95};
96
97#endif