]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/XFormsMenubar.h
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / XFormsMenubar.h
1 // -*- C++ -*-
2 /**
3  * \file XFormsMenubar.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  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef XFORMSMENUBAR_H
13 #define XFORMSMENUBAR_H
14
15 #include "funcrequest.h"
16 #include "frontends/Menubar.h"
17
18 #include <boost/shared_ptr.hpp>
19
20 #include "forms_fwd.h"
21 #include <X11/X.h> // Window
22
23 #include <vector>
24
25
26 class LyXView;
27 class XFormsView;
28 class Menu;
29 class MenuItem;
30 class MenuBackend;
31
32 class XFormsMenubar : public Menubar {
33 public:
34         ///
35         typedef std::vector<FuncRequest> Funcs;
36         ///
37         XFormsMenubar(LyXView *, MenuBackend const &);
38         ///
39         ~XFormsMenubar();
40
41         /// update the state of the menuitems
42         void update();
43
44         /// Opens a top-level submenu given its name
45         void openByName(std::string const &);
46
47         ///
48         static void MenuCallback(FL_OBJECT *, long);
49
50 private:
51         ///
52         void add_toc(int menu, std::string const & extra_label,
53                      std::vector<int> & smn, Window win);
54         ///
55         void add_references(int menu, std::string const & extra_label,
56                             std::vector<int> & smn, Window win);
57         ///
58         int create_submenu(Window win, XFormsView * view,
59                            Menu const & menu,
60                            std::vector<int> & smn, Funcs & funcs);
61
62         //
63         void makeMenubar(Menu const & menu);
64
65         ///
66         XFormsView * owner_;
67         ///
68         MenuBackend const * menubackend_;
69         ///
70         struct ItemInfo {
71                 ///
72                 ItemInfo(XFormsMenubar * p, MenuItem const * i,
73                          FL_OBJECT * o);
74                 ~ItemInfo();
75                 ///
76                 XFormsMenubar * menubar_;
77                 ///
78                 boost::shared_ptr<MenuItem const> item_;
79                 ///
80                 FL_OBJECT * obj_;
81         };
82
83         ///
84         typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
85         ///
86         ButtonList buttonlist_;
87 };
88 #endif