]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QLToolbar.h
Fix unreported bug related to 3246 by Richard Heck:
[lyx.git] / src / frontends / qt4 / QLToolbar.h
1 // -*- C++ -*-
2 /**
3  * \file QLToolbar.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author John Levon
9  * \author Jean-Marc Lasgouttes
10  * \author Angus Leeming
11  * \author Abdelrazak Younes
12  *
13  * Full author contact details are available in file CREDITS.
14  */
15
16 #ifndef QLTOOLBAR_H
17 #define QLTOOLBAR_H
18
19 #include "frontends/Toolbars.h"
20 #include <boost/scoped_ptr.hpp>
21
22 #include <QToolBar>
23 #include <vector>
24 #include "session.h"
25
26 class QComboBox;
27
28 namespace lyx {
29 namespace frontend {
30
31 class QLayoutBox;
32 class GuiView;
33 class Action;
34
35
36 class QLayoutBox : public QObject, public LayoutBox {
37         Q_OBJECT
38 public:
39         QLayoutBox(QToolBar *, GuiView &);
40
41         /// select the right layout in the combox.
42         void set(std::string const & layout);
43         /// Populate the layout combox.
44         void update();
45         /// Erase the layout list.
46         void clear();
47         /// Display the layout list.
48         void open();
49         ///
50         void setEnabled(bool);
51
52 private Q_SLOTS:
53         void selected(const QString & str);
54
55 private:
56         QComboBox * combo_;
57         GuiView & owner_;
58 };
59
60
61 class QLToolbar : public QToolBar, public Toolbar {
62         Q_OBJECT
63 public:
64         QLToolbar(ToolbarBackend::Toolbar const &, GuiView &);
65
66         //~QLToolbar();
67
68         void add(FuncRequest const & func, lyx::docstring const & tooltip);
69         void hide(bool);
70         void show(bool);
71         void saveInfo(ToolbarSection::ToolbarInfo & info);
72         void update();
73         LayoutBox * layout() const { return layout_.get(); }
74
75
76
77 Q_SIGNALS:
78         void updated();
79
80 private:
81
82         std::vector<Action *> ActionVector;
83         GuiView & owner_;
84
85         boost::scoped_ptr<QLayoutBox> layout_;
86 };
87
88 } // namespace frontend
89 } // namespace lyx
90
91 #endif // NOT QLTOOLBAR_H