This repository has been archived by the owner on Feb 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhelper.h
67 lines (46 loc) · 1.71 KB
/
helper.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef HELPER_H
#define HELPER_H
#include "qmlapplicationviewer.h"
#include <QObject>
#include <QMetaType>
#include <QHash>
class MainWindow;
class Helper : public QObject
{
Q_OBJECT
// By default, the first one appearing on the file
Q_PROPERTY(QString speechText READ speechText() WRITE setSpeechText NOTIFY speechTextChanged)
// By default, the first one appearing on the file
Q_PROPERTY(QString speechTitle READ speechTitle() WRITE setSpeechTitle NOTIFY speechTitleChanged)
public:
explicit Helper(MainWindow *mainWindow);
explicit Helper(const Helper ©);
explicit Helper() : QObject(0), mMainWindow(0) {}
public Q_SLOTS:
/**
* @returns the text of the speech given to the app as an argument
*/
Q_INVOKABLE QString speechText() const;
Q_INVOKABLE void setSpeechText(const QString &speechText);
Q_INVOKABLE QString speechTitle() const;
Q_INVOKABLE void setSpeechTitle(const QString &speechTitle);
Q_INVOKABLE void changeSpeechTitle(const QString &speechTitle);
Q_INVOKABLE void toggleFullScreen();
Q_INVOKABLE void openSpeechDialog(const QString &tryThisFirst = "");
QHash<QString, QString> speechItems() const { return mSpeechItems; }
QStringList speechTitles() const { return mSpeechTitles; }
void save();
void deleteSpeechItem(const QString &speechTitle = QString());
void appendSpeech(const QString &title, const QString &text);
Q_SIGNALS:
void speechTextChanged();
void speechTitleChanged();
void speechItemsChanged();
protected:
QString mSpeechTitle;
MainWindow *mMainWindow;
QHash<QString, QString> mSpeechItems;
QStringList mSpeechTitles;
};
Q_DECLARE_METATYPE(Helper*)
#endif // HELPER_H