|
libosmscout 0.1
|
List model with voices available by configured providers (see Settings::GetVoiceProviders). More...
#include <AvailableVoicesModel.h>
Inheritance diagram for osmscout::AvailableVoicesModel:Public Types | |
| enum | Roles { NameRole = Qt::UserRole , LangRole = Qt::UserRole + 1 , GenderRole = Qt::UserRole + 2 , LicenseRole = Qt::UserRole + 3 , DirectoryRole = Qt::UserRole + 4 , AuthorRole = Qt::UserRole + 5 , DescriptionRole = Qt::UserRole + 6 , StateRole = Qt::UserRole + 7 } |
| enum | VoiceState { Available , Downloading , Downloaded } |
Public Slots | |
| void | listDownloaded (const VoiceProvider &provider, QNetworkReply *) |
| void | onVoiceStateChanged (const AvailableVoice &voice) |
| void | reload () |
Signals | |
| void | loadingChanged () |
Public Member Functions | |
| AvailableVoicesModel () | |
| Q_INVOKABLE QVariant | data (const QModelIndex &index, int role) const override |
| Q_INVOKABLE void | download (const QModelIndex &index) |
| Q_INVOKABLE Qt::ItemFlags | flags (const QModelIndex &index) const override |
| QString | getFetchError () |
| bool | isLoading () |
| Q_INVOKABLE void | remove (const QModelIndex &index) |
| QHash< int, QByteArray > | roleNames () const override |
| Q_INVOKABLE int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Q_INVOKABLE QString | stateStr (VoiceState state) const |
| virtual | ~AvailableVoicesModel () |
Properties | |
| QString | fetchError |
| bool | loading |
List model with voices available by configured providers (see Settings::GetVoiceProviders).
Every voice provider have to expose list of voices by json. Json format exammple:
[
{
"lang": "American English",
"gender": "female",
"name": "Alex",
"license": "CC-By-SA 3.0",
"dir": "American English - Alex (female)",
"author": "Alex Spehr",
"description": "American English speaker"
}
]
| osmscout::AvailableVoicesModel::AvailableVoicesModel | ( | ) |
|
virtual |
|
override |
References AuthorRole, Available, DescriptionRole, DirectoryRole, Downloaded, Downloading, GenderRole, osmscout::AvailableVoice::getAuthor(), osmscout::AvailableVoice::getDescription(), osmscout::AvailableVoice::getDirectory(), osmscout::AvailableVoice::getGender(), osmscout::AvailableVoice::getLang(), osmscout::AvailableVoice::getLicense(), osmscout::AvailableVoice::getName(), LangRole, LicenseRole, NameRole, and StateRole.
| void osmscout::AvailableVoicesModel::download | ( | const QModelIndex & | index | ) |
|
override |
|
inline |
|
inline |
|
slot |
References fetchError, and loadingChanged().
Referenced by reload().
|
signal |
Referenced by listDownloaded(), and reload().
|
slot |
References osmscout::AvailableVoice::getLang(), osmscout::AvailableVoice::getName(), and StateRole.
Referenced by AvailableVoicesModel().
|
slot |
References fetchError, osmscout::OSMScoutQt::GetInstance(), listDownloaded(), and loadingChanged().
Referenced by AvailableVoicesModel().
| void osmscout::AvailableVoicesModel::remove | ( | const QModelIndex & | index | ) |
|
override |
References AuthorRole, DescriptionRole, DirectoryRole, GenderRole, LangRole, LicenseRole, NameRole, and StateRole.
|
override |
| QString osmscout::AvailableVoicesModel::stateStr | ( | VoiceState | state | ) | const |
References Available, Downloaded, and Downloading.
|
read |
Referenced by listDownloaded(), and reload().
|
read |