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
8 * \author Angus Leeming
9 * \author Abdelrazak Younes
11 * Full author contact details are available in file CREDITS.
14 #ifndef GUI_TOOLBARS_H
15 #define GUI_TOOLBARS_H
17 #include "TextClass.h"
35 GuiToolbars(GuiViewBase & owner);
37 /// Initialize the toolbars using the backend database.
40 /// Show/hide the named toolbar.
41 void display(std::string const & name, bool show);
44 ToolbarInfo * getToolbarInfo(std::string const & name);
46 /** toggle the state of toolbars (on/off/auto). Skip "auto"
47 * when allowauto is false.
49 void toggleToolbarState(std::string const & name, bool allowauto);
51 /// Update the state of the toolbars.
52 void update(bool in_math, bool in_table, bool review);
54 /// Is the Toolbar currently visible?
55 bool visible(std::string const & name) const;
57 /// save toolbar information
58 void saveToolbarInfo();
60 /// Select the right layout in the combox.
61 void setLayout(docstring const & layout);
63 /** Populate the layout combox - returns whether we did a full
66 bool updateLayoutList(TextClassPtr textclass);
68 /// Drop down the layout list.
69 void openLayoutList();
70 /// Erase the layout list.
71 void clearLayoutList();
73 /// Show or hide the command buffer.
74 void showCommandBuffer(bool show_it);
78 /// Add a new toolbar. if newline==true, start from a new line
79 void add(ToolbarInfo const & tbinfo, bool newline);
81 /// Show or hide a toolbar.
82 void displayToolbar(ToolbarInfo const & tbinfo, bool show);
84 /// Update the state of the icons
87 // load flags with saved values
88 void initFlags(ToolbarInfo & tbinfo);
90 /// The parent window.
93 /** The layout box is actually owned by whichever toolbar
94 * contains it. All the Toolbars class needs is a means of
97 * We don't need to use boost::weak_ptr here because the toolbars
98 * are also stored here. There are, therefore, no lifetime issues.
100 GuiLayoutBox * layout_;
102 /// Toolbar store providing access to individual toolbars by name.
103 typedef std::map<std::string, GuiToolbar *> ToolbarsMap;
104 ToolbarsMap toolbars_;
106 /// The last textclass layout list in the layout choice selector
107 TextClassPtr last_textclass_;
111 } // namespace frontend
114 #endif // NOT GUI_TOOLBARS_H