File: demo.h

package info (click to toggle)
tuiwidgets 0.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,852 kB
  • sloc: cpp: 70,959; python: 655; sh: 39; makefile: 24
file content (119 lines) | stat: -rw-r--r-- 2,269 bytes parent folder | download | duplicates (2)
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
// Feel free to copy from this example to your own code
// SPDX-License-Identifier: 0BSD OR BSL-1.0 OR MIT-0

#ifndef DEMO_H
#define DEMO_H

#include <QDir>
#include <QFileSystemWatcher>

#include <Tui/Misc/AbstractTableModelTrackBy.h>
#include <Tui/ZDialog.h>
#include <Tui/ZListView.h>
#include <Tui/ZRoot.h>
#include <Tui/ZTextEdit.h>
#include <Tui/ZTextLine.h>

class Demo : public Tui::ZRoot {
    Q_OBJECT

public:
    Demo();
    ~Demo();

protected:
    void terminalChanged() override;

private:
    void quit();
};

class ButtonDialog : public Tui::ZDialog {
    Q_OBJECT

public:
    ButtonDialog(Tui::ZWidget *parent, Tui::ZTextLine *message);
};


class CheckBoxDialog : public Tui::ZDialog {
    Q_OBJECT
public:
    CheckBoxDialog(Tui::ZWidget *parent, Tui::ZTextLine *message);
};


class RadioButtonDialog : public Tui::ZDialog {
    Q_OBJECT
public:
    RadioButtonDialog(Tui::ZWidget *parent, Tui::ZTextLine *message);
};


class InputBoxDialog : public Tui::ZDialog {
    Q_OBJECT
public:
    InputBoxDialog(Tui::ZWidget *parent);
};

class FileModel : public Tui::Misc::AbstractTableModelTrackBy<QString> {
    Q_OBJECT
public:
    FileModel(const QDir &dir);

public:
    void update();
    void setDirectory(const QDir &dir);

private:
    QDir _dir;
    QFileSystemWatcher _watcher;
};

class ListViewDialog : public Tui::ZDialog {
    Q_OBJECT
public:
    ListViewDialog(Tui::ZWidget *parent);
private:
    void refreshFolder();
    void userInput(QString filename);

    Tui::ZListView *_listview;
    QDir _dir;
    std::unique_ptr<FileModel> _model;
};

class TextEditDialog : public Tui::ZDialog {
    Q_OBJECT
public:
    TextEditDialog(Tui::ZWidget *parent);
};


class LabelDialog : public Tui::ZDialog {
    Q_OBJECT
public:
    LabelDialog(Tui::ZWidget *parent);
};

class SearchAndReplaceDialog : public Tui::ZDialog {
    Q_OBJECT
public:
    SearchAndReplaceDialog (Tui::ZWidget *parent);
};

class AboutDialog : public Tui::ZWindow {
    Q_OBJECT
public:
    AboutDialog(Tui::ZWidget *parent);
    void paintEvent(Tui::ZPaintEvent *event) override;
};

class StartDialog : public Tui::ZDialog {
    Q_OBJECT
public:
    StartDialog(Tui::ZWidget *parent);
    void paintEvent(Tui::ZPaintEvent *event) override;
};

#endif // DEMO_H