]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QLToolbar.h
Rename .C ==> .cpp for files in src, part one
[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(std::string 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         void saveInfo(ToolbarSection::ToolbarInfo & info);
73         void update();
74         LayoutBox * layout() const { return layout_.get(); }
75
76
77
78 Q_SIGNALS:
79         void updated();
80
81 private:
82
83         std::vector<Action *> ActionVector;
84         GuiView & owner_;
85
86         boost::scoped_ptr<QLayoutBox> layout_;
87 };
88
89 /// return a full path of an XPM for the given action
90 std::string const getIcon(FuncRequest const & f, bool unknown = true);
91
92 } // namespace frontend
93 } // namespace lyx
94
95 #endif // NOT QLTOOLBAR_H