annotate include/gui/widgets/text.h @ 289:3dbf01233fec

autoconf: add a check for some weird Qt PIC requirements
author Paper <paper@paper.us.eu.org>
date Wed, 08 May 2024 17:27:13 -0400
parents 3ec7804abf17
children 9a88e1725fd2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
1 #ifndef MINORI_GUI_WIDGETS_TEXT_H_
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
2 #define MINORI_GUI_WIDGETS_TEXT_H_
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
3
76
3364fadc8a36 *: format source code
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
4 #include <QLineEdit>
3364fadc8a36 *: format source code
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
5 #include <QPlainTextEdit>
69
27a19dd6cba1 *: fix up some stuff
Paper <mrpapersonic@gmail.com>
parents: 64
diff changeset
6 #include <QSize>
76
3364fadc8a36 *: format source code
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
7 #include <QString>
3364fadc8a36 *: format source code
Paper <mrpapersonic@gmail.com>
parents: 75
diff changeset
8 #include <QWidget>
69
27a19dd6cba1 *: fix up some stuff
Paper <mrpapersonic@gmail.com>
parents: 64
diff changeset
9
27a19dd6cba1 *: fix up some stuff
Paper <mrpapersonic@gmail.com>
parents: 64
diff changeset
10 class QFrame;
253
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
11
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
12 #include <QLabel>
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
13
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14 namespace TextWidgets {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 class Header : public QWidget {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
17 Q_OBJECT
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
19 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
20 Header(const QString& title, QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
21 void SetText(const QString& title);
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
23 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
24 QLabel* static_text_title;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
25 QFrame* static_text_line;
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27
253
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
28 class Paragraph : public QLabel {
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
29 Q_OBJECT
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
30
253
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
31 public:
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
32 Paragraph(const QString& text, QWidget* parent = nullptr);
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
33 void SetText(const QString& text);
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
34 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
35
253
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
36 class LabelledParagraph final : public QWidget {
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
37 Q_OBJECT
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
38
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
39 public:
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
40 LabelledParagraph(const QString& label, const QString& data, QWidget* parent = nullptr);
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
41 Paragraph* GetLabels();
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
42 Paragraph* GetParagraph();
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
43
253
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
44 private:
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
45 Paragraph* labels;
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
46 Paragraph* paragraph;
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
47 };
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
48
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
49 class Line : public Paragraph {
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
50 Q_OBJECT
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
51
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
52 public:
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
53 Line(QWidget* parent = nullptr);
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
54 Line(const QString& text, QWidget* parent = nullptr);
b3549da699a6 *: ooooh! stupid big commit!
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
55 void SetText(const QString& text);
75
d3e9310598b1 *: refactor some stuff
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
56 };
d3e9310598b1 *: refactor some stuff
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
57
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 83
diff changeset
58 class Title final : public Line {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
59 Q_OBJECT
75
d3e9310598b1 *: refactor some stuff
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
60
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
61 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
62 Title(const QString& title, QWidget* parent = nullptr);
75
d3e9310598b1 *: refactor some stuff
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
63 };
d3e9310598b1 *: refactor some stuff
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
64
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 83
diff changeset
65 class Section final : public QWidget {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
66 Q_OBJECT
75
d3e9310598b1 *: refactor some stuff
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
67
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
68 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
69 Section(const QString& title, const QString& data, QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
70 Header* GetHeader();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
71 Paragraph* GetParagraph();
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
72
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
73 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
74 Header* header;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
75 Paragraph* paragraph;
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
76 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
77
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 83
diff changeset
78 class LabelledSection final : public QWidget {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
79 Q_OBJECT
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
80
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
81 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
82 LabelledSection(const QString& title, const QString& label, const QString& data, QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
83 Header* GetHeader();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
84 Paragraph* GetLabels();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
85 Paragraph* GetParagraph();
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
86
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
87 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
88 Header* header;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
89 LabelledParagraph* content;
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
90 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
91
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 83
diff changeset
92 class SelectableSection final : public QWidget {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
93 Q_OBJECT
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
94
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
95 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
96 SelectableSection(const QString& title, const QString& data, QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
97 Header* GetHeader();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
98 Paragraph* GetParagraph();
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
99
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
100 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
101 Header* header;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
102 Paragraph* paragraph;
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
103 };
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
104
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 83
diff changeset
105 class OneLineSection final : public QWidget {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
106 Q_OBJECT
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
107
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
108 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
109 OneLineSection(const QString& title, const QString& data, QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
110 Header* GetHeader();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
111 Line* GetLine();
75
d3e9310598b1 *: refactor some stuff
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
112
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
113 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
114 Header* header;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 253
diff changeset
115 Line* line;
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
116 };
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
117
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
118 } // namespace TextWidgets
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
119
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
120 #endif // MINORI_GUI_WIDGETS_TEXT_H_