]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Toolbar_pimpl.h
use exclicit temp var
[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-2001 The LyX Team.
8  *
9  *           This file is Copyright 1996-2001
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 class XFormsView;
31
32 /** The LyX xforms toolbar class
33   */
34 struct Toolbar::Pimpl {
35 public:
36         /// called when user selects a layout from combox
37         static void layoutSelectedCB(int, void *, Combox *);
38         ///
39         Pimpl(LyXView * o, int x, int y);
40
41         ///
42         ~Pimpl() {
43                 clean();
44         }
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         */
52         void edit();
53         /// add a new button to the toolbar.
54         void add(int, bool doclean = true);
55         /// invokes the n'th icon in the toolbar
56         void push(int);
57         /// activates the toolbar
58         void activate();
59         /// deactivates the toolbar
60         void deactivate();
61         /// update the state of the icons
62         void update();
63
64  
65         /// select the right layout in the combox
66         void setLayout(int layout);
67         /// Populate the layout combox; re-do everything if force is true.
68         void updateLayoutList(bool force);
69         /// Drop down the layout list
70         void openLayoutList();
71         /// Erase the layout list
72         void clearLayoutList();
73         /// the non-static version of layoutSelectedCB
74         void layoutSelected(); 
75
76         ///
77         struct toolbarItem
78         {
79                 ///
80                 int action;
81                 ///
82                 FL_OBJECT * icon;
83                 ///
84                 toolbarItem();
85                 ///
86                 void clean();
87                 ///
88                 ~toolbarItem();
89                 ///
90                 toolbarItem & operator=(toolbarItem const & ti);
91         };
92
93         /// typedef to simplify things
94         typedef std::vector<toolbarItem> ToolbarList;
95         /// The list containing all the buttons
96         ToolbarList toollist;
97         ///
98         XFormsView * owner;
99 #if FL_REVISION < 89
100         ///
101         FL_OBJECT * bubble_timer;
102 #endif
103         ///
104         Combox * combox;
105         /// Starting position
106         int sxpos;
107         ///
108         int sypos;
109         ///
110         int xpos;
111         ///
112         int ypos;
113         ///
114         bool cleaned;
115
116         /// removes all toolbar buttons from the toolbar.
117         void clean();
118
119         /// more...
120         void reset();
121
122         /// more...
123         void lightReset();
124 };
125 #endif