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.
21 #include <QToolButton>
31 class GuiCommandBuffer;
32 class GuiLayoutFilterModel;
39 class MenuButton : public QToolButton
44 MenuButton(GuiToolbar * bar, ToolbarItem const & item,
45 bool const sticky = false);
53 ToolbarItem const & tbitem_;
57 void actionTriggered(QAction * action);
59 void updateTriggered();
64 class GuiToolbar : public QToolBar
69 GuiToolbar(ToolbarInfo const &, GuiView &);
71 /// Reimplemented from QToolbar to detect whether the
72 /// toolbar is restored with MainWindow::restoreState().
73 void setVisible(bool visible);
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();
92 bool isRestored() const;
94 /// Refresh the contents of the bar.
95 void update(bool in_math, bool in_table, bool review,
96 bool in_mathmacrotemplate, bool in_ipa);
102 GuiCommandBuffer * commandBuffer() { return command_buffer_; }
105 Action * addItem(ToolbarItem const & item);
112 // load flags with saved values
117 void showEvent(QShowEvent *);
120 QList<Action *> actions_;
121 /// initial visibility flags
126 GuiCommandBuffer * command_buffer_;
128 ToolbarInfo const & tbinfo_;
135 } // namespace frontend
138 #endif // GUITOOLBAR_H