]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Menubar_pimpl.h
Swap two printer related help messages.
[lyx.git] / src / frontends / xforms / Menubar_pimpl.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *           Copyright 1995 Matthias Ettrich
7  *           Copyright 1995-2000 The LyX Team.
8  *
9  *           This file is Copyright 1996-2000
10  *           Lars Gullik Bjønnes
11  *
12  * ====================================================== */
13
14 #ifndef MENUBAR_PIMPL_H
15 #define MENUBAR_PIMPL_H
16
17 #ifdef __GNUG__
18 #pragma interface
19 #endif
20
21 #include <vector>
22 #include <map>
23 #include "LString.h"
24 #include "frontends/Menubar.h"
25 #include "commandtags.h"
26 #include FORMS_H_LOCATION
27 class LyXView;
28 class MenuBackend;
29 class MenuItem;
30 class Menu;
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         void set(string const &);
43         /// Opens a top-level submenu given its name
44         void openByName(string const &);
45
46         ///
47         static void MenuCallback(FL_OBJECT *, long);
48
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, LyXView * view,
57                            string const & menuname,
58                            std::vector<int> & smn);
59
60         /// update the state of the menuitems
61         void update() {}
62 private:
63         //
64         void makeMenubar(Menu const &menu);
65
66         /// 
67         LyXView * owner_;
68         ///
69         MenuBackend const * menubackend_;
70         ///
71         struct ItemInfo {
72                 ///
73                 ItemInfo(Menubar::Pimpl * p, MenuItem const * i, 
74                            FL_OBJECT * o) 
75                         : pimpl_(p), item_(i), obj_(o) {}
76                 ///
77                 Menubar::Pimpl * pimpl_;
78                 ///
79                 MenuItem const * item_;
80                 ///
81                 FL_OBJECT * obj_;
82         };
83
84         ///
85         typedef std::vector<ItemInfo *> ButtonList;
86         ///
87         ButtonList buttonlist_;
88
89         ///
90         typedef std::map<string, FL_OBJECT *> MenubarMap;
91         ///
92         MenubarMap menubarmap_;
93         ///
94         string current_menu_name_;
95         ///
96         FL_OBJECT * current_group_;
97 };
98 #endif