#include <QToolBar>
#include <QComboBox>
+class QStandardItemModel;
+
namespace lyx {
-class FuncRequest;
+class Inset;
+class DocumentClass;
class ToolbarItem;
namespace frontend {
+class FilterItemDelegate;
class GuiCommandBuffer;
-class GuiLayoutBox;
-class GuiViewBase;
+class GuiFilterProxyModel;
+class GuiView;
class Action;
{
Q_OBJECT
public:
- GuiLayoutBox(GuiViewBase &);
+ GuiLayoutBox(GuiView &);
/// select the right layout in the combobox.
void set(docstring const & layout);
- /// Populate the layout combox.
- void updateContents();
+ /// Populate the layout combobox.
+ void updateContents(bool reset);
+ /// Add Item to Layout box according to sorting settings from preferences
+ 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:
- GuiViewBase & owner_;
+ ///
+ void resetFilter();
+ ///
+ void setFilter(QString const & s);
+
+ ///
+ GuiView & owner_;
+ ///
+ 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_;
};
{
Q_OBJECT
public:
- GuiToolbar(ToolbarInfo const &, GuiViewBase &);
+ GuiToolbar(ToolbarInfo const &, GuiView &);
/// Add a button to the bar.
void add(ToolbarItem const & item);
void saveInfo(ToolbarSection::ToolbarInfo & info);
/// Refresh the contents of the bar.
void updateContents();
- GuiLayoutBox * layout() const { return layout_; }
- /// Set the focus on the command buffer, if any.
- void focusCommandBuffer();
+ ///
+ GuiCommandBuffer * commandBuffer() { return command_buffer_; }
+
+ Action * addItem(ToolbarItem const & item);
Q_SIGNALS:
void updated();
private:
- Action * addItem(ToolbarItem const & item);
QList<Action *> actions_;
- GuiViewBase & owner_;
+ GuiView & owner_;
GuiLayoutBox * layout_;
GuiCommandBuffer * command_buffer_;
};
-/// return a full path of an .png for the given action
-std::string const getIcon(FuncRequest const & f, bool unknown = true);
-
} // namespace frontend
} // namespace lyx