#ifndef GUITOOLBAR_H
#define GUITOOLBAR_H
-#include "Session.h"
-
#include <QList>
#include <QToolBar>
#include <QToolButton>
+class QSettings;
+
namespace lyx {
class DocumentClass;
///
MenuButton(GuiToolbar * bar, ToolbarItem const & item,
bool const sticky = false);
- ///
- void mousePressEvent(QMouseEvent * e);
private:
+ ///
+ void initialize();
///
GuiToolbar * bar_;
///
ToolbarItem const & tbitem_;
- ///
- bool initialized_;
private Q_SLOTS:
///
void actionTriggered(QAction * action);
+ ///
+ void updateTriggered();
};
///
GuiToolbar(ToolbarInfo const &, GuiView &);
+ /// Reimplemented from QToolbar to detect whether the
+ /// toolbar is restored with MainWindow::restoreState().
+ void setVisible(bool visible);
+
///
void setVisibility(int visibility);
**/
QString sessionKey() const;
/// Save session settings.
- void saveSession() const;
+ void saveSession(QSettings & settings) const;
/// Restore session settings.
void restoreSession();
+ ///
+ bool isRestored() const;
+
/// Refresh the contents of the bar.
- void update(bool in_math, bool in_table, bool review,
- bool in_mathmacrotemplate);
+ void update(int context = 0);
///
void toggle();
+ /// toggles movability
+ void movable(bool silent = false);
+
///
GuiCommandBuffer * commandBuffer() { return command_buffer_; }
///
void showEvent(QShowEvent *);
- ///
- QString name_;
///
QList<Action *> actions_;
/// initial visibility flags
int visibility_;
///
- bool allowauto_;
- ///
GuiView & owner_;
///
- LayoutBox * layout_;
- ///
GuiCommandBuffer * command_buffer_;
///
ToolbarInfo const & tbinfo_;
///
bool filled_;
+ ///
+ bool restored_;
};
} // namespace frontend