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
24 class ToolbarBackend {
26 /// The special toolbar actions
28 /// the command buffer
30 /// adds space between buttons in the toolbar
32 /// a special combox insead of a button
37 typedef std::pair<int, string> Item;
40 typedef std::vector<std::pair<int, string> > Items;
44 ON = 1, //< always shown
45 OFF = 2, //< never shown
46 MATH = 4, //< shown when in math
47 TABLE = 8, //< shown when in table
48 TOP = 16, //< show at top
49 BOTTOM = 32, //< show at bottom
50 LEFT = 64, //< show at left
51 RIGHT = 128 //< show at right
64 typedef std::vector<Toolbar> Toolbars;
66 typedef Items::const_iterator item_iterator;
70 /// iterator for all toolbars
71 Toolbars::const_iterator begin() const {
72 return usedtoolbars.begin();
75 Toolbars::const_iterator end() const {
76 return usedtoolbars.end();
79 /// read a toolbar from the file
82 /// read the used toolbars
83 void readToolbars(LyXLex &);
85 /// return a full path of an XPM for the given action
86 static string const getIcon(int action);
89 /// add the given lfun with tooltip if relevant
90 void add(Toolbar & tb, int, string const & tooltip = string());
92 /// add the given lfun with tooltip if relevant
93 void add(Toolbar & tb, string const &, string const & tooltip);
99 Toolbars usedtoolbars;
102 /// The global instance
103 extern ToolbarBackend toolbarbackend;
106 #endif // TOOLBAR_BACKEND_H