Open-Typer
Open source typewriting tutor program
Loading...
Searching...
No Matches
IExerciseValidator.h
1/*
2 * IExerciseValidator.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 IEXERCISEVALIDATOR_H
22#define IEXERCISEVALIDATOR_H
23
24#include <QObject>
25#include "MistakeRecord.h"
26#include "CharacterRecord.h"
27#include "global/modularity/ioc.h"
28
29class IExerciseValidator : public QObject, MODULE_EXPORT_INTERFACE
30{
31 Q_OBJECT
32 public:
33 virtual ~IExerciseValidator() { }
34
35 virtual QString exerciseText(void) = 0;
36 virtual void setExerciseText(QString text) = 0;
37 virtual QString inputText(void) = 0;
38 virtual void setInputText(QString text) = 0;
39 virtual void clearMistakes(void) = 0;
40 virtual void addMistake(MistakeRecord mistake) = 0;
41 virtual QList<MistakeRecord> mistakes(void) = 0;
42 virtual void setMistakes(QList<MistakeRecord> mistakeList) = 0;
43 virtual void clearCharacters(void) = 0;
44 virtual void addCharacter(CharacterRecord character) = 0;
45 virtual QList<CharacterRecord> characters(void) = 0;
46 virtual void setCharacters(QList<CharacterRecord> characterList) = 0;
47 virtual bool timed(void) = 0;
48 virtual void setTimed(bool value) = 0;
49 virtual qreal time(void) = 0;
50 virtual void setTime(qreal seconds) = 0;
51 virtual void validate(void) = 0;
52 virtual void validate(int grossHits, QStringList errorWords) = 0;
53 virtual int grossHits(void) = 0;
54 virtual int mistakeCount(void) = 0;
55 virtual QStringList errorWords(void) = 0;
56 virtual void generateMistakeText(bool correctMistakes) = 0;
57 virtual QString generatedInputText(void) = 0;
58 virtual QString generatedMistakeText(void) = 0;
59 virtual QString textWithMistakes(void) = 0;
60
61 signals:
62 void validated();
63 void exerciseTextChanged();
64 void inputTextChanged();
65 void mistakesChanged();
66 void charactersChanged();
67 void timedChanged();
68 void timeChanged();
69};
70
71#endif // IEXERCISEVALIDATOR_H
The CharacterRecord class can be used to store character records.
Definition CharacterRecord.h:32
Definition IExerciseValidator.h:30
The MistakeRecord class can be used to store mistake records.
Definition MistakeRecord.h:29