]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/LayoutBox.h
This move out the GuiLayoutBox class out of GuiToolbar where it was a mess. The new...
[lyx.git] / src / frontends / qt4 / LayoutBox.h
1 // -*- C++ -*-
2 /**
3  * \file LayoutBox.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 LYX_LAYOUT_BOX_H
17 #define LYX_LAYOUT_BOX_H
18
19 #include "support/strfwd.h"
20
21 #include <QComboBox>
22
23 class QToolBar;
24
25 namespace lyx {
26
27 class DocumentClass;
28 class Inset;
29
30 namespace frontend {
31
32 class GuiView;
33 class LayoutItemDelegate;
34
35 class LayoutBox : public QComboBox
36 {
37         Q_OBJECT
38 public:
39         LayoutBox(QToolBar *, GuiView &);
40
41         /// select the right layout in the combobox.
42         void set(docstring const & layout);
43         /// Populate the layout combobox.
44         void updateContents(bool reset);
45         /// Add Item to Layout box according to sorting settings from preferences
46         void addItemSort(docstring const & item, docstring const & category,
47                 bool sorted, bool sortedByCat, bool unknown);
48
49         ///
50         void showPopup();
51         
52         ///
53         bool eventFilter(QObject * o, QEvent * e);
54         ///
55         QString const & filter() const;
56
57 private Q_SLOTS:
58         ///
59         void selected(int index);
60         ///
61         void setIconSize(QSize size);
62
63 private:
64         friend class LayoutItemDelegate;
65         struct Private;
66         Private * const d;
67 };
68
69 } // namespace frontend
70 } // namespace lyx
71
72 #endif // LYX_LAYOUT_BOX_H