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"
20 #include "support/std_string.h"
26 class ToolbarBackend {
28 /// The special toolbar actions
30 /// the command buffer
32 /// adds space between buttons in the toolbar
34 /// a special combox insead of a button
39 typedef std::pair<FuncRequest, string> Item;
42 typedef std::vector<Item> Items;
46 ON = 1, //< always shown
47 OFF = 2, //< never shown
48 MATH = 4, //< shown when in math
49 TABLE = 8, //< shown when in table
50 TOP = 16, //< show at top
51 BOTTOM = 32, //< show at bottom
52 LEFT = 64, //< show at left
53 RIGHT = 128 //< show at right
66 typedef std::vector<Toolbar> Toolbars;
68 typedef Items::const_iterator item_iterator;
72 /// iterator for all toolbars
73 Toolbars::const_iterator begin() const {
74 return usedtoolbars.begin();
77 Toolbars::const_iterator end() const {
78 return usedtoolbars.end();
81 /// read a toolbar from the file
84 /// read the used toolbars
85 void readToolbars(LyXLex &);
87 /// return a full path of an XPM for the given action
88 static string const getIcon(FuncRequest const &);
91 /// add the given lfun with tooltip if relevant
92 void add(Toolbar & tb, FuncRequest const &,
93 string const & tooltip = string());
99 Toolbars usedtoolbars;
102 /// The global instance
103 extern ToolbarBackend toolbarbackend;
106 #endif // TOOLBAR_BACKEND_H