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"
21 class QAbstractButton;
28 class QTreeWidgetItem;
34 class PanelStack : public QWidget
39 PanelStack(QWidget * parent = 0);
41 /// add a category with no associated panel
42 void addCategory(QString const & name, QString const & parent = QString());
43 /// add a widget panel with a given name, under the given parent
44 void addPanel(QWidget * panel, QString const & name,
45 QString const & parent = QString());
46 /// show or hide panel
47 void showPanel(QString const & name, bool show);
48 /// set current panel by logical name
49 void setCurrentPanel(QString const &);
51 bool isCurrentPanel(QString const & name) const;
53 QSize sizeHint() const;
56 /// the option filter changed
57 void filterChanged(QString const & search);
58 /// perform the search
60 /// reset the search box
62 /// set current panel from an item
63 void switchPanel(QTreeWidgetItem * it, QTreeWidgetItem * previous = 0);
65 void itemSelected(QTreeWidgetItem *, int);
69 void hideEvent(QHideEvent * event);
73 typedef QHash<QString, QTreeWidgetItem *> PanelMap;
77 typedef QHash<QTreeWidgetItem *, QWidget *> WidgetMap;
79 WidgetMap widget_map_;
81 /// contains the search box
82 FancyLineEdit * search_;
84 /// contains the items
87 /// contains the panes
88 QStackedWidget * stack_;
90 // timer to delay the search between options
91 QTimer * delay_search_;
95 } // namespace frontend
98 #endif // PANELSTACK_H