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.
23 class QTreeWidgetItem;
30 class PanelStack : public QWidget
35 PanelStack(QWidget * parent = 0);
37 /// add a category with no associated panel
38 void addCategory(QString const & name, QString const & parent = QString());
39 /// add a widget panel with a given name, under the given parent
40 void addPanel(QWidget * panel, QString const & name,
41 QString const & parent = QString());
42 /// show or hide panel
43 void showPanel(QString const & name, bool show);
44 /// set current panel by logical name
45 void setCurrentPanel(QString const &);
47 bool isCurrentPanel(QString const & name) const;
49 QSize sizeHint() const override;
52 /// the option filter changed
53 void filterChanged(QString const & search);
54 /// perform the search
56 /// reset the search box
58 /// set current panel from an item
59 void switchPanel(QTreeWidgetItem * it, QTreeWidgetItem * previous = 0);
61 void itemSelected(QTreeWidgetItem *, int);
65 void hideEvent(QHideEvent * event) override;
69 typedef QHash<QString, QTreeWidgetItem *> PanelMap;
73 typedef QHash<QTreeWidgetItem *, QWidget *> WidgetMap;
75 WidgetMap widget_map_;
77 /// contains the search box
78 FancyLineEdit * search_;
80 /// contains the items
83 /// contains the panes
84 QStackedWidget * stack_;
86 // timer to delay the search between options
87 QTimer * delay_search_;
91 } // namespace frontend
94 #endif // PANELSTACK_H