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