]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/XFormsToolbar.h
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / XFormsToolbar.h
1 // -*- C++ -*-
2 /**
3  * \file XFormsToolbar.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author Jean-Marc Lasgouttes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef XFORMSTOOLBAR_H
14 #define XFROMSTOOLBAR_H
15
16 #include <vector>
17 #include "forms_fwd.h"
18
19 #include "frontends/Toolbar.h"
20 #include "ToolbarBackend.h"
21
22 class XFormsView;
23 class Tooltips;
24
25 /** The LyX xforms toolbar class
26  */
27 class XFormsToolbar : public Toolbar {
28 public:
29         /// create an empty toolbar
30         XFormsToolbar(LyXView * o, int x, int y);
31
32         ///
33         ~XFormsToolbar();
34
35         /// add a new toolbar
36         void add(ToolbarBackend::Toolbar const & tb);
37
38         /// add an item to a toolbar
39         void add(FuncRequest const &, std::string const & tooltip);
40
41         /// display toolbar, not implemented
42         void displayToolbar(ToolbarBackend::Toolbar const & tb, bool show);
43
44         /// update the state of the icons
45         void update();
46
47         /// select the right layout in the combox
48         void setLayout(std::string const & layout);
49         /// Populate the layout combox.
50         void updateLayoutList();
51         /// Drop down the layout list
52         void openLayoutList();
53         /// Erase the layout list
54         void clearLayoutList();
55         ///
56         void layoutSelected();
57
58         /// an item on the toolbar
59         struct toolbarItem
60         {
61                 toolbarItem();
62
63                 ~toolbarItem();
64
65                 toolbarItem & operator=(toolbarItem const & ti);
66
67                 /// deallocate icon
68                 void kill_icon();
69
70                 /// lyx action
71                 FuncRequest func;
72                 /// icon for this item
73                 FL_OBJECT * icon;
74         };
75
76         typedef std::vector<FuncRequest> Funcs;
77
78         Funcs funcs;
79
80         typedef std::vector<toolbarItem> ToolbarList;
81
82         /// The list containing all the buttons
83         ToolbarList toollist_;
84         /// owning view
85         XFormsView * owner_;
86         /// tooltips manager
87         Tooltips * tooltip_;
88         /// layout combo
89         FL_OBJECT * combox_;
90         /// x position of end of toolbar
91         int xpos;
92         /// y position of end of toolbar
93         int ypos;
94 };
95
96 #endif