Debian Codegraph @

addon/doxywizard/inputbool.h

raw
1 /******************************************************************************
2 *
3 * Copyright (C) 1997-2019 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 */
12
13 #ifndef INPUTBOOL_H
14 #define INPUTBOOL_H
15
16 #include "input.h"
17 #include <QObject>
18
19 class QCheckBox;
20 class QGridLayout;
21 class QLabel;
22
23 class InputBool : public QObject, public Input
24 {
25 Q_OBJECT
26
27 public:
28 InputBool(QGridLayout *layout,int &row,const QString &id,
29 bool enabled, const QString &docs );
30
31 // Input
32 QVariant &value();
33 void update();
34 Kind kind() const { return Bool; }
35 QString docs() const { return m_docs; }
36 QString id() const { return m_id; }
37 QString templateDocs() const { return m_tdocs; }
38 void addDependency(Input *option) { m_dependencies+=option; }
39 void setEnabled(bool);
40 void updateDependencies();
41 bool isDefault();
42 void writeValue(QTextStream &t,TextCodecAdapter *codec,bool convert);
43 void setTemplateDocs(const QString &docs) { m_tdocs = docs; }
44 static bool convertToBool(const QVariant &v,bool &isValid);
45
46 public slots:
47 void reset();
48 void setValue(bool);
49
50 signals:
51 void changed();
52 void toggle(QString,bool);
53 void showHelp(Input *);
54
55 private slots:
56 void help();
57
58 private:
59 void updateDefault();
60 bool m_state;
61 bool m_default;
62 bool m_enabled;
63 QVariant m_value;
64 QCheckBox *m_cb;
65 QString m_docs;
66 QList<Input*> m_dependencies;
67 QString m_id;
68 QLabel *m_lab;
69 QString m_tdocs;
70 };
71
72 #endif