3 * \file ToolbarBackend.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS
12 #ifndef TOOLBAR_BACKEND_H
13 #define TOOLBAR_BACKEND_H
23 class ToolbarBackend {
25 /// The special toolbar actions
27 /// the command buffer
29 /// adds space between buttons in the toolbar
31 /// a special combox insead of a button
36 typedef std::pair<int, string> Item;
39 typedef std::vector<std::pair<int, string> > Items;
43 ON = 1, //< always shown
44 OFF = 2, //< never shown
45 MATH = 4, //< shown when in math
46 TABLE = 8, //< shown when in table
47 TOP = 16, //< show at top
48 BOTTOM = 32, //< show at bottom
49 LEFT = 64, //< show at left
50 RIGHT = 128 //< show at right
63 typedef std::vector<Toolbar> Toolbars;
65 typedef Items::const_iterator item_iterator;
69 /// iterator for all toolbars
70 Toolbars::const_iterator begin() const {
71 return toolbars.begin();
74 Toolbars::const_iterator end() const {
75 return toolbars.end();
78 /// read a toolbar from the file
81 /// return a full path of an XPM for the given action
82 static string const getIcon(int action);
85 /// add the given lfun with tooltip if relevant
86 void add(Toolbar & tb, int, string const & tooltip = string());
88 /// add the given lfun with tooltip if relevant
89 void add(Toolbar & tb, string const &, string const & tooltip);
95 /// The global instance
96 extern ToolbarBackend toolbarbackend;
99 #endif // TOOLBAR_BACKEND_H