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