4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Abdelrazak Younes
10 * Full author contact details are available in file CREDITS.
16 #include "FancyLineEdit.h"
25 class QTreeWidgetItem;
31 class PanelStack : public QWidget
36 PanelStack(QWidget * parent = 0);
38 /// add a category with no associated panel
39 void addCategory(QString const & name, QString const & parent = QString());
40 /// add a widget panel with a given name, under the given parent
41 void addPanel(QWidget * panel, QString const & name,
42 QString const & parent = QString());
43 /// show or hide panel
44 void showPanel(QString const & name, bool show);
45 /// set current panel by logical name
46 void setCurrentPanel(QString const &);
48 bool isCurrentPanel(QString const & name) const;
50 QSize sizeHint() const override;
53 /// the option filter changed
54 void filterChanged(QString const & search);
55 /// perform the search
57 /// reset the search box
59 /// set current panel from an item
60 void switchPanel(QTreeWidgetItem * it, QTreeWidgetItem * previous = 0);
62 void itemSelected(QTreeWidgetItem *, int);
66 void hideEvent(QHideEvent * event) override;
70 typedef QHash<QString, QTreeWidgetItem *> PanelMap;
74 typedef QHash<QTreeWidgetItem *, QWidget *> WidgetMap;
76 WidgetMap widget_map_;
78 /// contains the search box
79 FancyLineEdit * search_;
81 /// contains the items
84 /// contains the panes
85 QStackedWidget * stack_;
87 // timer to delay the search between options
88 QTimer * delay_search_;
92 } // namespace frontend
95 #endif // PANELSTACK_H