]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Toolbar_pimpl.h
No longer pass Controller & or Dialogs & to the View c-tors.
[lyx.git] / src / frontends / xforms / Toolbar_pimpl.h
1 // -*- C++ -*-
2 /**
3  * \file Toolbar_pimpl.h
4  * Copyright 2002 the LyX Team
5  * Copyright 1996-2001 Lars Gullik Bjønnes
6  * Read the file COPYING
7  *
8  * \author Lars Gullik Bjønnes, larsbj@lyx.org
9  */
10
11 #ifndef TOOLBAR_PIMPL_H
12 #define TOOLBAR_PIMPL_H
13
14 #include <vector>
15 #include "forms_fwd.h"
16
17 #include "frontends/Toolbar.h"
18
19 #ifdef __GNUG__
20 #pragma interface
21 #endif
22
23 class XFormsView;
24 class Tooltips;
25 class Combox;
26
27 /** The LyX xforms toolbar class
28   */
29 struct Toolbar::Pimpl {
30 public:
31         /// called when user selects a layout from combox
32         static void layoutSelectedCB(int, void *, Combox *);
33  
34         /// create an empty toolbar
35         Pimpl(LyXView * o, int x, int y);
36
37         ~Pimpl();
38
39         /// add a new button to the toolbar.
40         void add(int action);
41
42         /// update the state of the icons
43         void update();
44
45         /// select the right layout in the combox
46         void setLayout(string const & layout);
47         /// Populate the layout combox; re-do everything if force is true.
48         void updateLayoutList(bool force);
49         /// Drop down the layout list
50         void openLayoutList();
51         /// Erase the layout list
52         void clearLayoutList();
53         /// the non-static version of layoutSelectedCB
54         void layoutSelected();
55
56         /// an item on the toolbar
57         struct toolbarItem
58         {
59                 toolbarItem();
60
61                 ~toolbarItem();
62  
63                 toolbarItem & operator=(toolbarItem const & ti);
64  
65                 /// deallocate icon
66                 void kill_icon();
67  
68                 /// lyx action number
69                 int action;
70                 /// icon for this item
71                 FL_OBJECT * icon;
72         };
73
74         typedef std::vector<toolbarItem> ToolbarList;
75  
76         /// The list containing all the buttons
77         ToolbarList toollist_;
78         /// owning view
79         XFormsView * owner_;
80         /// tooltips manager
81         Tooltips * tooltip_;
82         /// layout combo
83         Combox * combox_;
84         /// x position of end of toolbar
85         int xpos;
86         /// y position of end of toolbar
87         int ypos;
88 };
89  
90 #endif // TOOLBAR_PIMPL_H