]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QLToolbar.h
enable Font cache only for MacOSX and inline width() for other platform.
[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
25 class QComboBox;
26
27 namespace lyx {
28 namespace frontend {
29
30 class QLayoutBox;
31 class GuiView;
32 class Action;
33
34
35 class QLayoutBox : public QObject, public LayoutBox {
36         Q_OBJECT
37 public:
38         QLayoutBox(QToolBar *, GuiView &);
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 Q_SLOTS:
52         void selected(const QString & str);
53
54 private:
55         QComboBox * combo_;
56         GuiView & owner_;
57 };
58
59
60 class QLToolbar : public QToolBar, public Toolbar {
61         Q_OBJECT
62 public:
63         QLToolbar(ToolbarBackend::Toolbar const &, GuiView &);
64
65         //~QLToolbar();
66
67         void add(FuncRequest const & func, std::string const & tooltip);
68         void hide(bool);
69         void show(bool);
70         void update();
71         LayoutBox * layout() const { return layout_.get(); }
72
73
74
75 Q_SIGNALS:
76         void updated();
77
78 private:
79
80         std::vector<Action *> ActionVector;
81         GuiView & owner_;
82
83         boost::scoped_ptr<QLayoutBox> layout_;
84 };
85
86 } // namespace frontend
87 } // namespace lyx
88
89 #endif // NOT QLTOOLBAR_H