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(int context = 0);
101 GuiCommandBuffer * commandBuffer() { return command_buffer_; }
104 Action * addItem(ToolbarItem const & item);
111 // load flags with saved values
116 void showEvent(QShowEvent *);
119 QList<Action *> actions_;
120 /// initial visibility flags
125 GuiCommandBuffer * command_buffer_;
127 ToolbarInfo const & tbinfo_;
134 } // namespace frontend
137 #endif // GUITOOLBAR_H