]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QLToolbar.h
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[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 <QObject>
23 #include <vector>
24
25 class QComboBox;
26 class QToolBar;
27
28 namespace lyx {
29 namespace frontend {
30
31 class QLayoutBox;
32 class QtView;
33 class QLAction;
34
35
36 class QLayoutBox : public QObject, public LayoutBox {
37         Q_OBJECT
38 public:
39         QLayoutBox(QToolBar *, QtView &);
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 slots:
53         void selected(const QString & str);
54
55 private:
56         QComboBox * combo_;
57         QtView & owner_;
58 };
59
60
61 class QLToolbar : public QObject, public Toolbar {
62         Q_OBJECT
63 public:
64         QLToolbar(ToolbarBackend::Toolbar const &, LyXView &);
65
66         //~QLToolbar();
67
68         void add(FuncRequest const & func, std::string const & tooltip);
69         void hide(bool);
70         void show(bool);
71         void update();
72         LayoutBox * layout() const { return layout_.get(); }
73
74 private:
75
76         std::vector<QLAction *> ActionVector;
77         QtView & owner_;
78         QToolBar * toolbar_;
79
80         boost::scoped_ptr<QLayoutBox> layout_;
81
82         Qt::ToolBarArea tba;
83 };
84
85 } // namespace frontend
86 } // namespace lyx
87
88 #endif // NOT QLTOOLBAR_H