Debian Codegraph @

plugins/impex/raw/3rdparty/libkdcraw/src/rcombobox.h

raw
1 /** ===========================================================
2 * @file
3 *
4 * This file is a part of digiKam project
5 * <a href="https://www.digikam.org">https://www.digikam.org</a>
6 *
7 * @date 2008-08-16
8 * @brief a combo box widget re-implemented with a
9 * reset button to switch to a default item
10 *
11 * @author Copyright (C) 2008-2015 by Gilles Caulier
12 * <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
13 *
14 * This program is free software; you can redistribute it
15 * and/or modify it under the terms of the GNU General
16 * Public License as published by the Free Software Foundation;
17 * either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * ============================================================ */
26
27 #ifndef RCOMBOBOX_H
28 #define RCOMBOBOX_H
29
30 // Qt includes
31
32 #include <QWidget>
33 #include <QComboBox>
34
35 // Local includes
36
37
38
39 namespace KDcrawIface
40 {
41
42 class RComboBox : public QWidget
43 {
44
45 Q_OBJECT
46
47 public:
48
49 RComboBox(QWidget* const parent=0);
50 ~RComboBox() override;
51
52 void setCurrentIndex(int d);
53 int currentIndex() const;
54
55 void setDefaultIndex(int d);
56 int defaultIndex() const;
57
58 QComboBox* combo() const;
59
60 void addItem(const QString& t, int index = -1);
61 void insertItem(int index, const QString& t);
62
63 Q_SIGNALS:
64
65 void reset();
66 void activated(int);
67 void currentIndexChanged(int);
68
69 public Q_SLOTS:
70
71 void slotReset();
72
73 private Q_SLOTS:
74
75 void slotItemActivated(int);
76 void slotCurrentIndexChanged(int);
77
78 private:
79
80 class Private;
81 Private* const d;
82 };
83
84 } // namespace KDcrawIface
85
86 #endif /* RCOMBOBOX_H */