]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QLToolbar.h
cosmetics + move frontends/* to frontend namespace.
[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 "Session.h"
21
22 #include <QToolBar>
23
24 #include <boost/scoped_ptr.hpp>
25
26 #include <vector>
27
28 class QComboBox;
29
30 namespace lyx {
31 class FuncRequest;
32 namespace frontend {
33
34 class QLayoutBox;
35 class GuiView;
36 class Action;
37
38
39 class QLayoutBox : public QObject, public LayoutBox {
40         Q_OBJECT
41 public:
42         QLayoutBox(QToolBar *, GuiView &);
43
44         /// select the right layout in the combox.
45         void set(docstring const & layout);
46         /// Populate the layout combox.
47         void update();
48         /// Erase the layout list.
49         void clear();
50         /// Display the layout list.
51         void open();
52         ///
53         void setEnabled(bool);
54
55 private Q_SLOTS:
56         void selected(const QString & str);
57
58 private:
59         QComboBox * combo_;
60         GuiView & owner_;
61 };
62
63
64 class QLToolbar : public QToolBar, public Toolbar {
65         Q_OBJECT
66 public:
67         QLToolbar(ToolbarInfo const &, GuiView &);
68
69         //~QLToolbar();
70
71         void add(ToolbarItem const & item);
72         void hide(bool);
73         void show(bool);
74         bool isVisible() const;
75         void saveInfo(ToolbarSection::ToolbarInfo & info);
76         void update();
77         LayoutBox * layout() const { return layout_.get(); }
78
79
80
81 Q_SIGNALS:
82         void updated();
83
84 private:
85
86         std::vector<Action *> ActionVector;
87         GuiView & owner_;
88
89         boost::scoped_ptr<QLayoutBox> layout_;
90 };
91
92 /// return a full path of an XPM for the given action
93 std::string const getIcon(FuncRequest const & f, bool unknown = true);
94
95 } // namespace frontend
96 } // namespace lyx
97
98 #endif // NOT QLTOOLBAR_H