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
65 typedef std::vector<Toolbar> Toolbars;
67 typedef Items::const_iterator item_iterator;
71 /// iterator for all toolbars
72 Toolbars::const_iterator begin() const {
73 return usedtoolbars.begin();
76 Toolbars::const_iterator end() const {
77 return usedtoolbars.end();
80 /// read a toolbar from the file
83 /// read the used toolbars
84 void readToolbars(LyXLex &);
86 /// return a full path of an XPM for the given action
87 static std::string const getIcon(FuncRequest const &);
90 /// add the given lfun with tooltip if relevant
91 void add(Toolbar & tb, FuncRequest const &,
92 std::string const & tooltip = std::string());
98 Toolbars usedtoolbars;
101 /// The global instance
102 extern ToolbarBackend toolbarbackend;
105 #endif // TOOLBAR_BACKEND_H