]> git.lyx.org Git - features.git/blob - src/frontends/qt3/panelstack.h
* Rename src/frontends/qt2 to src/frontends/qt3,
[features.git] / src / frontends / qt3 / panelstack.h
1 // -*- C++ -*-
2 /**
3  * \file panelstack.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11 #ifndef PANELSTACK_H
12 #define PANELSTACK_H
13
14 #include <qwidget.h>
15
16 #include <map>
17 #include <string>
18
19 class QListView;
20 class QListViewItem;
21 class QWidgetStack;
22
23 class PanelStack : public QWidget
24 {
25         Q_OBJECT
26 public:
27         PanelStack(QWidget * parent = 0, const char * name = "panelstack");
28
29         /// add a category with no associated panel
30         void addCategory(std::string const & name, std::string const & parent = std::string());
31
32         /// add a widget panel with a given name, under the given parent
33         void addPanel(QWidget * panel, std::string const & name, std::string const & parent = std::string());
34
35         /// set current panel by logical name
36         void setCurrentPanel(std::string const &);
37
38 public slots:
39         /// set current panel from an item
40         void switchPanel(QListViewItem * i);
41
42 private:
43         typedef std::map<std::string, QListViewItem *> PanelMap;
44
45         PanelMap panel_map_;
46
47         typedef std::map<QListViewItem *, QWidget *> WidgetMap;
48
49         WidgetMap widget_map_;
50
51         /// contains the items
52         QListView * list_;
53
54         /// contains the panes
55         QWidgetStack * stack_;
56 };
57
58 #endif // PANELSTACK_H