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);
59 bool eventFilter(QObject * o, QEvent * e);
61 QString const & filter() { return filter_; }
65 void selected(int index);
71 void setFilter(QString const & s);
76 DocumentClass const * text_class_;
80 /// the layout model: 1st column translated, 2nd column raw layout name
81 QStandardItemModel * model_;
82 /// the proxy model filtering \c model_
83 GuiFilterProxyModel * filterModel_;
84 /// the (model-) index of the last successful selection
86 /// the character filter
89 FilterItemDelegate * filterItemDelegate_;
93 class GuiToolbar : public QToolBar
97 GuiToolbar(ToolbarInfo const &, GuiView &);
99 /// Add a button to the bar.
100 void add(ToolbarItem const & item);
101 /** update toolbar information
102 * ToolbarInfo will then be saved by session
104 void saveInfo(ToolbarSection::ToolbarInfo & info);
105 /// Refresh the contents of the bar.
106 void updateContents();
108 GuiCommandBuffer * commandBuffer() { return command_buffer_; }
110 Action * addItem(ToolbarItem const & item);
117 QList<Action *> actions_;
120 GuiLayoutBox * layout_;
121 GuiCommandBuffer * command_buffer_;
124 } // namespace frontend
127 #endif // GUITOOLBAR_H