3 * \file ToolbarBackend.h
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"
28 class ToolbarBackend {
30 /// The special toolbar actions
32 /// the command buffer
34 /// adds space between buttons in the toolbar
36 /// a special combox insead of a button
41 typedef std::pair<FuncRequest, docstring> Item;
44 typedef std::vector<Item> Items;
48 ON = 1, //< always shown
49 OFF = 2, //< never shown
50 MATH = 4, //< shown when in math
51 TABLE = 8, //< shown when in table
52 TOP = 16, //< show at top
53 BOTTOM = 32, //< show at bottom
54 LEFT = 64, //< show at left
55 RIGHT = 128, //< show at right
56 REVIEW = 256 //< shown when change tracking is enabled
71 typedef std::vector<Toolbar> Toolbars;
73 typedef Items::const_iterator item_iterator;
77 /// iterator for all toolbars
78 Toolbars::const_iterator begin() const { return usedtoolbars.begin(); }
80 Toolbars::const_iterator end() const { return usedtoolbars.end(); }
82 /// read a toolbar from the file
85 /// read the used toolbars
86 void readToolbars(LyXLex &);
88 /// return a full path of an XPM for the given action
89 static std::string const getIcon(FuncRequest const &);
92 /// add the given lfun with tooltip if relevant
93 void add(Toolbar & tb, FuncRequest const &,
94 docstring const & tooltip = docstring());
100 Toolbars usedtoolbars;
103 /// The global instance
104 extern ToolbarBackend toolbarbackend;
110 #endif // TOOLBAR_BACKEND_H