/usr/include/libdtk-2.0.7/DWidget/dinputdialog.h is in libdtkwidget-dev 2.0.7.2-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | /*
* Copyright (C) 2015 ~ 2017 Deepin Technology Co., Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DINPUTDIALOG_H
#define DINPUTDIALOG_H
#include <QInputDialog>
#include "ddialog.h"
#include "dlineedit.h"
#include "dobject.h"
DWIDGET_BEGIN_NAMESPACE
class DInputDialogPrivate;
class DInputDialog : public DDialog
{
Q_OBJECT
Q_PROPERTY(InputMode inputMode READ inputMode WRITE setInputMode)
Q_PROPERTY(QString textValue READ textValue WRITE setTextValue NOTIFY textValueChanged)
Q_PROPERTY(int intValue READ intValue WRITE setIntValue NOTIFY intValueChanged)
Q_PROPERTY(int doubleValue READ doubleValue WRITE setDoubleValue NOTIFY doubleValueChanged)
Q_PROPERTY(DLineEdit::EchoMode textEchoMode READ textEchoMode WRITE setTextEchoMode)
Q_PROPERTY(bool comboBoxEditable READ isComboBoxEditable WRITE setComboBoxEditable)
Q_PROPERTY(QStringList comboBoxItems READ comboBoxItems WRITE setComboBoxItems)
Q_PROPERTY(int comboBoxCurrentIndex READ comboBoxCurrentIndex WRITE setComboBoxCurrentIndex NOTIFY comboBoxCurrentIndexChanged)
Q_PROPERTY(int intMinimum READ intMinimum WRITE setIntMinimum)
Q_PROPERTY(int intMaximum READ intMaximum WRITE setIntMaximum)
Q_PROPERTY(int intStep READ intStep WRITE setIntStep)
Q_PROPERTY(double doubleMinimum READ doubleMinimum WRITE setDoubleMinimum)
Q_PROPERTY(double doubleMaximum READ doubleMaximum WRITE setDoubleMaximum)
Q_PROPERTY(int doubleDecimals READ doubleDecimals WRITE setDoubleDecimals)
Q_PROPERTY(QString okButtonText READ okButtonText WRITE setOkButtonText)
Q_PROPERTY(QString cancelButtonText READ cancelButtonText WRITE setCancelButtonText)
Q_PROPERTY(bool textAlert READ isTextAlert WRITE setTextAlert NOTIFY textAlertChanged)
public:
enum InputMode {
TextInput,
ComboBox,
IntInput,
DoubleInput
};
explicit DInputDialog(QWidget *parent = 0);
Q_SLOT void setInputMode(InputMode mode);
InputMode inputMode() const;
Q_SLOT void setTextValue(const QString &text);
QString textValue() const;
Q_SLOT void setTextEchoMode(QLineEdit::EchoMode mode);
QLineEdit::EchoMode textEchoMode() const;
Q_SLOT void setComboBoxEditable(bool editable);
bool isComboBoxEditable() const;
Q_SLOT void setComboBoxItems(const QStringList &items);
QStringList comboBoxItems() const;
Q_SLOT void setComboBoxCurrentIndex(int comboBoxCurrentIndex);
int comboBoxCurrentIndex() const;
Q_SLOT void setIntValue(int value);
int intValue() const;
Q_SLOT void setIntMinimum(int min);
int intMinimum() const;
Q_SLOT void setIntMaximum(int max);
int intMaximum() const;
Q_SLOT void setIntRange(int min, int max);
Q_SLOT void setIntStep(int step);
int intStep() const;
Q_SLOT void setDoubleValue(double value);
double doubleValue() const;
Q_SLOT void setDoubleMinimum(double min);
double doubleMinimum() const;
Q_SLOT void setDoubleMaximum(double max);
double doubleMaximum() const;
Q_SLOT void setDoubleRange(double min, double max);
Q_SLOT void setDoubleDecimals(int decimals);
int doubleDecimals() const;
Q_SLOT void setOkButtonText(const QString &text);
QString okButtonText() const;
Q_SLOT void setOkButtonEnabled(const bool enable);
bool okButtonIsEnabled() const;
Q_SLOT void setCancelButtonText(const QString &text);
QString cancelButtonText() const;
Q_SLOT void setTextAlert(bool textAlert);
bool isTextAlert() const;
static QString getText(QWidget *parent, const QString &title, const QString &message,
QLineEdit::EchoMode echo = QLineEdit::Normal,
const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = 0,
Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
static QString getItem(QWidget *parent, const QString &title, const QString &message,
const QStringList &items, int current = 0, bool editable = true,
bool *ok = 0, Qt::WindowFlags flags = 0,
Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
static int getInt(QWidget *parent, const QString &title, const QString &message, int value = 0,
int minValue = -2147483647, int maxValue = 2147483647,
int step = 1, bool *ok = 0, Qt::WindowFlags flags = 0);
static double getDouble(QWidget *parent, const QString &title, const QString &message, double value = 0,
double minValue = -2147483647, double maxValue = 2147483647,
int decimals = 1, bool *ok = 0, Qt::WindowFlags flags = 0);
protected:
void showEvent(QShowEvent *e);
Q_SIGNALS:
// ### Q_EMIT signals!
void textValueChanged(const QString &text);
void textValueSelected(const QString &text);
void intValueChanged(int value);
void intValueSelected(int value);
void doubleValueChanged(double value);
void doubleValueSelected(double value);
void cancelButtonClicked();
void okButtonClicked();
void comboBoxCurrentIndexChanged(int comboBoxCurrentIndex);
void textAlertChanged(bool textAlert);
private:
D_DECLARE_PRIVATE(DInputDialog)
};
DWIDGET_END_NAMESPACE
#endif // DINPUTDIALOG_H
|