]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/CategorizedCombo.h
Merge remote-tracking branch 'origin/master' into features/latexargs
[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 class CCItemDelegate;
26
27 /**
28  * A combo box with categorization
29  */
30 class CategorizedCombo : public QComboBox
31 {
32         Q_OBJECT
33 public:
34         CategorizedCombo(QWidget * parent);
35         ~CategorizedCombo();
36
37         /// select an item in the combobox. Returns false if item does not exist
38         bool set(QString const & cc);
39         /// Reset the combobox.
40         void reset();
41         /// Update combobox.
42         void updateCombo();
43         /// Add Item to combo according to sorting settings from preferences
44         void addItemSort(QString const & item, QString const & guiname,
45                          QString const & category, QString const & tooltip,
46                          bool sorted, bool sortedByCat, bool sortCats,
47                          bool available);
48         ///
49         QString getData(int row) const;
50         ///
51         void setTooltipTemplate(QString const & tooltip,
52                                                     QString const & unavail = QString());
53
54         ///
55         void showPopup();
56         
57         ///
58         bool eventFilter(QObject * o, QEvent * e);
59         ///
60         QString const & filter() const;
61
62 private Q_SLOTS:
63         ///
64         void setIconSize(QSize size);
65
66 private:
67         friend class CCItemDelegate;
68         ///
69         struct Private;
70         ///
71         Private * const d;
72 };
73
74
75 #endif // LYX_CATEGORIZEDCOMBO_H