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"
25 class ToolbarBackend {
27 /// The special toolbar actions
29 /// the command buffer
31 /// adds space between buttons in the toolbar
33 /// a special combox insead of a button
38 typedef std::pair<FuncRequest, std::string> Item;
41 typedef std::vector<Item> Items;
45 ON = 1, //< always shown
46 OFF = 2, //< never shown
47 MATH = 4, //< shown when in math
48 TABLE = 8, //< shown when in table
49 TOP = 16, //< show at top
50 BOTTOM = 32, //< show at bottom
51 LEFT = 64, //< show at left
52 RIGHT = 128 //< show at right
67 typedef std::vector<Toolbar> Toolbars;
69 typedef Items::const_iterator item_iterator;
73 /// iterator for all toolbars
74 Toolbars::const_iterator begin() const {
75 return usedtoolbars.begin();
78 Toolbars::const_iterator end() const {
79 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 std::string const & tooltip = std::string());
100 Toolbars usedtoolbars;
103 /// The global instance
104 extern ToolbarBackend toolbarbackend;
107 #endif // TOOLBAR_BACKEND_H