]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Menubar_pimpl.h
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / Menubar_pimpl.h
1 // -*- C++ -*-
2 /**
3  * \file xforms/Menubar_pimpl.h
4  * Copyright 1995 Matthias Ettrich
5  * Copyright 1996-2001 Lars Gullik Bjønnes
6  * This file is part of LyX, the document processor.
7  * Licence details can be found in the file COPYING.
8  *
9  * \author Lars Gullik Bjønnes
10  *
11  * Full author contact details are available in file CREDITS
12  */
13
14 #ifndef MENUBAR_PIMPL_H
15 #define MENUBAR_PIMPL_H
16
17
18 #include "LString.h"
19 #include "frontends/Menubar.h"
20
21 #include <boost/shared_ptr.hpp>
22
23 #include "forms_fwd.h"
24 #include <X11/X.h> // Window
25
26 #include <vector>
27 #include <map>
28
29 class LyXView;
30 class XFormsView;
31 class Menu;
32 class MenuItem;
33
34 /** The LyX GUI independent menubar class
35   The GUI interface is implemented in the corresponding Menubar_pimpl class.
36   */
37 struct Menubar::Pimpl {
38 public:
39         ///
40         Pimpl(LyXView *, MenuBackend const &);
41         ///
42         ~Pimpl();
43
44         /// update the state of the menuitems
45         void update();
46
47         /// Opens a top-level submenu given its name
48         void openByName(string const &);
49
50         ///
51         static void MenuCallback(FL_OBJECT *, long);
52
53 private:
54         ///
55         void add_toc(int menu, string const & extra_label,
56                      std::vector<int> & smn, Window win);
57         ///
58         void add_references(int menu, string const & extra_label,
59                             std::vector<int> & smn, Window win);
60         ///
61         int create_submenu(Window win, XFormsView * view,
62                            Menu const & menu, std::vector<int> & smn);
63
64         //
65         void makeMenubar(Menu const & menu);
66
67         ///
68         XFormsView * owner_;
69         ///
70         MenuBackend const * menubackend_;
71         ///
72         struct ItemInfo {
73                 ///
74                 ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
75                          FL_OBJECT * o);
76                 ~ItemInfo();
77                 ///
78                 Menubar::Pimpl * pimpl_;
79                 ///
80                 boost::shared_ptr<MenuItem const> item_;
81                 ///
82                 FL_OBJECT * obj_;
83         };
84
85         ///
86         typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
87         ///
88         ButtonList buttonlist_;
89 };
90 #endif