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);
55 ToolbarItem const & tbitem_;
59 void actionTriggered(QAction * action);
61 void updateTriggered();
66 class GuiToolbar : public QToolBar
71 GuiToolbar(ToolbarInfo const &, GuiView &);
74 void setVisibility(int visibility);
76 /// Add a button to the bar.
77 void add(ToolbarItem const & item);
81 * This key must be used for any session setting.
83 QString sessionKey() const;
84 /// Save session settings.
85 void saveSession() const;
86 /// Restore session settings.
87 void restoreSession();
89 /// Refresh the contents of the bar.
90 void update(bool in_math, bool in_table, bool review,
91 bool in_mathmacrotemplate, bool in_ipa);
97 GuiCommandBuffer * commandBuffer() { return command_buffer_; }
100 Action * addItem(ToolbarItem const & item);
107 // load flags with saved values
112 void showEvent(QShowEvent *);
115 QList<Action *> actions_;
116 /// initial visibility flags
121 GuiCommandBuffer * command_buffer_;
123 ToolbarInfo const & tbinfo_;
128 } // namespace frontend
131 #endif // GUITOOLBAR_H