]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Toolbar_pimpl.h
Yet more dialog tweaking from Rob.
[lyx.git] / src / frontends / xforms / Toolbar_pimpl.h
1 // -*- C++ -*-
2 /**
3  * \file 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 #ifdef __GNUG__
22 #pragma interface
23 #endif
24
25 class XFormsView;
26 class Tooltips;
27 class Combox;
28
29 /** The LyX xforms toolbar class
30   */
31 struct Toolbar::Pimpl {
32 public:
33         /// called when user selects a layout from combox
34         static void layoutSelectedCB(int, void *, Combox *);
35  
36         /// create an empty toolbar
37         Pimpl(LyXView * o, int x, int y);
38
39         ~Pimpl();
40
41         /// add a new button to the toolbar.
42         void add(int action);
43
44         /// update the state of the icons
45         void update();
46
47         /// select the right layout in the combox
48         void setLayout(string const & layout);
49         /// Populate the layout combox; re-do everything if force is true.
50         void updateLayoutList(bool force);
51         /// Drop down the layout list
52         void openLayoutList();
53         /// Erase the layout list
54         void clearLayoutList();
55         /// the non-static version of layoutSelectedCB
56         void layoutSelected();
57
58         /// an item on the toolbar
59         struct toolbarItem
60         {
61                 toolbarItem();
62
63                 ~toolbarItem();
64  
65                 toolbarItem & operator=(toolbarItem const & ti);
66  
67                 /// deallocate icon
68                 void kill_icon();
69  
70                 /// lyx action number
71                 int action;
72                 /// icon for this item
73                 FL_OBJECT * icon;
74         };
75
76         typedef std::vector<toolbarItem> ToolbarList;
77  
78         /// The list containing all the buttons
79         ToolbarList toollist_;
80         /// owning view
81         XFormsView * owner_;
82         /// tooltips manager
83         Tooltips * tooltip_;
84         /// layout combo
85         Combox * combox_;
86         /// x position of end of toolbar
87         int xpos;
88         /// y position of end of toolbar
89         int ypos;
90 };
91  
92 #endif // TOOLBAR_PIMPL_H