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());
73 OFF = 2, //< do not show
74 MATH = 4, //< show when in math
75 TABLE = 8, //< show when in table
76 TOP = 16, //< show at top
77 BOTTOM = 32, //< show at bottom
78 LEFT = 64, //< show at left
79 RIGHT = 128, //< show at right
80 REVIEW = 256, //< show when change tracking is enabled
81 AUTO = 512, //< only if AUTO is set, when MATH, TABLE and REVIEW is used
82 MATHMACROTEMPLATE = 1024 //< show in math macro template
85 typedef std::vector<ToolbarItem> Items;
87 typedef Items::const_iterator item_iterator;
89 explicit ToolbarInfo(std::string const & name = std::string())
100 /// store flags when coming to fullscreen mode
101 Flags before_fullscreen;
103 /// read a toolbar from the file
104 ToolbarInfo & read(Lexer &);
108 void add(ToolbarItem const &);
115 typedef std::vector<ToolbarInfo> Infos;
119 /// iterator for all toolbars
120 Infos::const_iterator begin() const { return usedtoolbars.begin(); }
122 Infos::const_iterator end() const { return usedtoolbars.end(); }
124 Infos::iterator begin() { return usedtoolbars.begin(); }
126 Infos::iterator end() { return usedtoolbars.end(); }
128 /// read toolbars from the file
129 void readToolbars(Lexer &);
131 /// read ui toolbar settings
132 void readToolbarSettings(Lexer &);
135 ToolbarInfo const * getDefinedToolbarInfo(std::string const & name) const;
137 ToolbarInfo * getUsedToolbarInfo(std::string const & name);
139 // FIXME should be deleted when every window has its own toolbar config.
140 /// number of toggleFullScreen calls, i.e. number of FullScreen windows.
141 int fullScreenWindows;
144 /// all the defined toolbars
151 } // namespace frontend
154 #endif // TOOLBAR_BACKEND_H