]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Toolbar_pimpl.h
implement getLabelList
[lyx.git] / src / frontends / xforms / Toolbar_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 TOOLBAR_PIMPL_H
15 #define TOOLBAR_PIMPL_H
16
17 #include <vector>
18 #include FORMS_H_LOCATION
19
20 #include "frontends/Toolbar.h"
21
22 #include "commandtags.h"
23 #include "combox.h"
24 #include "ToolbarDefaults.h"
25
26 #ifdef __GNUG__
27 #pragma interface
28 #endif
29
30 /** The LyX xforms toolbar class
31   */
32 struct Toolbar::Pimpl {
33 public:
34         /// called when user selects a layout from combox
35         static void layoutSelectedCB(int, void *, Combox *);
36         ///
37         Pimpl(LyXView * o, int x, int y);
38
39         ///
40         ~Pimpl() {
41                 clean();
42         }
43         
44 #if 0
45         ///
46         int get_toolbar_func(string const & func);
47 #endif
48         
49         /// (re)sets the toolbar
50         void set(bool doingmain = false);
51
52         /** this is to be the entry point to the toolbar
53             frame, where you can change the toolbar realtime.
54         */
55         void edit();
56         /// add a new button to the toolbar.
57         void add(int, bool doclean = true);
58         /// invokes the n'th icon in the toolbar
59         void push(int);
60         /// activates the toolbar
61         void activate();
62         /// deactivates the toolbar
63         void deactivate();
64         /// update the state of the icons
65         void update();
66
67  
68         /// select the right layout in the combox
69         void setLayout(int layout);
70         /// Populate the layout combox; re-do everything if force is true.
71         void updateLayoutList(bool force);
72         /// Drop down the layout list
73         void openLayoutList();
74         /// Erase the layout list
75         void clearLayoutList();
76         /// and the non-static version
77         void layoutSelected(int); 
78
79         ///
80         struct toolbarItem
81         {
82                 ///
83                 int action;
84                 ///
85                 FL_OBJECT * icon;
86                 ///
87                 toolbarItem();
88                 ///
89                 void clean();
90                 ///
91                 ~toolbarItem();
92                 ///
93                 toolbarItem & operator=(toolbarItem const & ti);
94         };
95
96         /// typedef to simplify things
97         typedef std::vector<toolbarItem> ToolbarList;
98         /// The list containing all the buttons
99         ToolbarList toollist;
100         ///
101         LyXView * owner;
102 #if FL_REVISION < 89
103         ///
104         FL_OBJECT * bubble_timer;
105 #endif
106         ///
107         Combox * combox;
108         /// Starting position
109         int sxpos;
110         ///
111         int sypos;
112         ///
113         int xpos;
114         ///
115         int ypos;
116         ///
117         bool cleaned;
118
119         /// removes all toolbar buttons from the toolbar.
120         void clean();
121
122         /// more...
123         void reset();
124
125         /// more...
126         void lightReset();
127 };
128 #endif