]> git.lyx.org Git - features.git/blob - src/frontends/xforms/Menubar_pimpl.h
rename Inset to InsetOld
[features.git] / src / frontends / xforms / Menubar_pimpl.h
1 // -*- C++ -*-
2 /**
3  * \file xforms/Menubar_pimpl.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 MENUBAR_PIMPL_H
13 #define MENUBAR_PIMPL_H
14
15
16 #include "LString.h"
17 #include "frontends/Menubar.h"
18
19 #include <boost/shared_ptr.hpp>
20
21 #include "forms_fwd.h"
22 #include <X11/X.h> // Window
23
24 #include <vector>
25 #include <map>
26
27 class LyXView;
28 class XFormsView;
29 class Menu;
30 class MenuItem;
31
32 /** The LyX GUI independent menubar class
33   The GUI interface is implemented in the corresponding Menubar_pimpl class.
34   */
35 struct Menubar::Pimpl {
36 public:
37         ///
38         Pimpl(LyXView *, MenuBackend const &);
39         ///
40         ~Pimpl();
41
42         /// update the state of the menuitems
43         void update();
44
45         /// Opens a top-level submenu given its name
46         void openByName(string const &);
47
48         ///
49         static void MenuCallback(FL_OBJECT *, long);
50
51 private:
52         ///
53         void add_toc(int menu, string const & extra_label,
54                      std::vector<int> & smn, Window win);
55         ///
56         void add_references(int menu, string const & extra_label,
57                             std::vector<int> & smn, Window win);
58         ///
59         int create_submenu(Window win, XFormsView * view,
60                            Menu const & menu, std::vector<int> & smn);
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(Menubar::Pimpl * p, MenuItem const * i,
73                          FL_OBJECT * o);
74                 ~ItemInfo();
75                 ///
76                 Menubar::Pimpl * pimpl_;
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