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"
18 #include "ToolbarBackend.h"
34 GuiToolbars(GuiViewBase & owner);
36 /// Initialize the toolbars using the backend database.
39 /// Show/hide the named toolbar.
40 void display(std::string const & name, bool show);
43 ToolbarInfo * getToolbarInfo(std::string const & name);
45 /** toggle the state of toolbars (on/off/auto). Skip "auto"
46 * when allowauto is false.
48 void toggleToolbarState(std::string const & name, bool allowauto);
50 /// Update the state of the toolbars.
51 void update(bool in_math, bool in_table, bool review);
53 /// Is the Toolbar currently visible?
54 bool visible(std::string const & name) const;
56 /// save toolbar information
57 void saveToolbarInfo();
59 /// Select the right layout in the combox.
60 void setLayout(docstring const & layout);
62 /** Populate the layout combox - returns whether we did a full
65 bool updateLayoutList(TextClassPtr textclass);
67 /// Drop down the layout list.
68 void openLayoutList();
69 /// Erase the layout list.
70 void clearLayoutList();
73 /// Add a new toolbar. if newline==true, start from a new line
74 void add(ToolbarInfo const & tbinfo, bool newline);
76 /// Show or hide a toolbar.
77 void displayToolbar(ToolbarInfo const & tbinfo, bool show);
79 /// Update the state of the icons
82 // load flags with saved values
83 void initFlags(ToolbarInfo & tbinfo);
85 /// The parent window.
88 /** The layout box is actually owned by whichever toolbar
89 * contains it. All the Toolbars class needs is a means of
92 * We don't need to use boost::weak_ptr here because the toolbars
93 * are also stored here. There are, therefore, no lifetime issues.
95 GuiLayoutBox * layout_;
97 /// Toolbar store providing access to individual toolbars by name.
98 typedef std::map<std::string, GuiToolbar *> ToolbarsMap;
99 ToolbarsMap toolbars_;
101 /// The last textclass layout list in the layout choice selector
102 TextClassPtr last_textclass_;
106 } // namespace frontend
109 #endif // NOT GUI_TOOLBARS_H