]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToolbar.h
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / GuiToolbar.h
index 0d0dceffba54d34cc59f3391da04bb10b94811d4..e5b869caa0ff8f4f60df956baa330610a7de751b 100644 (file)
 #include <QToolBar>
 #include <QComboBox>
 
+class QStandardItemModel;
+
 namespace lyx {
 
-class TextClass;
+class Inset;
+class DocumentClass;
 class ToolbarItem;
 
 namespace frontend {
 
+class FilterItemDelegate;
 class GuiCommandBuffer;
+class GuiFilterProxyModel;
 class GuiView;
 class Action;
 
@@ -45,14 +50,43 @@ public:
        /// Populate the layout combobox.
        void updateContents(bool reset);
        /// Add Item to Layout box according to sorting settings from preferences
-       void addItemSort(QString const & item, bool sorted);
+       void addItemSort(docstring const & item, bool sorted);
+
+       ///
+       void showPopup();
+       
+       ///
+       bool eventFilter(QObject * o, QEvent * e);
+       ///
+       QString const & filter() { return filter_; }
 
 private Q_SLOTS:
-       void selected(const QString & str);
+       ///
+       void selected(int index);
 
 private:
+       ///
+       void resetFilter();
+       ///
+       void setFilter(QString const & s);
+
+       ///
        GuiView & owner_;
-       TextClass const * text_class_;
+       ///
+       DocumentClass const * text_class_;
+       ///
+       Inset const * inset_;
+       
+       /// the layout model: 1st column translated, 2nd column raw layout name
+       QStandardItemModel * model_;
+       /// the proxy model filtering \c model_
+       GuiFilterProxyModel * filterModel_;
+       /// the (model-) index of the last successful selection
+       int lastSel_;
+       /// the character filter
+       QString filter_;
+       ///
+       FilterItemDelegate * filterItemDelegate_;
 };
 
 
@@ -73,11 +107,12 @@ public:
        ///
        GuiCommandBuffer * commandBuffer() { return command_buffer_; }
 
+       Action * addItem(ToolbarItem const & item);
+
 Q_SIGNALS:
        void updated();
 
 private:
-       Action * addItem(ToolbarItem const & item);
 
        QList<Action *> actions_;
        GuiView & owner_;