libosmscout 1.1.1
Loading...
Searching...
No Matches
Voice.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_CLIENT_QT_VOICE_H
2#define OSMSCOUT_CLIENT_QT_VOICE_H
3/*
4 OSMScout - a Qt backend for libosmscout and libosmscout-map
5 Copyright (C) 2020 Lukas Karas
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library 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 GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20*/
21
23
24#include <osmscoutclient/VoiceProvider.h>
25
26#include <QObject>
27#include <QDir>
28
29namespace osmscout {
30
31class OSMSCOUT_CLIENT_QT_API AvailableVoice : public QObject {
32 Q_OBJECT
33
34 Q_PROPERTY(bool valid READ isValid() CONSTANT)
35
36 Q_PROPERTY(QString lang READ getLang() CONSTANT)
37 Q_PROPERTY(QString gender READ getGender() CONSTANT)
38 Q_PROPERTY(QString name READ getName() CONSTANT)
39 Q_PROPERTY(QString license READ getLicense() CONSTANT)
40 Q_PROPERTY(QString directory READ getDirectory() CONSTANT)
41 Q_PROPERTY(QString author READ getAuthor() CONSTANT)
42 Q_PROPERTY(QString description READ getDescription() CONSTANT)
43
44private:
45 bool valid{false};
46
47 VoiceProvider provider;
48
49 QString lang;
50 QString gender;
51 QString name;
52 QString license;
53 QString directory;
54 QString author;
55 QString description;
56
57public:
58 AvailableVoice() = default;
59
60 AvailableVoice(const VoiceProvider &provider,
61 const QString &lang,
62 const QString &gender,
63 const QString &name,
64 const QString &license,
65 const QString &directory,
66 const QString &author,
67 const QString &description);
68
70
71 ~AvailableVoice() override = default;
72
73 VoiceProvider getProvider() const
74 {
75 return provider;
76 }
77
78 QString getLang() const
79 {
80 return lang;
81 }
82 QString getGender() const
83 {
84 return gender;
85 }
86 QString getName() const
87 {
88 return name;
89 }
90 QString getLicense() const
91 {
92 return license;
93 }
94 QString getDirectory() const
95 {
96 return directory;
97 }
98 QString getAuthor() const
99 {
100 return author;
101 }
102 QString getDescription() const
103 {
104 return description;
105 }
106
107 bool isValid() const
108 {
109 return valid;
110 }
111};
112
119{
120public:
121 Voice() = default;
122 explicit Voice(QDir dir);
123 ~Voice() = default;
124
125 Voice(const Voice &other) = default;
126 Voice &operator=(const Voice &other) = default;
127
128 Voice(Voice &&other) = default;
129 Voice &operator=(Voice &&other) = default;
130
131 QDir getDir() const
132 {
133 return dir;
134 }
135
136 QString getLang() const
137 {
138 return lang;
139 }
140
141 QString getGender() const
142 {
143 return gender;
144 }
145
146 QString getName() const
147 {
148 return name;
149 }
150
151 QString getLicense() const
152 {
153 return license;
154 }
155
156 QString getAuthor() const
157 {
158 return author;
159 }
160
161 QString getDescription() const
162 {
163 return description;
164 }
165
166 bool isValid() const
167 {
168 return valid;
169 }
170
172
173 static QStringList files();
174
175private:
176 QDir dir;
177 bool valid{false};
178 bool metadata{false};
179
180 QString lang;
181 QString gender;
182 QString name;
183 QString license;
184 QString author;
185 QString description;
186};
187
188}
189
190#endif //OSMSCOUT_CLIENT_QT_VOICE_H
#define OSMSCOUT_CLIENT_QT_API
Definition ClientQtImportExport.h:45
~AvailableVoice() override=default
QString getGender() const
Definition Voice.h:82
CONSTANTQString name
Definition Voice.h:38
QString getLang() const
Definition Voice.h:78
QString getAuthor() const
Definition Voice.h:98
CONSTANTQString lang
Definition Voice.h:36
bool valid
Definition Voice.h:34
QString getDescription() const
Definition Voice.h:102
AvailableVoice(const VoiceProvider &provider, const QString &lang, const QString &gender, const QString &name, const QString &license, const QString &directory, const QString &author, const QString &description)
CONSTANTQString license
Definition Voice.h:39
bool isValid() const
Definition Voice.h:107
CONSTANTQString directory
Definition Voice.h:40
VoiceProvider getProvider() const
Definition Voice.h:73
CONSTANTQString author
Definition Voice.h:41
AvailableVoice(const AvailableVoice &o)
QString getName() const
Definition Voice.h:86
CONSTANTQString gender
Definition Voice.h:37
QString getLicense() const
Definition Voice.h:90
QString getDirectory() const
Definition Voice.h:94
CONSTANTQString description
Definition Voice.h:42
Voice(const Voice &other)=default
~Voice()=default
bool isValid() const
Definition Voice.h:166
static QStringList files()
Voice()=default
Voice & operator=(const Voice &other)=default
QString getName() const
Definition Voice.h:146
Voice(Voice &&other)=default
Voice(QDir dir)
QString getGender() const
Definition Voice.h:141
QString getLicense() const
Definition Voice.h:151
QString getAuthor() const
Definition Voice.h:156
QString getLang() const
Definition Voice.h:136
QString getDescription() const
Definition Voice.h:161
Voice & operator=(Voice &&other)=default
QDir getDir() const
Definition Voice.h:131
Definition Area.h:39