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"
32 /// the command buffer
34 /// adds space between buttons in the toolbar
36 /// a special combox insead of a button
38 /// a special widget to insert tabulars
46 ToolbarItem(Type type,
47 FuncRequest const & func,
48 docstring const & label = docstring());
50 ToolbarItem(Type type,
51 std::string const & name = std::string(),
52 docstring const & label = docstring());
69 typedef std::vector<ToolbarItem> Items;
71 typedef Items::const_iterator item_iterator;
73 explicit ToolbarInfo(std::string const & name = std::string())
83 /// read a toolbar from the file
84 ToolbarInfo & read(Lexer &);
88 void add(ToolbarItem const &);
95 /// toolbar visibility flags
98 OFF = 2, //< do not show
99 TOP = 4, //< show at top
100 BOTTOM = 8, //< show at bottom
101 LEFT = 16, //< show at left
102 RIGHT = 32, //< show at right
103 AUTO = 64, //< only if AUTO is set, when MATH, TABLE and REVIEW is used
104 MATH = 128, //< show when in math
105 TABLE = 256, //< show when in table
106 REVIEW = 512, //< show when change tracking is enabled
107 MATHMACROTEMPLATE = 1024 //< show in math macro template
110 typedef std::vector<ToolbarInfo> Infos;
114 /// iterator for all toolbars
115 Infos::const_iterator begin() const { return toolbar_info_.begin(); }
117 Infos::const_iterator end() const { return toolbar_info_.end(); }
119 Infos::iterator begin() { return toolbar_info_.begin(); }
121 Infos::iterator end() { return toolbar_info_.end(); }
123 /// read toolbars from the file
124 void readToolbars(Lexer &);
126 /// read ui toolbar settings
127 void readToolbarSettings(Lexer &);
130 ToolbarInfo const * info(std::string const & name) const;
132 int defaultVisibility(std::string const & name) const;
135 /// all the defined toolbars
138 std::map<std::string, int> toolbar_visibility_;
141 } // namespace frontend
144 #endif // TOOLBAR_BACKEND_H