Hex offsets

Hex offsets Git Source Tree

Root/uientry.hpp

1/*
2 Copyright (C) 2017 Grégory Soutadé
3
4 This file is part of Hex offsets.
5
6 Hex offsets is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 Hex offsets is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Hex offsets. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef UIENTRY_HPP
21#define UIENTRY_HPP
22
23#include <QWidget>
24#include <QPushButton>
25#include <QCheckBox>
26#include <QLineEdit>
27#include <QHBoxLayout>
28
29namespace Ui {
30class UIEntry;
31}
32
33class MainWindow;
34
35class UIEntry : public QWidget
36{
37 Q_OBJECT
38
39private slots:
40 void on_line_textChanged(const QString &arg1);
41 void on_buttonPlus_toggled(bool checked);
42 void on_buttonMinus_toggled(bool checked);
43 void on_buttonClear_clicked();
44 void on_checkEnable_toggled(bool checked);
45
46public:
47
48 UIEntry(QWidget *parent = 0, MainWindow* ui = 0);
49 ~UIEntry();
50
51 enum operation {OPERATION_PLUS, OPERATION_MINUS};
52
53 static const int MIN_ENTRIES_NUMBER = 4;
54
55 QHBoxLayout* getLayout(void) {return layout;}
56 QLineEdit* getLine(void) {return line;}
57 void clear(void) {line->clear();}
58
59 UIEntry::operation getOperation(void);
60 bool enabled(void) {return checkEnable->isChecked();}
61
62private:
63 QWidget *parent;
64 MainWindow *ui;
65
66 QHBoxLayout* layout;
67 QPushButton* buttonClear;
68 QPushButton* buttonPlus;
69 QPushButton* buttonMinus;
70 QCheckBox* checkEnable;
71 QLineEdit* line;
72};
73
74#endif

Archive Download this file

Branches