]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Toolbar_pimpl.h
8209d4f923af3d02eabddb06bb6c2b7c1cab4be1
[lyx.git] / src / frontends / xforms / Toolbar_pimpl.h
1 // -*- C++ -*-
2 /**
3  * \file Toolbar_pimpl.h
4  * Copyright 2002 the LyX Team
5  * Copyright 1996-2001 Lars Gullik Bjønnes
6  * Read the file COPYING
7  *
8  * \author Lars Gullik Bjønnes, larsbj@lyx.org
9  */
10
11 #ifndef TOOLBAR_PIMPL_H
12 #define TOOLBAR_PIMPL_H
13
14 #include <vector>
15 #include FORMS_H_LOCATION
16
17 #include "frontends/Toolbar.h"
18
19 #include "commandtags.h"
20 #include "combox.h"
21 #include "ToolbarDefaults.h"
22
23 #ifdef __GNUG__
24 #pragma interface
25 #endif
26
27 class XFormsView;
28 class Tooltips;
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         ~Pimpl();
40
41         /// (re)sets the toolbar
42         void set(bool doingmain = false);
43
44         /** this is to be the entry point to the toolbar
45             frame, where you can change the toolbar realtime.
46         */
47         void edit();
48         /// add a new button to the toolbar.
49         void add(int, bool doclean = true);
50         /// invokes the n'th icon in the toolbar
51         void push(int);
52         /// activates the toolbar
53         void activate();
54         /// deactivates the toolbar
55         void deactivate();
56         /// update the state of the icons
57         void update();
58
59         /// select the right layout in the combox
60         void setLayout(string const & layout);
61         /// Populate the layout combox; re-do everything if force is true.
62         void updateLayoutList(bool force);
63         /// Drop down the layout list
64         void openLayoutList();
65         /// Erase the layout list
66         void clearLayoutList();
67         /// the non-static version of layoutSelectedCB
68         void layoutSelected();
69
70         ///
71         struct toolbarItem
72         {
73                 ///
74                 int action;
75                 ///
76                 FL_OBJECT * icon;
77                 ///
78                 toolbarItem();
79                 ///
80                 void clean();
81                 ///
82                 ~toolbarItem();
83                 ///
84                 toolbarItem & operator=(toolbarItem const & ti);
85         };
86
87         /// typedef to simplify things
88         typedef std::vector<toolbarItem> ToolbarList;
89         /// The list containing all the buttons
90         ToolbarList toollist;
91         ///
92         XFormsView * owner;
93         ///
94         Tooltips * tooltip_;
95         ///
96         Combox * combox;
97         /// Starting position
98         int sxpos;
99         ///
100         int sypos;
101         ///
102         int xpos;
103         ///
104         int ypos;
105         ///
106         bool cleaned;
107
108         /// removes all toolbar buttons from the toolbar.
109         void clean();
110
111         /// more...
112         void reset();
113
114         /// more...
115         void lightReset();
116 };
117 #endif