]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/panelstack.h
Remove quite a few compiler warnings:
[lyx.git] / src / frontends / qt4 / 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  * \author Abdelrazak Younes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12 #ifndef PANELSTACK_H
13 #define PANELSTACK_H
14
15 #include <QWidget>
16
17 #include <map>
18 #include <string>
19
20 class QTreeWidget;
21 class QTreeWidgetItem;
22 class QStackedWidget;
23
24 class PanelStack : public QWidget
25 {
26         Q_OBJECT
27 public:
28         PanelStack(QWidget * parent = 0);
29
30         /// add a category with no associated panel
31         void addCategory(std::string const & name, std::string const & parent = std::string());
32
33         /// add a widget panel with a given name, under the given parent
34         void addPanel(QWidget * panel, std::string const & name, std::string const & parent = std::string());
35
36         /// set current panel by logical name
37         void setCurrentPanel(std::string const &);
38
39 public Q_SLOTS:
40         /// set current panel from an item
41         void switchPanel(QTreeWidgetItem * i, QTreeWidgetItem* previous=0);
42
43 private:
44         typedef std::map<std::string, QTreeWidgetItem *> PanelMap;
45
46         PanelMap panel_map_;
47
48         typedef std::map<QTreeWidgetItem *, QWidget *> WidgetMap;
49
50         WidgetMap widget_map_;
51
52         /// contains the items
53         QTreeWidget * list_;
54
55         /// contains the panes
56         QStackedWidget * stack_;
57 };
58
59 #endif // PANELSTACK_H