File indexing completed on 2024-04-21 12:28:34

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "customsoundinfo.h"
0010 #include "libruqolacore_export.h"
0011 #include <QObject>
0012 
0013 class LIBRUQOLACORE_EXPORT CustomSoundsManager : public QObject
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit CustomSoundsManager(QObject *parent = nullptr);
0018     ~CustomSoundsManager() override;
0019 
0020     [[nodiscard]] const QVector<CustomSoundInfo> &customSoundsInfo() const;
0021     void setCustomSoundsInfo(const QVector<CustomSoundInfo> &newCustomSoundsInfo);
0022 
0023     void parseCustomSounds(const QJsonArray &obj);
0024 
0025     void deleteCustomSounds(const QJsonArray &replyArray);
0026 
0027     void updateCustomSounds(const QJsonArray &replyArray);
0028 
0029     void initializeDefaultSounds();
0030 Q_SIGNALS:
0031     void customSoundRemoved(const QString &identifier);
0032     void customSoundAdded(const QString &identifier);
0033     void customSoundUpdated(const QString &identifier);
0034 
0035 private:
0036     QVector<CustomSoundInfo> mCustomSoundsInfo;
0037 };