]> git.lyx.org Git - lyx.git/blob - src/frontends/Toolbar.C
I forgot to remove DialogBAse.h from Makefile.am when I nuked it yesterday.
[lyx.git] / src / frontends / Toolbar.C
1 /**
2  * \file Toolbar.C
3  * Copyright 1995-2002 the LyX Team
4  * Read the file COPYING
5  *
6  * \author Lars Gullik Bjønnes <larsbj@lyx.org>
7  */
8
9 #include <config.h>
10
11 #ifdef __GNUG__
12 #pragma implementation "Toolbar.h"
13 #endif
14
15 #include "Toolbar.h"
16 #include "ToolbarDefaults.h"
17 #include "Toolbar_pimpl.h"
18 #include "debug.h"
19 #include "LyXAction.h"
20
21 using std::endl;
22
23 Toolbar::Toolbar(LyXView * o, int x, int y, ToolbarDefaults const &tbd)
24         : last_textclass_(-1)
25 {
26         pimpl_ = new Pimpl(o, x, y);
27
28         // extracts the toolbar actions from tbd
29         for (ToolbarDefaults::const_iterator cit = tbd.begin();
30              cit != tbd.end(); ++cit) {
31                 pimpl_->add((*cit));
32                 lyxerr[Debug::GUI] << "tool action: " << (*cit) << endl;
33         }
34 }
35
36
37 Toolbar::~Toolbar()
38 {
39         delete pimpl_;
40 }
41
42
43 void Toolbar::update()
44 {
45         pimpl_->update();
46 }
47
48
49
50 void Toolbar::setLayout(string const & layout)
51 {
52         pimpl_->setLayout(layout);
53 }
54
55
56 bool Toolbar::updateLayoutList(int textclass)
57 {
58         // update the layout display
59         if (last_textclass_ != textclass) {
60                 pimpl_->updateLayoutList(true);
61                 last_textclass_ = textclass;
62                 return true;
63         } else {
64                 pimpl_->updateLayoutList(false);
65                 return false;
66         }
67 }
68
69
70 void Toolbar::openLayoutList()
71 {
72         pimpl_->openLayoutList();
73 }
74
75
76 void Toolbar::clearLayoutList()
77 {
78         pimpl_->clearLayoutList();
79 }