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 usedtoolbars
.begin();
74 Toolbars::const_iterator
end() const {
75 return usedtoolbars
.end();
78 /// read a toolbar from the file
81 /// read the used toolbars
82 void readToolbars(LyXLex
&);
84 /// return a full path of an XPM for the given action
85 static string
const getIcon(int action
);
88 /// add the given lfun with tooltip if relevant
89 void add(Toolbar
& tb
, int, string
const & tooltip
= string());
91 /// add the given lfun with tooltip if relevant
92 void add(Toolbar
& tb
, string
const &, string
const & tooltip
);
98 Toolbars usedtoolbars
;
101 /// The global instance
102 extern ToolbarBackend toolbarbackend
;
105 #endif // TOOLBAR_BACKEND_H