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