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>
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 &);
73 /// Reimplemented from QToolbar to detect whether the
74 /// toolbar is restored with MainWindow::restoreState().
75 void setVisible(bool visible);
78 void setVisibility(int visibility);
80 /// Add a button to the bar.
81 void add(ToolbarItem const & item);
85 * This key must be used for any session setting.
87 QString sessionKey() const;
88 /// Save session settings.
89 void saveSession(QSettings & settings) const;
90 /// Restore session settings.
91 void restoreSession();
94 bool isRestored() const;
96 /// Refresh the contents of the bar.
97 void update(int context = 0);
102 /// toggles movability
103 void movable(bool silent = false);
106 GuiCommandBuffer * commandBuffer() { return command_buffer_; }
109 Action * addItem(ToolbarItem const & item);
116 // load flags with saved values
121 void showEvent(QShowEvent *);
124 QList<Action *> actions_;
125 /// initial visibility flags
130 GuiCommandBuffer * command_buffer_;
132 ToolbarInfo const & tbinfo_;
139 } // namespace frontend
142 #endif // GUITOOLBAR_H