Open-Typer
Open source typewriting tutor program
Loading...
Searching...
No Matches
ExportProvider.h
1/*
2 * ExportWidget.h
3 * This file is part of Open-Typer
4 *
5 * Copyright (C) 2023 - adazem009
6 *
7 * Open-Typer is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * Open-Typer is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Open-Typer. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef EXPORTPROVIDER_H
22#define EXPORTPROVIDER_H
23
24#include <QWidget>
25#include <QTextEdit>
26#include "ExportTable.h"
27#include "validator/IExerciseValidator.h"
28#include "lessonpack/IConfigParser.h"
29#include "ui/IThemeEngine.h"
30
32class Q_DECL_EXPORT ExportProvider : public QObject
33{
34 Q_OBJECT
35 INJECT(IThemeEngine, themeEngine)
36 INJECT(IConfigParser, configParser)
37 Q_PROPERTY(IExerciseValidator *validator READ validator WRITE setValidator NOTIFY validatorChanged)
38 Q_PROPERTY(QString exportText READ exportText NOTIFY exportTextChanged)
39 Q_PROPERTY(ExportTable *table READ table WRITE setTable NOTIFY tableChanged)
40 public:
41 explicit ExportProvider(QObject *parent = nullptr);
42 IExerciseValidator *validator(void);
43 void setValidator(IExerciseValidator *validator);
44 QString exportText(void);
45 ExportTable *table(void);
46 void setTable(ExportTable *table);
47 Q_INVOKABLE void print(void);
48 Q_INVOKABLE void printExercise(int lesson, int sublesson, int exercise, QString text);
49 Q_INVOKABLE void printExercise(QString text);
50
51 private:
52 IExerciseValidator *m_validator;
53 QString m_exportText;
54 ExportTable *m_table;
55
56 signals:
57 void validatorChanged(IExerciseValidator *validator);
58 void exportTextChanged(QString text);
59 void tableChanged(ExportTable *table);
60};
61
62#endif // EXPORTPROVIDER_H
The ExportProvider class provides methods for the export dialog.
Definition ExportProvider.h:33
The ExportTable class provides a table for typing test results.
Definition ExportTable.h:30
Definition IConfigParser.h:27
Definition IExerciseValidator.h:30
Definition IThemeEngine.h:28