diff --git a/liblearnerprofile/src/models/learninggoalmodel.h b/liblearnerprofile/src/models/learninggoalmodel.h index 0712aa3..27e3435 100644 --- a/liblearnerprofile/src/models/learninggoalmodel.h +++ b/liblearnerprofile/src/models/learninggoalmodel.h @@ -1,80 +1,80 @@ /* * Copyright 2013-2016 Andreas Cord-Landwehr * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) version 3, or any * later version accepted by the membership of KDE e.V. (or its * successor approved by the membership of KDE e.V.), which shall * act as a proxy defined in Section 6 of version 3 of the license. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef LEARNINGGOALMODEL_H #define LEARNINGGOALMODEL_H #include "liblearnerprofile_export.h" #include #include class LearningGoalModelPrivate; namespace LearnerProfile { class ProfileManager; class LearningGoal; class Learner; class LIBLEARNERPROFILE_EXPORT LearningGoalModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(LearnerProfile::ProfileManager *profileManager READ profileManager WRITE setProfileManager NOTIFY profileManagerChanged) Q_PROPERTY(LearnerProfile::Learner *learner READ learner WRITE setLearner NOTIFY learnerChanged) public: enum learningGoalRoles { TitleRole = Qt::UserRole + 1, IdRole, DataRole }; explicit LearningGoalModel(QObject *parent = nullptr); virtual ~LearningGoalModel(); /** * Reimplemented from QAbstractListModel::roleNames() */ - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; void setProfileManager(ProfileManager *profileManager); ProfileManager * profileManager() const; void setLearner(Learner *learner); Learner * learner() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; Q_INVOKABLE QVariant learningGoal(int index) const; Q_SIGNALS: void profileManagerChanged(); void learnerChanged(); void learningGoalChanged(int index); private Q_SLOTS: void onLearningGoalAboutToBeAdded(LearningGoal *goal, int index); void onLearningGoalAdded(); void onLearningGoalAboutToBeRemoved(int index); void emitLearningGoalChanged(int row); private: const QScopedPointer d; }; } #endif // LEARNINGGOALMODEL_H diff --git a/libsound/src/qtmultimediabackend/qtmultimediabackend.h b/libsound/src/qtmultimediabackend/qtmultimediabackend.h index f410b48..cf13386 100644 --- a/libsound/src/qtmultimediabackend/qtmultimediabackend.h +++ b/libsound/src/qtmultimediabackend/qtmultimediabackend.h @@ -1,46 +1,46 @@ /* * Copyright 2016 Andreas Cord-Landwehr * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #ifndef QTMULTIMEDIABACKEND_H #define QTMULTIMEDIABACKEND_H #include "../backendinterface.h" class CaptureBackendInterface; class OutputBackendInterface; class QtMultimediaCaptureBackend; class QtMultimediaOutputBackend; class QtMultimediaBackend : public BackendInterface { Q_OBJECT public: explicit QtMultimediaBackend(QObject *parent, const QList< QVariant >&); virtual ~QtMultimediaBackend(); - CaptureBackendInterface * captureBackend() const Q_DECL_OVERRIDE; - OutputBackendInterface * outputBackend() const Q_DECL_OVERRIDE; + CaptureBackendInterface * captureBackend() const override; + OutputBackendInterface * outputBackend() const override; private: QtMultimediaCaptureBackend *m_captureBackend; QtMultimediaOutputBackend *m_outputBackend; }; #endif diff --git a/libsound/src/qtmultimediabackend/qtmultimediacapturebackend.h b/libsound/src/qtmultimediabackend/qtmultimediacapturebackend.h index f8130c8..f6f2e36 100644 --- a/libsound/src/qtmultimediabackend/qtmultimediacapturebackend.h +++ b/libsound/src/qtmultimediabackend/qtmultimediacapturebackend.h @@ -1,53 +1,53 @@ /* * Copyright 2016 Andreas Cord-Landwehr * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #ifndef QTMULTIMEDIACAPTUREBACKEND_H #define QTMULTIMEDIACAPTUREBACKEND_H #include "capturedevicecontroller.h" #include "capturebackendinterface.h" #include #include class QAudioRecorder; class QMediaRecorder; class QMediaObject; class QtMultimediaCaptureBackend : public CaptureBackendInterface { Q_OBJECT public: explicit QtMultimediaCaptureBackend(QObject *parent); virtual ~QtMultimediaCaptureBackend(); - void startCapture(const QString &filePath) Q_DECL_OVERRIDE; - void stopCapture() Q_DECL_OVERRIDE; - CaptureDeviceController::State captureState() const Q_DECL_OVERRIDE; + void startCapture(const QString &filePath) override; + void stopCapture() override; + CaptureDeviceController::State captureState() const override; - QStringList devices() const Q_DECL_OVERRIDE; - void setDevice(const QString &deviceIdentifier) Q_DECL_OVERRIDE; + QStringList devices() const override; + void setDevice(const QString &deviceIdentifier) override; private: QAudioRecorder *m_recorder; QString m_device; }; #endif diff --git a/libsound/src/qtmultimediabackend/qtmultimediaoutputbackend.h b/libsound/src/qtmultimediabackend/qtmultimediaoutputbackend.h index 46b42dd..a3d3530 100644 --- a/libsound/src/qtmultimediabackend/qtmultimediaoutputbackend.h +++ b/libsound/src/qtmultimediabackend/qtmultimediaoutputbackend.h @@ -1,52 +1,52 @@ /* * Copyright 2016 Andreas Cord-Landwehr * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ #ifndef QTMULTIMEDIAOUTPUTBACKEND_H #define QTMULTIMEDIAOUTPUTBACKEND_H #include "outputbackendinterface.h" #include class QMediaPlayer; class QtMultimediaOutputBackend : public OutputBackendInterface { Q_OBJECT public: explicit QtMultimediaOutputBackend(QObject *parent = nullptr); virtual ~QtMultimediaOutputBackend(); - void setUri(const QString & uri) Q_DECL_OVERRIDE; + void setUri(const QString & uri) override; /** * volume as cubic value */ - int volume() const Q_DECL_OVERRIDE; + int volume() const override; - OutputDeviceController::State state() const Q_DECL_OVERRIDE; + OutputDeviceController::State state() const override; public Q_SLOTS: - void play() Q_DECL_OVERRIDE; - void pause() Q_DECL_OVERRIDE; - void stop() Q_DECL_OVERRIDE; - void setVolume(int volume) Q_DECL_OVERRIDE; + void play() override; + void pause() override; + void stop() override; + void setVolume(int volume) override; private: QMediaPlayer *m_player; }; #endif diff --git a/src/core/resources/courseresource.h b/src/core/resources/courseresource.h index f124839..02861df 100644 --- a/src/core/resources/courseresource.h +++ b/src/core/resources/courseresource.h @@ -1,120 +1,120 @@ /* * Copyright 2013 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef COURSERESOURCE_H #define COURSERESOURCE_H #include "artikulatecore_export.h" #include "resourceinterface.h" #include class QDomElement; class QString; class CourseResourcePrivate; class Course; class Unit; class Phrase; class ARTIKULATECORE_EXPORT CourseResource : public ResourceInterface { Q_OBJECT void course(QString text); public: /** * Create course resource from file. */ explicit CourseResource(ResourceManager *resourceManager, const QUrl &path); virtual ~CourseResource(); /** * \return unique identifier */ - QString identifier() Q_DECL_OVERRIDE; + QString identifier() override; /** * \return human readable localized title */ - QString title() Q_DECL_OVERRIDE; + QString title() override; /** * \return human readable title in English */ - QString i18nTitle() Q_DECL_OVERRIDE; + QString i18nTitle() override; /** * \return language identifier of this course */ QString language() const; /** * \return type of resource */ - Type type() const Q_DECL_OVERRIDE; + Type type() const override; /** * \return true if resource is loaded, otherwise false */ - bool isOpen() const Q_DECL_OVERRIDE; + bool isOpen() const override; - void sync() Q_DECL_OVERRIDE; + void sync() override; /** * export course as .tar.bz2 file in the specified folder. */ void exportGhns(const QString &path); /** * close resource without writing changes back to file */ - void close() Q_DECL_OVERRIDE; + void close() override; /** * \return path to resource file */ - QUrl path() const Q_DECL_OVERRIDE; + QUrl path() const override; /** * \return reference to the loaded resource * if resource is not open yet, it will be loaded */ - QObject * resource() Q_DECL_OVERRIDE; + QObject * resource() override; /** * \return reference to the loaded course resource * Same behavior as \see resource() but casted to Course */ Course * course(); private: Phrase * parsePhrase(QDomElement phraseNode, Unit *parentUnit) const; /** * \return serialized course as DOM document * \param trainingExport if true phrases without recording and empty units are excluded */ QDomDocument serializedDocument(bool trainingExport=false) const; QDomElement serializedPhrase(Phrase * phrase, QDomDocument &document) const; const QScopedPointer d; }; #endif diff --git a/src/core/resources/languageresource.h b/src/core/resources/languageresource.h index 14309d3..d9756a7 100644 --- a/src/core/resources/languageresource.h +++ b/src/core/resources/languageresource.h @@ -1,93 +1,93 @@ /* * Copyright 2013 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LANGUAGERESOURCE_H #define LANGUAGERESOURCE_H #include "artikulatecore_export.h" #include "resourceinterface.h" #include class LanguageResourcePrivate; class Language; class ARTIKULATECORE_EXPORT LanguageResource : public ResourceInterface { Q_OBJECT public: explicit LanguageResource(ResourceManager *resourceManager, const QUrl &path); virtual ~LanguageResource(); /** * \return unique identifier */ - QString identifier() Q_DECL_OVERRIDE; + QString identifier() override; /** * \return human readable localized title */ - QString title() Q_DECL_OVERRIDE; + QString title() override; /** * \return human readable title in English */ - QString i18nTitle() Q_DECL_OVERRIDE; + QString i18nTitle() override; /** * \return type of resource */ - Type type() const Q_DECL_OVERRIDE; + Type type() const override; /** * \return true if resource is loaded, otherwise false */ - bool isOpen() const Q_DECL_OVERRIDE; + bool isOpen() const override; /** * close resource without writing changes back to file */ - void close() Q_DECL_OVERRIDE; + void close() override; /** * \return path to resource file */ - QUrl path() const Q_DECL_OVERRIDE; + QUrl path() const override; /** * \return reference to the loaded resource * if resource is not open yet, it will be loaded */ - QObject * resource() Q_DECL_OVERRIDE; + QObject * resource() override; /** * \return reference to the loaded language resource * Same behavior as \see resource() but casted to Language */ Language * language(); private: const QScopedPointer d; }; #endif diff --git a/src/core/resources/skeletonresource.h b/src/core/resources/skeletonresource.h index faf0239..d4dd084 100644 --- a/src/core/resources/skeletonresource.h +++ b/src/core/resources/skeletonresource.h @@ -1,105 +1,105 @@ /* * Copyright 2013 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SKELETONRESOURCE_H #define SKELETONRESOURCE_H #include "artikulatecore_export.h" #include "resourceinterface.h" #include class SkeletonResourcePrivate; class Skeleton; class ARTIKULATECORE_EXPORT SkeletonResource : public ResourceInterface { Q_OBJECT void course(QString text); public: /** * Create course resource from file. */ explicit SkeletonResource(ResourceManager *resourceManager, const QUrl &path); /** * Create course resource from course. */ explicit SkeletonResource(ResourceManager *resourceManager, Skeleton *skeleton); virtual ~SkeletonResource(); /** * \return unique identifier */ - QString identifier() Q_DECL_OVERRIDE; + QString identifier() override; /** * \return human readable localized title */ - QString title() Q_DECL_OVERRIDE; + QString title() override; /** * \return human readable title in English */ - QString i18nTitle() Q_DECL_OVERRIDE; + QString i18nTitle() override; /** * \return type of resource */ - Type type() const Q_DECL_OVERRIDE; + Type type() const override; /** * \return true if resource is loaded, otherwise false */ - bool isOpen() const Q_DECL_OVERRIDE; + bool isOpen() const override; /** * close resource without writing changes back to file */ - void close() Q_DECL_OVERRIDE; + void close() override; - void sync() Q_DECL_OVERRIDE; + void sync() override; - void reload() Q_DECL_OVERRIDE; + void reload() override; /** * \return path to resource file */ - QUrl path() const Q_DECL_OVERRIDE; + QUrl path() const override; /** * \return reference to the loaded resource * if resource is not open yet, it will be loaded */ - QObject * resource() Q_DECL_OVERRIDE; + QObject * resource() override; /** * \return reference to the loaded skeleton resource * Same behavior as \see resource() but casted to Skeleton */ Skeleton * skeleton(); private: const QScopedPointer d; }; #endif diff --git a/src/core/skeleton.h b/src/core/skeleton.h index e81095c..ec65eff 100644 --- a/src/core/skeleton.h +++ b/src/core/skeleton.h @@ -1,53 +1,53 @@ /* * Copyright 2013 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SKELETON_H #define SKELETON_H #include "artikulatecore_export.h" #include "course.h" #include #include #include class ResourceInterface; class SkeletonResource; class ARTIKULATECORE_EXPORT Skeleton : public Course { Q_OBJECT public: explicit Skeleton(ResourceInterface *resource = nullptr); ~Skeleton(); /** * Writes course object back to file and set \ref modified state to false. * If no file is set, no operation is performed. */ - Q_INVOKABLE void sync() Q_DECL_OVERRIDE; + Q_INVOKABLE void sync() override; private: Q_DISABLE_COPY(Skeleton) SkeletonResource * const m_resource; }; #endif // SKELETON_H diff --git a/src/mainwindow_editor.h b/src/mainwindow_editor.h index 38b9452..e4f1890 100644 --- a/src/mainwindow_editor.h +++ b/src/mainwindow_editor.h @@ -1,73 +1,73 @@ /* * Copyright 2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef MAINWINDOW_EDITOR_H #define MAINWINDOW_EDITOR_H #include #include #include "core/resourcemanager.h" #include "core/trainingsession.h" class EditorSession; class KActionCollection; class KMenu; class QQuickWidget; class MainWindowEditor : public KXmlGuiWindow { Q_OBJECT Q_PROPERTY(ResourceManager *globalResourceManager READ resourceManager CONSTANT) public: /** * Default Constructor */ MainWindowEditor(); /** * Default Destructor */ virtual ~MainWindowEditor(); ResourceManager * resourceManager() const; void setupActions(); - QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(1000, 700); } + QSize sizeHint() const override { return QSize(1000, 700); } - bool queryClose() Q_DECL_OVERRIDE; + bool queryClose() override; public Q_SLOTS: void showSettingsDialog(); void save(); void quit(); Q_SIGNALS: void modeChanged(bool); private: ResourceManager *m_resourceManager; EditorSession *m_editorSession; QQuickWidget *m_widget; }; #endif diff --git a/src/models/coursefiltermodel.h b/src/models/coursefiltermodel.h index 6b56a3a..8ec7502 100644 --- a/src/models/coursefiltermodel.h +++ b/src/models/coursefiltermodel.h @@ -1,65 +1,65 @@ /* * Copyright 2014-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef COURSEFILTERMODEL_H #define COURSEFILTERMODEL_H #include class Course; class CourseModel; class QSignalMapper; class CourseFilterModel : public QSortFilterProxyModel { Q_OBJECT Q_PROPERTY(CourseModel *courseModel READ courseModel WRITE setCourseModel NOTIFY courseModelChanged) Q_PROPERTY(CourseResourceView view READ view WRITE setView NOTIFY viewChanged) Q_PROPERTY(int filteredCount READ filteredCount NOTIFY filteredCountChanged) public: Q_ENUMS(CourseResourceView); enum CourseResourceView { OnlyGetHotNewStuffResources = 1, OnlyContributorResources = 2, AllResources = 3 }; explicit CourseFilterModel(QObject *parent = nullptr); CourseModel * courseModel() const; void setCourseModel(CourseModel* courseModel); int filteredCount() const; - virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; - virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const Q_DECL_OVERRIDE; + virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; + virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; void setView(CourseResourceView view); CourseResourceView view() const; Q_INVOKABLE QVariant course(int row) const; Q_SIGNALS: void courseModelChanged(); void viewChanged(); void sortOptionChanged(); void filteredCountChanged(); private: CourseModel *m_courseModel; CourseResourceView m_view; }; #endif diff --git a/src/models/languagemodel.h b/src/models/languagemodel.h index 165e748..c328964 100644 --- a/src/models/languagemodel.h +++ b/src/models/languagemodel.h @@ -1,62 +1,62 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LANGUAGEMODEL_H #define LANGUAGEMODEL_H #include class LanguageResourceModel; class Language; class QSignalMapper; class LanguageModel : public QSortFilterProxyModel { Q_OBJECT Q_PROPERTY(LanguageResourceModel *resourceModel READ resourceModel WRITE setResourceModel NOTIFY resourceModelChanged) Q_PROPERTY(LanguageResourceView view READ view WRITE setView NOTIFY viewChanged) public: Q_ENUMS(LanguageResourceView); enum LanguageResourceView { NonEmptyContributorOnlyResources, NonEmptyGhnsOnlyLanguages, NonEmptyLanguages, AllLanguages }; explicit LanguageModel(QObject *parent = nullptr); LanguageResourceModel * resourceModel() const; void setResourceModel(LanguageResourceModel *resourceModel); - virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; + virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; void setView(LanguageResourceView view); LanguageResourceView view() const; Q_INVOKABLE QVariant language(int index) const; Q_SIGNALS: void resourceModelChanged(); void viewChanged(); private: LanguageResourceModel *m_resourceModel; LanguageResourceView m_view; }; #endif diff --git a/src/models/languageresourcemodel.h b/src/models/languageresourcemodel.h index 610f34e..4b3b62f 100644 --- a/src/models/languageresourcemodel.h +++ b/src/models/languageresourcemodel.h @@ -1,81 +1,81 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LANGUAGERESOURCEMODEL_H #define LANGUAGERESOURCEMODEL_H #include #include "languagemodel.h" class ResourceManager; class LanguageResource; class Language; class QSignalMapper; class LanguageResourceModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(ResourceManager *resourceManager READ resourceManager WRITE setResourceManager NOTIFY resourceManagerChanged) public: enum LanguageRoles { TitleRole = Qt::UserRole + 1, I18nTitleRole, IdRole, DataRole, CourseNumberRole }; explicit LanguageResourceModel(QObject *parent = nullptr); /** * Reimplemented from QAbstractListModel::roleNames() */ - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; void setResourceManager(ResourceManager *resourceManager); ResourceManager * resourceManager() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; void setView(LanguageModel::LanguageResourceView view); LanguageModel::LanguageResourceView view() const; Q_SIGNALS: void languageChanged(int index); void resourceManagerChanged(); private Q_SLOTS: void onLanguageResourceAboutToBeAdded(LanguageResource *resource, int index); void onLanguageResourceAdded(); void onLanguageResourceAboutToBeRemoved(int index); void onLanguageResourceRemoved(); void emitLanguageChanged(int row); void updateDisplayedLanguages(); private: bool displayResource(LanguageResource *resource) const; void updateResources(); void updateMappings(); ResourceManager *m_resourceManager; QList m_resources; LanguageModel::LanguageResourceView m_view; QSignalMapper *m_signalMapper; }; #endif diff --git a/src/models/learningprogressmodel.h b/src/models/learningprogressmodel.h index 869a575..bc7c57c 100644 --- a/src/models/learningprogressmodel.h +++ b/src/models/learningprogressmodel.h @@ -1,70 +1,70 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LEARNINGPROGRESSMODEL_H #define LEARNINGPROGRESSMODEL_H #include #include class TrainingSession; class LearningProgressModel : public QAbstractTableModel { Q_OBJECT Q_PROPERTY(TrainingSession *session READ session WRITE setSession NOTIFY sessionChanged) Q_PROPERTY(int maximumTries READ maximumTries NOTIFY maximumTriesChanged) Q_PROPERTY(int maximumPhrasesPerTry READ maximumPhrasesPerTry NOTIFY maximumTriesChanged) public: enum unitRoles { TitleRole = Qt::UserRole + 1, NumberPhrasesRole, IdRole, DataRole }; explicit LearningProgressModel(QObject *parent = nullptr); /** * Reimplemented from QAbstractListModel::roleNames() */ - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; void setSession(TrainingSession *session); TrainingSession * session() const; int maximumTries() const; int maximumPhrasesPerTry() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; Q_SIGNALS: void sessionChanged(); void maximumTriesChanged(); private Q_SLOTS: void updateResults(); private: TrainingSession *m_session; int m_maximumTries; }; #endif // LEARNINGPROGRESSMODEL_H diff --git a/src/models/phonemegroupmodel.h b/src/models/phonemegroupmodel.h index fe6b105..cadb520 100644 --- a/src/models/phonemegroupmodel.h +++ b/src/models/phonemegroupmodel.h @@ -1,70 +1,70 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PHONEMEGROUPMODEL_H #define PHONEMEGROUPMODEL_H #include class Course; class PhonemeGroup; class QSignalMapper; class PhonemeGroupModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(Course *course READ course WRITE setCourse NOTIFY courseChanged) public: enum unitRoles { TitleRole = Qt::UserRole + 1, IdRole, DataRole }; explicit PhonemeGroupModel(QObject *parent = nullptr); /** * Reimplemented from QAbstractListModel::roleNames() */ - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; void setCourse(Course *course); Course * course() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; signals: void phonemeGroupChanged(int index); void courseChanged(); private slots: void onPhonemeGroupAboutToBeAdded(PhonemeGroup *phonemeGroup, int index); void onPhonemeGroupAdded(); void onPhonemeGroupsAboutToBeRemoved(int first, int last); void onPhonemeGroupsRemoved(); void emitPhonemeGroupChanged(int row); private: void updateMappings(); Course *m_course; QSignalMapper *m_signalMapper; }; #endif // PHONEMEGROUPMODEL_H diff --git a/src/models/phonememodel.h b/src/models/phonememodel.h index 9dac19b..9df5cd2 100644 --- a/src/models/phonememodel.h +++ b/src/models/phonememodel.h @@ -1,71 +1,71 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PHONEMEMODEL_H #define PHONEMEMODEL_H #include class Phoneme; class Language; class QSignalMapper; class PhonemeModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(Language *language READ language WRITE setLanguage NOTIFY languageChanged) public: enum courseRoles { TitleRole = Qt::UserRole + 1, IdRole, DataRole }; explicit PhonemeModel(QObject *parent = nullptr); /** * Reimplemented from QAbstractListModel::roleNames() */ - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; void setLanguage(Language *language); Language * language() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; Q_SIGNALS: void phonemeChanged(int index); void languageChanged(); private Q_SLOTS: void onPhonemeAboutToBeAdded(Phoneme *phoneme, int index); void onPhonemeAdded(); void onPhonemesAboutToBeRemoved(int first, int last); void onPhonemesRemoved(); void emitPhonemeChanged(int row); private: void updateMappings(); Language *m_language; QSignalMapper *m_signalMapper; }; #endif // PHONEMEMODEL_H diff --git a/src/models/phonemeunitmodel.h b/src/models/phonemeunitmodel.h index fbe8200..a8ed979 100644 --- a/src/models/phonemeunitmodel.h +++ b/src/models/phonemeunitmodel.h @@ -1,82 +1,82 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PHONEMEUNITMODEL_H #define PHONEMEUNITMODEL_H #include class PhonemeGroup; class Course; class Unit; class PhonemeGroup; class QSignalMapper; class PhonemeUnitModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(Course *course READ course WRITE setCourse NOTIFY courseChanged) Q_PROPERTY(PhonemeGroup *phonemeGroup READ phonemeGroup WRITE setPhonemeGroup NOTIFY phonemeGroupChanged) Q_PROPERTY(int count READ count NOTIFY countChanged); public: enum unitRoles { TitleRole = Qt::UserRole + 1, NumberPhrasesRole, IdRole, DataRole, PhonemeGroupRole }; explicit PhonemeUnitModel(QObject *parent = nullptr); /** * Reimplemented from QAbstractListModel::roleNames() */ - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; void setCourse(Course *course); Course * course() const; void setPhonemeGroup(PhonemeGroup *phonemeGroup); PhonemeGroup * phonemeGroup() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; int count() const; Q_SIGNALS: void unitChanged(int index); void courseChanged(); void phonemeGroupChanged(); void countChanged(); private Q_SLOTS: void onUnitAboutToBeAdded(PhonemeGroup *phonemeGroup, int index); void onUnitAdded(); void onUnitsAboutToBeRemoved(int first, int last); void onUnitsRemoved(); void emitUnitChanged(int row); private: void updateMappings(); Course *m_course; PhonemeGroup *m_phonemeGroup; QSignalMapper *m_signalMapper; }; #endif // PHONEMEUNITMODEL_H diff --git a/src/models/phrasefiltermodel.h b/src/models/phrasefiltermodel.h index 95fd7c8..df73d46 100644 --- a/src/models/phrasefiltermodel.h +++ b/src/models/phrasefiltermodel.h @@ -1,72 +1,72 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * Copyright 2013 Samikshan Bairagya * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PHRASEFILTERMODEL_H #define PHRASEFILTERMODEL_H #include class PhraseListModel; class QSignalMapper; class PhraseFilterModel : public QSortFilterProxyModel { Q_OBJECT Q_PROPERTY(PhraseListModel *phraseModel READ phraseModel WRITE setPhraseModel NOTIFY phraseModelChanged) Q_PROPERTY(bool hideExcluded READ isHideExcluded WRITE setHideExcluded NOTIFY hideExcludedChanged) Q_PROPERTY(bool hideNotRecorded READ isHideNotRecorded WRITE setHideNotRecorded NOTIFY hideNotRecordedChanged) Q_PROPERTY(SortOption sortOption READ sortOption WRITE setSortOption NOTIFY sortOptionChanged) Q_PROPERTY(int filteredCount READ filteredCount NOTIFY filteredCountChanged) public: Q_ENUMS(SortOption) enum SortOption { Id, Type }; explicit PhraseFilterModel(QObject *parent = nullptr); PhraseListModel * phraseModel() const; void setPhraseModel(PhraseListModel* phraseModel); void setSortOption(SortOption option = Id); SortOption sortOption() const; int filteredCount() const; - virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; - virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const Q_DECL_OVERRIDE; + virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; + virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; void setHideExcluded(bool hide=true); bool isHideExcluded() const; void setHideNotRecorded(bool hide=true); bool isHideNotRecorded() const; Q_SIGNALS: void phraseModelChanged(); void hideExcludedChanged(); void hideNotRecordedChanged(); void sortOptionChanged(); void filteredCountChanged(); private: PhraseListModel *m_phraseModel; bool m_hideExcluded; bool m_hideNotRecorded; SortOption m_sortOption; }; #endif diff --git a/src/models/phraselistmodel.h b/src/models/phraselistmodel.h index c2cac5c..01bffc3 100644 --- a/src/models/phraselistmodel.h +++ b/src/models/phraselistmodel.h @@ -1,84 +1,84 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PHRASELISTMODEL_H #define PHRASELISTMODEL_H #include #include "core/phrase.h" class Unit; class QSignalMapper; class PhraseListModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(Unit *unit READ unit WRITE setUnit NOTIFY unitChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) public: enum phraseRoles { TextRole = Qt::UserRole + 1, IdRole, TypeRole, SoundFileRole, ExcludedRole, DataRole }; explicit PhraseListModel(QObject *parent = nullptr); /** * Reimplemented from QAbstractListModel::roleNames() */ - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; void setUnit(Unit *unit); Unit * unit() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; /** * Count phrases in current model view. If this number is changed, signal * countChanged() is emitted. * * \return number of phrases */ int count() const; Q_SIGNALS: void phraseChanged(int index); void unitChanged(); void typeChanged(); void countChanged(); private Q_SLOTS: void onPhraseAboutToBeAdded(Phrase *unit, int index); void onPhraseAdded(); void onPhrasesAboutToBeRemoved(int first, int last); void onPhrasesRemoved(); void emitPhraseChanged(int row); private: void updateMappings(); Unit *m_unit; QSignalMapper *m_signalMapper; }; #endif diff --git a/src/models/phrasemodel.h b/src/models/phrasemodel.h index 8aeb7d4..5c9837a 100644 --- a/src/models/phrasemodel.h +++ b/src/models/phrasemodel.h @@ -1,85 +1,85 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PHRASEMODEL_H #define PHRASEMODEL_H #include #include "core/phrase.h" class Course; class QSignalMapper; class PhraseModel : public QAbstractItemModel { Q_OBJECT Q_PROPERTY(Course *course READ course WRITE setCourse NOTIFY courseChanged) public: enum phraseRoles { TextRole = Qt::UserRole + 1, IdRole, DataRole }; explicit PhraseModel(QObject *parent = nullptr); - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; void setCourse(Course *course); Course * course() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE; - virtual QModelIndex index(int row, int column, const QModelIndex &parent) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QModelIndex parent(const QModelIndex &child) const override; + virtual QModelIndex index(int row, int column, const QModelIndex &parent) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; Q_INVOKABLE bool isPhrase(const QModelIndex &index) const; Q_INVOKABLE Phrase * phrase(const QModelIndex &index) const; Q_INVOKABLE Unit * unit(const QModelIndex &index) const; Q_INVOKABLE QModelIndex indexPhrase(Phrase *phrase) const; Q_INVOKABLE QModelIndex indexUnit(Unit *unit) const; Q_INVOKABLE bool isUnit(const QModelIndex& index) const; Q_SIGNALS: void phraseChanged(int index); void courseChanged(); void typeChanged(); private Q_SLOTS: void onPhraseAboutToBeAdded(Phrase *phrase, int index); void onPhraseAdded(); void onPhrasesAboutToBeRemoved(int first, int last); void onPhrasesRemoved(); void onPhraseChanged(QObject *phrase); void onUnitAboutToBeAdded(Unit *unit, int index); void onUnitAdded(); void onUnitsAboutToBeRemoved(int first, int last); void onUnitsRemoved(); void onUnitChanged(int index); private: void updateUnitMappings(); void updatePhraseMappings(); Course *m_course; QSignalMapper *m_unitSignalMapper; QSignalMapper *m_phraseSignalMapper; }; #endif diff --git a/src/models/profilemodel.h b/src/models/profilemodel.h index 039da27..1464c3c 100644 --- a/src/models/profilemodel.h +++ b/src/models/profilemodel.h @@ -1,70 +1,70 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef PROFILEMODEL_H #define PROFILEMODEL_H #include namespace LearnerProfile { class Learner; class ProfileManager; } class QSignalMapper; class ProfileModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(LearnerProfile::ProfileManager *profileManager READ profileManager WRITE setProfileManager) public: enum profileRoles { NameRole = Qt::UserRole + 1, IdRole, DataRole }; explicit ProfileModel(QObject *parent = nullptr); /** * Reimplemented from QAbstractListModel::roleNames() */ - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; void setProfileManager(LearnerProfile::ProfileManager *profileManager); LearnerProfile::ProfileManager * profileManager() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; Q_SIGNALS: void profileChanged(int index); private Q_SLOTS: void onProfileAdded(LearnerProfile::Learner *learner, int index); void onProfileAboutToBeRemoved(int index); void emitProfileChanged(int row); private: void updateMappings(); LearnerProfile::ProfileManager *m_profileManager; QSignalMapper *m_signalMapper; }; #endif // PROFILEMODEL_H diff --git a/src/models/skeletonmodel.h b/src/models/skeletonmodel.h index d5a6648..1a1c45a 100644 --- a/src/models/skeletonmodel.h +++ b/src/models/skeletonmodel.h @@ -1,77 +1,77 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef SKELETONMODEL_H #define SKELETONMODEL_H #include class ResourceManager; class Course; class Skeleton; class Language; class QSignalMapper; class SkeletonModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(ResourceManager *resourceManager READ resourceManager WRITE setResourceManager NOTIFY resourceManagerChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) public: enum courseRoles { TitleRole = Qt::UserRole + 1, DescriptionRole, IdRole, DataRole }; explicit SkeletonModel(QObject *parent = nullptr); void setResourceManager(ResourceManager *resourceManager); /** * Reimplemented from QAbstractListModel::roleNames() */ - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; ResourceManager * resourceManager() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; int count() const; Q_INVOKABLE QVariant skeleton(int index) const; Q_SIGNALS: void skeletonChanged(int index); void resourceManagerChanged(); void countChanged(); private Q_SLOTS: void onSkeletonAboutToBeAdded(Course *skeleton, int index); void onSkeletonAdded(); void onSkeletonsAboutToBeRemoved(int first, int last); void onSkeletonsRemoved(); void emitSkeletonChanged(int row); private: void updateMappings(); ResourceManager *m_resourceManager; QSignalMapper *m_signalMapper; }; #endif // SKELETONMODEL_H diff --git a/src/models/unitfiltermodel.h b/src/models/unitfiltermodel.h index 1cd5ab8..86dc75f 100644 --- a/src/models/unitfiltermodel.h +++ b/src/models/unitfiltermodel.h @@ -1,53 +1,53 @@ /* * Copyright 2014-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef UNITFILTERMODEL_H #define UNITFILTERMODEL_H #include class UnitModel; class QSignalMapper; class UnitFilterModel : public QSortFilterProxyModel { Q_OBJECT Q_PROPERTY(UnitModel *unitModel READ unitModel WRITE setUnitModel NOTIFY unitModelChanged) Q_PROPERTY(int filteredCount READ filteredCount NOTIFY filteredCountChanged) public: explicit UnitFilterModel(QObject *parent = nullptr); UnitModel * unitModel() const; void setUnitModel(UnitModel* unitModel); int filteredCount() const; - virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; - virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const Q_DECL_OVERRIDE; + virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; + virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; Q_SIGNALS: void unitModelChanged(); void viewChanged(); void sortOptionChanged(); void filteredCountChanged(); private: UnitModel *m_unitModel; }; #endif diff --git a/src/models/unitmodel.h b/src/models/unitmodel.h index d14a2e2..52cfa3d 100644 --- a/src/models/unitmodel.h +++ b/src/models/unitmodel.h @@ -1,72 +1,72 @@ /* * Copyright 2013-2015 Andreas Cord-Landwehr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef UNITMODEL_H #define UNITMODEL_H #include class Course; class Unit; class QSignalMapper; class UnitModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(Course *course READ course WRITE setCourse NOTIFY courseChanged) public: enum unitRoles { TitleRole = Qt::UserRole + 1, //!< title of unit IdRole, //!< unique identifier of unit ContainsTrainingData, //!< boolean value indicating whether unit has phrase with native recordings DataRole //!< access to Unit object }; explicit UnitModel(QObject *parent = nullptr); /** * Reimplemented from QAbstractListModel::roleNames() */ - virtual QHash roleNames() const Q_DECL_OVERRIDE; + virtual QHash roleNames() const override; void setCourse(Course *course); Course * course() const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; Q_SIGNALS: void unitChanged(int index); void courseChanged(); private Q_SLOTS: void onUnitAboutToBeAdded(Unit *unit, int index); void onUnitAdded(); void onUnitsAboutToBeRemoved(int first, int last); void onUnitsRemoved(); void emitUnitChanged(int row); private: void updateMappings(); Course *m_course; QSignalMapper *m_signalMapper; }; #endif // UNITMODEL_H diff --git a/src/qmlcontrols/iconitem.h b/src/qmlcontrols/iconitem.h index 72e78a5..87ae139 100644 --- a/src/qmlcontrols/iconitem.h +++ b/src/qmlcontrols/iconitem.h @@ -1,82 +1,82 @@ /*************************************************************************** * Copyright 2011 Marco Martin * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #ifndef ICONITEM_H #define ICONITEM_H #include #include #include #include "artikulatecore_export.h" class ARTIKULATECORE_EXPORT IconItem : public QQuickItem { Q_OBJECT Q_PROPERTY(QVariant icon READ icon WRITE setIcon) Q_PROPERTY(bool smooth READ smooth WRITE setSmooth) Q_PROPERTY(int implicitWidth READ implicitWidth CONSTANT) Q_PROPERTY(int implicitHeight READ implicitHeight CONSTANT) Q_PROPERTY(State state READ state WRITE setState NOTIFY stateChanged) Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY stateChanged) Q_ENUMS(State) public: enum State { DefaultState, ///The default state. ActiveState, ///Icon is active. DisabledState ///Icon is disabled. }; explicit IconItem(QQuickItem *parent = nullptr); ~IconItem(); void setIcon(const QVariant &icon); QIcon icon() const; IconItem::State state() const; void setState(State state); int implicitWidth() const; int implicitHeight() const; void setSmooth(const bool smooth); bool smooth() const; void setEnabled(bool enabled = true); bool enabled() const; - QSGNode* updatePaintNode(QSGNode* node, UpdatePaintNodeData* data) Q_DECL_OVERRIDE; + QSGNode* updatePaintNode(QSGNode* node, UpdatePaintNodeData* data) override; Q_SIGNALS: void stateChanged(State state); protected: - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; private: QIcon m_icon; bool m_smooth; State m_state; bool m_changed; }; #endif