]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Toolbar_pimpl.h
layout as string
[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         /// select the right layout in the combox
65         void setLayout(string const & layout);
66         /// Populate the layout combox; re-do everything if force is true.
67         void updateLayoutList(bool force);
68         /// Drop down the layout list
69         void openLayoutList();
70         /// Erase the layout list
71         void clearLayoutList();
72         /// the non-static version of layoutSelectedCB
73         void layoutSelected(); 
74
75         ///
76         struct toolbarItem
77         {
78                 ///
79                 int action;
80                 ///
81                 FL_OBJECT * icon;
82                 ///
83                 toolbarItem();
84                 ///
85                 void clean();
86                 ///
87                 ~toolbarItem();
88                 ///
89                 toolbarItem & operator=(toolbarItem const & ti);
90         };
91
92         /// typedef to simplify things
93         typedef std::vector<toolbarItem> ToolbarList;
94         /// The list containing all the buttons
95         ToolbarList toollist;
96         ///
97         XFormsView * owner;
98 #if FL_REVISION < 89
99         ///
100         FL_OBJECT * bubble_timer;
101 #endif
102         ///
103         Combox * combox;
104         /// Starting position
105         int sxpos;
106         ///
107         int sypos;
108         ///
109         int xpos;
110         ///
111         int ypos;
112         ///
113         bool cleaned;
114
115         /// removes all toolbar buttons from the toolbar.
116         void clean();
117
118         /// more...
119         void reset();
120
121         /// more...
122         void lightReset();
123 };
124 #endif