]> git.lyx.org Git - features.git/blob - src/frontends/kde/dlg/tabstack.h
cfb5665557dea6c8b0de251086bbb8ae982dc4de
[features.git] / src / frontends / kde / dlg / tabstack.h
1 /*
2  * tabstack.h
3  * (C) 2000 LyX Team
4  * John Levon, moz@compsoc.man.ac.uk
5  */
6
7 /***************************************************************************
8  *                                                                         *
9  *   This program is free software; you can redistribute it and/or modify  *
10  *   it under the terms of the GNU General Public License as published by  *
11  *   the Free Software Foundation; either version 2 of the License, or     *
12  *   (at your option) any later version.                                   *
13  *                                                                         *
14  ***************************************************************************/
15
16 #ifndef TABSTACK_H
17 #define TABSTACK_H
18
19 #include <qwidget.h>
20
21 class QTabBar;
22 class QWidgetStack; 
23 class QHBoxLayout;
24 class QVBoxLayout;
25
26 #include "boost/utility.hpp"
27
28 /**
29  * This widget provides a tab bar which can switch between a stack
30  * of QFrames.
31  */
32 class TabStack : public QWidget, public noncopyable {
33    Q_OBJECT
34 public:
35         TabStack(QWidget * parent = 0, const char * name = 0);
36         
37         ~TabStack();
38
39         /// add a page widget to the stack
40         virtual int addTabPage(QWidget *, const char *);
41         /// set the enabled status of a tab page
42         virtual void setTabPageEnabled(int, bool);
43         /// is a tab page enabled ?
44         virtual bool isTabPageEnabled(int) const;
45         /// raise the given tab page
46         virtual void setCurrentTabPage(int);
47         /// which tab page is currently on top
48         virtual int currentTabPage(void) const;
49
50 protected slots: 
51         virtual void selected(int);
52
53 protected:
54         virtual void paintEvent(QPaintEvent *);
55
56 private:
57         QTabBar *tabs;
58         QWidgetStack *stack;
59         QHBoxLayout *topLayout; 
60         QVBoxLayout *layout;
61 };
62
63 #endif