]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiToolbar.h
getting rid of superfluous lyx::support:: statements.
[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 "Session.h"
20
21 #include <QList>
22 #include <QToolBar>
23 #include <QComboBox>
24
25 namespace lyx {
26
27 class TextClass;
28 class ToolbarItem;
29
30 namespace frontend {
31
32 class GuiCommandBuffer;
33 class GuiView;
34 class Action;
35
36
37 class GuiLayoutBox : public QComboBox
38 {
39         Q_OBJECT
40 public:
41         GuiLayoutBox(GuiView &);
42
43         /// select the right layout in the combobox.
44         void set(docstring const & layout);
45         /// Populate the layout combobox.
46         void updateContents(bool reset);
47         /// Add Item to Layout box according to sorting settings from preferences
48         void addItemSort(QString const & item, bool sorted);
49
50 private Q_SLOTS:
51         void selected(const QString & str);
52
53 private:
54         GuiView & owner_;
55         TextClass const * text_class_;
56 };
57
58
59 class GuiToolbar : public QToolBar
60 {
61         Q_OBJECT
62 public:
63         GuiToolbar(ToolbarInfo const &, GuiView &);
64
65         /// Add a button to the bar.
66         void add(ToolbarItem const & item);
67         /** update toolbar information
68         * ToolbarInfo will then be saved by session
69         */
70         void saveInfo(ToolbarSection::ToolbarInfo & info);
71         /// Refresh the contents of the bar.
72         void updateContents();
73         ///
74         GuiCommandBuffer * commandBuffer() { return command_buffer_; }
75
76 Q_SIGNALS:
77         void updated();
78
79 private:
80         Action * addItem(ToolbarItem const & item);
81
82         QList<Action *> actions_;
83         GuiView & owner_;
84
85         GuiLayoutBox * layout_;
86         GuiCommandBuffer * command_buffer_;
87 };
88
89 } // namespace frontend
90 } // namespace lyx
91
92 #endif // GUITOOLBAR_H