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 /// Mark panel (content) valid
45 void markPanelValid(QString const & name, bool valid);
46 /// set current panel by logical name
47 void setCurrentPanel(QString const &);
49 bool isCurrentPanel(QString const & name) const;
51 QSize sizeHint() const override;
54 /// the option filter changed
55 void filterChanged(QString const & search);
56 /// perform the search
58 /// reset the search box
60 /// set current panel from an item
61 void switchPanel(QTreeWidgetItem * it, QTreeWidgetItem * previous = 0);
63 void itemSelected(QTreeWidgetItem *, int);
67 void hideEvent(QHideEvent * event) override;
71 typedef QHash<QString, QTreeWidgetItem *> PanelMap;
75 typedef QHash<QTreeWidgetItem *, QWidget *> WidgetMap;
77 WidgetMap widget_map_;
79 /// contains the search box
80 FancyLineEdit * search_;
82 /// contains the items
85 /// contains the panes
86 QStackedWidget * stack_;
88 // timer to delay the search between options
89 QTimer * delay_search_;
93 } // namespace frontend
96 #endif // PANELSTACK_H