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 GuiCommandBuffer;
36 class GuiFilterProxyModel;
41 class GuiLayoutBox : public QComboBox
45 GuiLayoutBox(GuiView &);
47 /// select the right layout in the combobox.
48 void set(docstring const & layout);
49 /// Populate the layout combobox.
50 void updateContents(bool reset);
51 /// Add Item to Layout box according to sorting settings from preferences
52 void addItemSort(docstring const & item, bool sorted);
55 bool eventFilter(QObject * o, QEvent * e);
57 QString const & filter() { return filter_; }
61 void selected(int index);
67 void setFilter(QString const & s);
72 DocumentClass const * text_class_;
76 /// the layout model: 1st column translated, 2nd column raw layout name
77 QStandardItemModel * model_;
78 /// the proxy model filtering \c model_
79 GuiFilterProxyModel * filterModel_;
80 /// the (model-) index of the last successful selection
82 /// the character filter
87 class GuiToolbar : public QToolBar
91 GuiToolbar(ToolbarInfo const &, GuiView &);
93 /// Add a button to the bar.
94 void add(ToolbarItem const & item);
95 /** update toolbar information
96 * ToolbarInfo will then be saved by session
98 void saveInfo(ToolbarSection::ToolbarInfo & info);
99 /// Refresh the contents of the bar.
100 void updateContents();
102 GuiCommandBuffer * commandBuffer() { return command_buffer_; }
104 Action * addItem(ToolbarItem const & item);
111 QList<Action *> actions_;
114 GuiLayoutBox * layout_;
115 GuiCommandBuffer * command_buffer_;
118 } // namespace frontend
121 #endif // GUITOOLBAR_H