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