4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Jean-Marc Lasgouttes
10 * Full author contact details are available in file CREDITS.
13 #ifndef TOOLBAR_BACKEND_H
14 #define TOOLBAR_BACKEND_H
16 #include "FuncRequest.h"
33 /// the command buffer
35 /// adds space between buttons in the toolbar
37 /// a special combox insead of a button
39 /// a special widget to insert tabulars
47 ToolbarItem(Type type,
48 FuncRequest const & func,
49 docstring const & label = docstring());
51 ToolbarItem(Type type,
52 std::string const & name = std::string(),
53 docstring const & label = docstring());
70 typedef std::vector<ToolbarItem> Items;
72 typedef Items::const_iterator item_iterator;
74 explicit ToolbarInfo(std::string const & name = std::string())
84 /// read a toolbar from the file
85 ToolbarInfo & read(Lexer &);
89 void add(ToolbarItem const &);
96 /// toolbar visibility flags
99 OFF = 2, //< do not show
100 TOP = 4, //< show at top
101 BOTTOM = 8, //< show at bottom
102 LEFT = 16, //< show at left
103 RIGHT = 32, //< show at right
104 AUTO = 64, //< only if AUTO is set, when MATH, TABLE and REVIEW is used
105 MATH = 128, //< show when in math
106 TABLE = 256, //< show when in table
107 REVIEW = 512, //< show when change tracking is enabled
108 MATHMACROTEMPLATE = 1024 //< show in math macro template
111 typedef std::vector<ToolbarInfo> Infos;
118 /// iterator for all toolbars
119 Infos::const_iterator begin() const { return toolbar_info_.begin(); }
121 Infos::const_iterator end() const { return toolbar_info_.end(); }
123 Infos::iterator begin() { return toolbar_info_.begin(); }
125 Infos::iterator end() { return toolbar_info_.end(); }
127 /// read toolbars from the file
128 void readToolbars(Lexer &);
130 /// read ui toolbar settings
131 void readToolbarSettings(Lexer &);
134 ToolbarInfo const * info(std::string const & name) const;
136 int defaultVisibility(std::string const & name) const;
138 bool isMainToolbar(std::string const & name) const;
141 /// all the defined toolbars
144 std::map<std::string, int> toolbar_visibility_;
147 } // namespace frontend
150 #endif // TOOLBAR_BACKEND_H