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