1 // This file is part of the SpeedCrunch project
2 // Copyright (C) 2007 Ariya Hidayat <ariya@kde.org>
3 // Copyright (C) 2008, 2009, 2010, 2011, 2016 @heldercorreia
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; see the file COPYING.  If not, write to
17 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 // Boston, MA 02110-1301, USA.
19 
20 #ifndef GUI_CONSTANTSWIDGET_H
21 #define GUI_CONSTANTSWIDGET_H
22 
23 #include <QWidget>
24 
25 class QComboBox;
26 class QLabel;
27 class QLineEdit;
28 class QTreeWidget;
29 class QTreeWidgetItem;
30 
31 class ConstantsWidget : public QWidget {
32     Q_OBJECT
33 
34 public:
35     explicit ConstantsWidget(QWidget* parent = nullptr);
36     ~ConstantsWidget();
37 
38 signals:
39     void constantSelected(const QString&);
40 
41 public slots:
42     void handleRadixCharacterChange();
43 
44 protected slots:
45     void filter();
46     void handleItem(QTreeWidgetItem*);
47     void retranslateText();
48     void triggerFilter();
49     void updateList();
50 
51 protected:
52     virtual void changeEvent(QEvent*);
53 
54 private:
55     Q_DISABLE_COPY(ConstantsWidget)
56 
57     QComboBox* m_category;
58     QLabel* m_categoryLabel;
59     QLineEdit* m_filter;
60     QTimer* m_filterTimer;
61     QLabel* m_label;
62     QTreeWidget* m_list;
63     QLabel* m_noMatchLabel;
64 };
65 
66 #endif
67 
68