]> git.lyx.org Git - features.git/blob - src/frontends/xforms/XFormsMenubar.h
Replace LString.h with support/std_string.h,
[features.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 "support/std_string.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 #include <map>
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         XFormsMenubar(LyXView *, MenuBackend const &);
36         ///
37         ~XFormsMenubar();
38
39         /// update the state of the menuitems
40         void update();
41
42         /// Opens a top-level submenu given its name
43         void openByName(string const &);
44
45         ///
46         static void MenuCallback(FL_OBJECT *, long);
47
48 private:
49         ///
50         void add_toc(int menu, string const & extra_label,
51                      std::vector<int> & smn, Window win);
52         ///
53         void add_references(int menu, string const & extra_label,
54                             std::vector<int> & smn, Window win);
55         ///
56         int create_submenu(Window win, XFormsView * view,
57                            Menu const & menu, std::vector<int> & smn);
58
59         //
60         void makeMenubar(Menu const & menu);
61
62         ///
63         XFormsView * owner_;
64         ///
65         MenuBackend const * menubackend_;
66         ///
67         struct ItemInfo {
68                 ///
69                 ItemInfo(XFormsMenubar * p, MenuItem const * i,
70                          FL_OBJECT * o);
71                 ~ItemInfo();
72                 ///
73                 XFormsMenubar * menubar_;
74                 ///
75                 boost::shared_ptr<MenuItem const> item_;
76                 ///
77                 FL_OBJECT * obj_;
78         };
79
80         ///
81         typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
82         ///
83         ButtonList buttonlist_;
84 };
85 #endif