X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FPanelStack.h;h=e0d03a189f0a73296ef8c028cb5ea0adc89a3c72;hb=28be7d552f62cc02fa86d7f79201d089bfb2d7b5;hp=fa32a54e44bbc507a8816677c564ae32b716e87b;hpb=ce09085156f7bd475f4079ab1ae05b77ace7785f;p=lyx.git diff --git a/src/frontends/qt4/PanelStack.h b/src/frontends/qt4/PanelStack.h index fa32a54e44..e0d03a189f 100644 --- a/src/frontends/qt4/PanelStack.h +++ b/src/frontends/qt4/PanelStack.h @@ -9,15 +9,23 @@ * * Full author contact details are available in file CREDITS. */ + #ifndef PANELSTACK_H #define PANELSTACK_H -#include +#include "FancyLineEdit.h" + #include +#include +class QAbstractButton; +class QHideEvent; +class QLineEdit; +class QPushButton; +class QStackedWidget; +class QTimer; class QTreeWidget; class QTreeWidgetItem; -class QStackedWidget; namespace lyx { namespace frontend { @@ -35,17 +43,31 @@ public: /// add a widget panel with a given name, under the given parent void addPanel(QWidget * panel, QString const & name, QString const & parent = QString()); + /// show or hide panel + void showPanel(QString const & name, bool show); /// set current panel by logical name void setCurrentPanel(QString const &); /// + bool isCurrentPanel(QString const & name) const; + /// QSize sizeHint() const; public Q_SLOTS: + /// the option filter changed + void filterChanged(QString const & search); + /// perform the search + void search(); + /// reset the search box + void resetSearch(); /// set current panel from an item void switchPanel(QTreeWidgetItem * it, QTreeWidgetItem * previous = 0); /// click on the tree void itemSelected(QTreeWidgetItem *, int); +protected: + /// widget hidden + void hideEvent(QHideEvent * event); + private: /// typedef QHash PanelMap; @@ -56,11 +78,18 @@ private: WidgetMap widget_map_; + /// contains the search box + FancyLineEdit * search_; + /// contains the items QTreeWidget * list_; /// contains the panes QStackedWidget * stack_; + + // timer to delay the search between options + QTimer * delay_search_; + }; } // namespace frontend