-
Notifications
You must be signed in to change notification settings - Fork 0
/
WSheet.h
53 lines (43 loc) · 1.08 KB
/
WSheet.h
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
#ifndef WSHEET_H
#define WSHEET_H
#include <QObject>
#include "word.h"
#ifdef Q_OS_WIN32
#include "voice/XpTTSVoice.h"
#endif
class WSheet : public QObject
{
Q_OBJECT
public:
explicit WSheet(QObject *parent = 0);
public: //out
QString textAt(int idx);
Word::WordStatus statusAt(int idx);
QString statusNameAt(int idx);
QString answerAt(int idx);
int size();
bool isRememberedAt(int idx);
bool isForgottenAt(int idx);
bool hasAnswerAt(int idx);
public:
bool loadFile( const QString& fileName, bool append);
bool saveFile(const QString &fileName);
bool initReader();
void readTextAt(int idx);
void readPause();
void readResume();
public: //in
void setText(QString txt, int idx);
void setStatus(Word::WordStatus sta, int idx);
void setAnswer(QString ans, int idx);
void eraseAt(int idx);
void pushBack(const Word& word);
signals:
void voiceCompleted();
private:
WordArray _warry;
#ifdef Q_OS_WIN32
XpTTSVoice _voice;
#endif
};
#endif // WSHEET_H