]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/XFormsToolbar.h
A layout engine for XForms.
[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 "LayoutEngine.h"
20
21 #include "frontends/Toolbar.h"
22 #include "ToolbarBackend.h"
23
24 class XFormsView;
25 class Tooltips;
26
27 /** The LyX xforms toolbar class
28  */
29 class XFormsToolbar : public Toolbar {
30 public:
31         /// create an empty toolbar
32         XFormsToolbar(LyXView * o);
33
34         ///
35         ~XFormsToolbar();
36
37         /// add a new toolbar
38         void add(ToolbarBackend::Toolbar const & tb);
39
40         /// add an item to a toolbar
41         void add(FuncRequest const &, std::string const & tooltip);
42
43         /// display toolbar, not implemented
44         void displayToolbar(ToolbarBackend::Toolbar const & tb, bool show);
45
46         /// update the state of the icons
47         void update();
48
49         /// select the right layout in the combox
50         void setLayout(std::string const & layout);
51         /// Populate the layout combox.
52         void updateLayoutList();
53         /// Drop down the layout list
54         void openLayoutList();
55         /// Erase the layout list
56         void clearLayoutList();
57         ///
58         void layoutSelected();
59
60         /// an item on the toolbar
61         struct toolbarItem
62         {
63                 toolbarItem();
64
65                 ~toolbarItem();
66
67                 toolbarItem & operator=(toolbarItem const & ti);
68
69                 /// deallocate icon
70                 void kill_icon();
71
72                 /// lyx action
73                 FuncRequest func;
74                 /// icon for this item
75                 FL_OBJECT * icon;
76         };
77
78         ///
79         lyx::frontend::Box * toolbar_;
80         ///
81         lyx::frontend::BoxList * toolbar_buttons_;
82         ///
83         lyx::frontend::WidgetMap widgets_;
84
85         typedef std::vector<FuncRequest> Funcs;
86
87         Funcs funcs;
88
89         typedef std::vector<toolbarItem> ToolbarList;
90
91         /// The list containing all the buttons
92         ToolbarList toollist_;
93         /// owning view
94         XFormsView * owner_;
95         /// tooltips manager
96         Tooltips * tooltip_;
97         /// layout combo
98         FL_OBJECT * combox_;
99 };
100
101 #endif