Add Kyber to algorithm strings.
[qpwmc.git] / applicationFormWidget.h
blob56ba90d89bdcf542e04dcf29c1b440ab58398741
1 /*
2 Copyright (C) 2013-2024 Ben Kibbey <bjk@luxsci.net>
4 This file is part of qpwmc.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library 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 GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 USA
21 #ifndef APPLICATIONFORMWIDGET
22 #define APPLICATIONFORMWIDGET
24 #include <QtCore>
26 class ApplicationFormAttr
28 public:
29 ApplicationFormAttr (const QString &n, const QString &v)
31 _name = n;
32 _value = v;
35 ~ApplicationFormAttr () { };
37 QString name ()
39 return _name;
42 QString value ()
44 return _value;
47 private:
48 QString _name;
49 QString _value;
52 class ApplicationFormWidget
54 public:
55 enum {
56 AppWidgetNone, AppWidgetRadioButton, AppWidgetSpinBox, AppWidgetLineEdit,
57 AppWidgetCheckBox, AppWidgetDateSelector,
58 AppWidgetInteralOverwriteCheckBox
61 ApplicationFormWidget ();
62 ~ApplicationFormWidget ();
63 void setType (int);
64 int type ();
65 QWidget *widget ();
66 void setValue (QString);
67 QString value ();
68 void setElementSelector (bool = true);
69 bool elementSelector ();
70 void setFileSelector (bool = true);
71 bool fileSelector ();
72 void setDateSelector (bool = true);
73 bool dateSelector ();
74 void setPasswordGenerator (bool = true);
75 bool passwordGenerator ();
76 void setId (QString);
77 QString id ();
78 void setChildOf (QString);
79 QString childOf ();
80 void setPwmdName (QString);
81 QString pwmdName ();
82 void setLabel (QString);
83 QString label ();
84 void addRadioButton (QString);
85 QStringList radioButtons ();
86 void addRadioButtonId (int);
87 bool hasRadioButtonId (int);
88 void setHidden ();
89 bool isHidden ();
90 void setRequired ();
91 bool isRequired ();
92 void setWhatsThis (QString);
93 QString whatsThis ();
94 void setAttr (QString name, QString value = 0);
95 QString attr (const QString &);
96 QList<ApplicationFormAttr *> attrs ();
97 bool expiry ();
98 void setExpiry (time_t = 0, time_t = 0);
99 time_t expiryDate ();
100 time_t expiryAge ();
101 void setPlaceholderText (const QString &);
102 QString placeholderText ();
104 private:
105 int _type;
106 QWidget *_widget;
107 QString _value;
108 bool _elementSelector;
109 bool _fileSelector;
110 bool _passwordGenerator;
111 bool _dateSelector;
112 QString _id;
113 QString _childOf;
114 QString _pwmdName;
115 QString _label;
116 QStringList _radioButtons;
117 QList<int> _radioButtonIds;
118 bool _isHidden;
119 bool _isRequired;
120 QString _whatsThis;
121 bool _expiry;
122 time_t _expiryDate;
123 time_t _expiryAge;
124 QList<ApplicationFormAttr *> _attrs;
125 QString _placeholderText;
128 #endif