2007-10-01 20:45:50 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
|
|
|
|
* \file GuiToolbars.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Angus Leeming
|
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef GUI_TOOLBARS_H
|
|
|
|
|
#define GUI_TOOLBARS_H
|
|
|
|
|
|
2007-11-07 23:25:08 +00:00
|
|
|
|
#include "support/docstring.h"
|
2007-10-01 20:45:50 +00:00
|
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2007-10-15 22:43:55 +00:00
|
|
|
|
|
|
|
|
|
class ToolbarInfo;
|
2008-02-23 11:36:15 +00:00
|
|
|
|
class TextClassIndex;
|
2007-10-15 22:43:55 +00:00
|
|
|
|
|
2007-10-01 20:45:50 +00:00
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
|
|
class GuiToolbar;
|
2007-11-05 13:52:37 +00:00
|
|
|
|
class GuiView;
|
2007-10-01 20:45:50 +00:00
|
|
|
|
|
2007-10-01 21:51:06 +00:00
|
|
|
|
class GuiToolbars
|
2007-10-01 20:45:50 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
///
|
2007-11-05 13:52:37 +00:00
|
|
|
|
GuiToolbars(GuiView & owner);
|
2007-10-01 20:45:50 +00:00
|
|
|
|
|
2007-10-01 21:51:06 +00:00
|
|
|
|
/// Initialize the toolbars using the backend database.
|
|
|
|
|
void init();
|
|
|
|
|
|
|
|
|
|
/// Show/hide the named toolbar.
|
|
|
|
|
void display(std::string const & name, bool show);
|
|
|
|
|
|
|
|
|
|
/// get toolbar info
|
|
|
|
|
ToolbarInfo * getToolbarInfo(std::string const & name);
|
|
|
|
|
|
|
|
|
|
/** toggle the state of toolbars (on/off/auto). Skip "auto"
|
|
|
|
|
* when allowauto is false.
|
|
|
|
|
*/
|
|
|
|
|
void toggleToolbarState(std::string const & name, bool allowauto);
|
|
|
|
|
|
|
|
|
|
/// Update the state of the toolbars.
|
2007-12-23 00:47:37 +00:00
|
|
|
|
void update(bool in_math, bool in_table, bool review,
|
2007-12-23 00:48:41 +00:00
|
|
|
|
bool in_mathmacrotemplate);
|
2007-10-01 21:51:06 +00:00
|
|
|
|
|
|
|
|
|
/// Is the Toolbar currently visible?
|
2007-10-01 20:45:50 +00:00
|
|
|
|
bool visible(std::string const & name) const;
|
2007-10-01 21:51:06 +00:00
|
|
|
|
|
|
|
|
|
/// save toolbar information
|
2007-10-01 20:45:50 +00:00
|
|
|
|
void saveToolbarInfo();
|
2007-10-01 21:51:06 +00:00
|
|
|
|
|
2007-10-02 06:59:02 +00:00
|
|
|
|
/// Show or hide the command buffer.
|
|
|
|
|
void showCommandBuffer(bool show_it);
|
|
|
|
|
|
2008-02-19 21:51:55 +00:00
|
|
|
|
/// toggle visibility of toolbars and save its flags for return
|
|
|
|
|
void toggleFullScreen(bool start_full_screen);
|
2007-10-02 06:59:02 +00:00
|
|
|
|
|
2007-10-01 21:51:06 +00:00
|
|
|
|
private:
|
|
|
|
|
/// Add a new toolbar. if newline==true, start from a new line
|
2007-10-01 20:45:50 +00:00
|
|
|
|
void add(ToolbarInfo const & tbinfo, bool newline);
|
2007-10-01 21:51:06 +00:00
|
|
|
|
|
|
|
|
|
/// Show or hide a toolbar.
|
2007-10-01 20:45:50 +00:00
|
|
|
|
void displayToolbar(ToolbarInfo const & tbinfo, bool show);
|
2007-10-01 21:51:06 +00:00
|
|
|
|
|
|
|
|
|
/// Update the state of the icons
|
2007-10-01 20:45:50 +00:00
|
|
|
|
void updateIcons();
|
|
|
|
|
|
2007-10-01 21:51:06 +00:00
|
|
|
|
// load flags with saved values
|
|
|
|
|
void initFlags(ToolbarInfo & tbinfo);
|
|
|
|
|
|
2007-10-01 20:45:50 +00:00
|
|
|
|
/// The parent window.
|
2007-11-05 13:52:37 +00:00
|
|
|
|
GuiView & owner_;
|
2007-10-01 20:45:50 +00:00
|
|
|
|
|
|
|
|
|
/// Toolbar store providing access to individual toolbars by name.
|
|
|
|
|
typedef std::map<std::string, GuiToolbar *> ToolbarsMap;
|
|
|
|
|
ToolbarsMap toolbars_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2008-02-23 11:36:15 +00:00
|
|
|
|
#endif // GUI_TOOLBARS_H
|