]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiToolbars.h
Move most of the Gui specific code in Toolbars to its new qt4 specialization GuiToolbars.
[lyx.git] / src / frontends / qt4 / GuiToolbars.h
1 // -*- C++ -*-
2 /**
3  * \file GuiToolbars.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 Angus Leeming
9  * \author Abdelrazak Younes
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef GUI_TOOLBARS_H
15 #define GUI_TOOLBARS_H
16
17 #include "frontends/Toolbars.h"
18
19 #include <map>
20
21 namespace lyx {
22 namespace frontend {
23
24 class GuiLayoutBox;
25 class GuiToolbar;
26 class GuiViewBase;
27
28 class GuiToolbars : public Toolbars
29 {
30 public:
31         ///
32         GuiToolbars(GuiViewBase & owner);
33
34         bool visible(std::string const & name) const;
35         void saveToolbarInfo();
36         void setLayout(docstring const & layout);
37
38         /** Populate the layout combox - returns whether we did a full
39          *  update or not
40          */
41         bool updateLayoutList(TextClassPtr textclass);
42
43         /// Drop down the layout list.
44         void openLayoutList();
45         /// Erase the layout list.
46         void clearLayoutList();
47
48 protected:
49         void add(ToolbarInfo const & tbinfo, bool newline);
50         void displayToolbar(ToolbarInfo const & tbinfo, bool show);
51         void updateIcons();
52
53         /// The parent window.
54         GuiViewBase & owner_;
55
56         /** The layout box is actually owned by whichever toolbar
57          *  contains it. All the Toolbars class needs is a means of
58          *  accessing it.
59          *
60          *  We don't need to use boost::weak_ptr here because the toolbars
61          *  are also stored here. There are, therefore, no lifetime issues.
62          */
63         GuiLayoutBox * layout_;
64
65         /// Toolbar store providing access to individual toolbars by name.
66         typedef std::map<std::string, GuiToolbar *> ToolbarsMap;
67         ToolbarsMap toolbars_;
68
69         /// The last textclass layout list in the layout choice selector
70         TextClassPtr last_textclass_;
71 };
72
73
74 } // namespace frontend
75 } // namespace lyx
76
77 #endif // NOT GUI_TOOLBARS_H