]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/CategorizedCombo.h
Improve wording (#10670)
[lyx.git] / src / frontends / qt4 / CategorizedCombo.h
1 // -*- C++ -*-
2 /**
3  * \file CategorizedCombo.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 Jürgen Spitzmüller
12  * \author Abdelrazak Younes
13  *
14  * Full author contact details are available in file CREDITS.
15  */
16
17 #ifndef LYX_CATEGORIZEDCOMBO_H
18 #define LYX_CATEGORIZEDCOMBO_H
19
20 #include "support/strfwd.h"
21
22 #include <QComboBox>
23
24
25 namespace lyx {
26 namespace frontend {
27
28 class CCItemDelegate;
29
30 /**
31  * A combo box with categorization
32  */
33 class CategorizedCombo : public QComboBox
34 {
35         Q_OBJECT
36 public:
37         CategorizedCombo(QWidget * parent);
38         ~CategorizedCombo();
39
40         /// select an item in the combobox. Returns false if item does not exist
41         bool set(QString const & cc);
42         /// Reset the combobox.
43         void reset();
44         /// Update combobox.
45         void updateCombo();
46         /// Add Item to combo according to sorting settings from preferences
47         void addItemSort(QString const & item, QString const & guiname,
48                          QString const & category, QString const & tooltip,
49                          bool sorted, bool sortedByCat, bool sortCats,
50                          bool available);
51         ///
52         QString getData(int row) const;
53         ///
54         void setTooltipTemplate(QString const & tooltip,
55                                                     QString const & unavail = QString());
56
57         ///
58         void showPopup();
59         
60         ///
61         bool eventFilter(QObject * o, QEvent * e);
62         ///
63         QString const & filter() const;
64
65 private Q_SLOTS:
66         ///
67         void setIconSize(QSize size);
68
69 private:
70         friend class CCItemDelegate;
71         ///
72         struct Private;
73         ///
74         Private * const d;
75 };
76
77
78 } // namespace frontend
79 } // namespace lyx
80
81 #endif // LYX_CATEGORIZEDCOMBO_H