]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Menubar_pimpl.h
dont use pragma impementation and interface anymore
[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,
63                            std::vector<int> & smn, bool & all_disabled);
64
65         //
66         void makeMenubar(Menu const & menu);
67
68         ///
69         XFormsView * owner_;
70         ///
71         MenuBackend const * menubackend_;
72         ///
73         struct ItemInfo {
74                 ///
75                 ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
76                          FL_OBJECT * o);
77                 ~ItemInfo();
78                 ///
79                 Menubar::Pimpl * pimpl_;
80                 ///
81                 boost::shared_ptr<MenuItem const> item_;
82                 ///
83                 FL_OBJECT * obj_;
84         };
85
86         ///
87         typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
88         ///
89         ButtonList buttonlist_;
90 };
91 #endif