]> git.lyx.org Git - features.git/blob - src/frontends/kde/dlg/tabstack.h
FormDocument and various fixes.
[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 QBoxLayout;
24
25 #include "boost/utility.hpp"
26
27 /**
28  * This widget provides a tab bar which can switch between a stack
29  * of QFrames.
30  */
31 class TabStack : public QWidget, public noncopyable {
32    Q_OBJECT
33 public:
34         TabStack(QWidget * parent = 0, const char * name = 0);
35         
36         ~TabStack();
37
38         /// add a page widget to the stack
39         virtual int addTabPage(QWidget *, const char *);
40         /// set the enabled status of a tab page
41         virtual void setTabPageEnabled(int, bool);
42         /// is a tab page enabled ?
43         virtual bool isTabPageEnabled(int) const;
44         /// raise the given tab page
45         virtual void setCurrentTabPage(int);
46         /// which tab page is currently on top
47         virtual int currentTabPage(void) const;
48
49 public slots:
50         /// show the widget 
51         virtual void show(void);
52
53 protected slots: 
54         /// a tab page has been selected 
55         virtual void selected(int);
56
57         /// paint widget
58         virtual void paintEvent(QPaintEvent *);
59  
60 private:
61         /// set up layout
62         void doLayout(void);
63
64         QTabBar *tabs;
65         QWidgetStack *stack;
66         QBoxLayout *topLayout;
67 };
68
69 #endif