]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLToolbar.h
some tabular fixes for the problems reported by Helge
[lyx.git] / src / frontends / qt2 / 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  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef QLTOOLBAR_H
16 #define QLTOOLBAR_H
17
18 #include "frontends/Toolbars.h"
19 #include <boost/scoped_ptr.hpp>
20
21 #include <qobject.h>
22
23 class QComboBox;
24 class QToolBar;
25 class QToolButton;
26
27 namespace lyx {
28 namespace frontend {
29
30 class QLayoutBox;
31 class QtView;
32 class QLToolbar;
33
34
35 class QLayoutBox : public QObject, public LayoutBox {
36         Q_OBJECT
37 public:
38         QLayoutBox(QWidget *, QtView &);
39
40         /// select the right layout in the combox.
41         void set(std::string const & layout);
42         /// Populate the layout combox.
43         void update();
44         /// Erase the layout list.
45         void clear();
46         /// Display the layout list.
47         void open();
48         ///
49         void setEnabled(bool);
50
51 private slots:
52         void selected(const QString & str);
53
54 private:
55         QComboBox * combo_;
56         QtView & owner_;
57 };
58
59
60 class QLToolbar : public QObject, public Toolbar {
61         Q_OBJECT
62 public:
63         QLToolbar(ToolbarBackend::Toolbar const &, LyXView &);
64         void add(FuncRequest const & func, std::string const & tooltip);
65         void hide(bool);
66         void show(bool);
67         void update();
68         LayoutBox * layout() const { return layout_.get(); }
69
70 private slots:
71         void clicked();
72
73 private:
74         typedef std::map<QToolButton *, FuncRequest> ButtonMap;
75
76         QtView & owner_;
77         QToolBar * toolbar_;
78         ButtonMap map_;
79
80         boost::scoped_ptr<QLayoutBox> layout_;
81 };
82
83 } // namespace frontend
84 } // namespace lyx
85
86 #endif // NOT QLTOOLBAR_H