4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * \author Jean-Marc Lasgouttes
10 * \author Angus Leeming
11 * \author Abdelrazak Younes
13 * Full author contact details are available in file CREDITS.
25 class QStandardItemModel;
35 class FilterItemDelegate;
36 class GuiCommandBuffer;
37 class GuiFilterProxyModel;
42 class GuiLayoutBox : public QComboBox
46 GuiLayoutBox(GuiView &);
48 /// select the right layout in the combobox.
49 void set(docstring const & layout);
50 /// Populate the layout combobox.
51 void updateContents(bool reset);
52 /// Add Item to Layout box according to sorting settings from preferences
53 void addItemSort(docstring const & item, bool sorted);
56 bool eventFilter(QObject * o, QEvent * e);
58 QString const & filter() { return filter_; }
62 void selected(int index);
68 void setFilter(QString const & s);
73 DocumentClass const * text_class_;
77 /// the layout model: 1st column translated, 2nd column raw layout name
78 QStandardItemModel * model_;
79 /// the proxy model filtering \c model_
80 GuiFilterProxyModel * filterModel_;
81 /// the (model-) index of the last successful selection
83 /// the character filter
86 FilterItemDelegate * filterItemDelegate_;
90 class GuiToolbar : public QToolBar
94 GuiToolbar(ToolbarInfo const &, GuiView &);
96 /// Add a button to the bar.
97 void add(ToolbarItem const & item);
98 /** update toolbar information
99 * ToolbarInfo will then be saved by session
101 void saveInfo(ToolbarSection::ToolbarInfo & info);
102 /// Refresh the contents of the bar.
103 void updateContents();
105 GuiCommandBuffer * commandBuffer() { return command_buffer_; }
107 Action * addItem(ToolbarItem const & item);
114 QList<Action *> actions_;
117 GuiLayoutBox * layout_;
118 GuiCommandBuffer * command_buffer_;
121 } // namespace frontend
124 #endif // GUITOOLBAR_H