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.
23 #include <QToolButton>
33 class GuiCommandBuffer;
34 class GuiLayoutFilterModel;
41 class MenuButton : public QToolButton
46 MenuButton(GuiToolbar * bar, ToolbarItem const & item,
47 bool const sticky = false);
49 void mousePressEvent(QMouseEvent * e);
55 ToolbarItem const & tbitem_;
61 void actionTriggered(QAction * action);
63 void updateTriggered();
68 class GuiToolbar : public QToolBar
73 GuiToolbar(ToolbarInfo const &, GuiView &);
76 void setVisibility(int visibility);
78 /// Add a button to the bar.
79 void add(ToolbarItem const & item);
83 * This key must be used for any session setting.
85 QString sessionKey() const;
86 /// Save session settings.
87 void saveSession() const;
88 /// Restore session settings.
89 void restoreSession();
91 /// Refresh the contents of the bar.
92 void update(bool in_math, bool in_table, bool review,
93 bool in_mathmacrotemplate, bool in_ipa);
99 GuiCommandBuffer * commandBuffer() { return command_buffer_; }
102 Action * addItem(ToolbarItem const & item);
109 // load flags with saved values
114 void showEvent(QShowEvent *);
117 QList<Action *> actions_;
118 /// initial visibility flags
123 GuiCommandBuffer * command_buffer_;
125 ToolbarInfo const & tbinfo_;
130 } // namespace frontend
133 #endif // GUITOOLBAR_H