/
erhoof
/
telegraf
Обзор
Документация
Войти
/
erhoof
/
telegraf
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/data/stickermanager.h
46 строк
1 KB
mbarashkov
Рефакторино части зависимостей qml
04 июн 2025, 13:53
04 июн 2025, 13:53
c8e186b
Код
Авторство
О чём код?
#pragma once #include <QObject> #include <QVariantMap> #include <QVariantList> #include "../tdlib/tdlibresponsehandler.h" class StickerManager : public QObject { Q_OBJECT public: static QObject* getSingleton(QQmlEngine*, QJSEngine*) { return instance; } explicit StickerManager(QObject *parent = nullptr); Q_INVOKABLE QVariantList getRecentStickers(); Q_INVOKABLE QVariantList getInstalledStickerSets(); Q_INVOKABLE QVariantMap getStickerSet(const QString &stickerSetId); Q_INVOKABLE bool hasStickerSet(const QString &stickerSetId); Q_INVOKABLE bool isStickerSetInstalled(const QString &stickerSetId); Q_INVOKABLE bool needsReload(); Q_INVOKABLE void setNeedsReload(const bool &reloadNeeded); signals: void stickerSetsReceived(); private slots: void handleRecentStickersUpdated(const QVariantList &stickerIds); void handleStickersReceived(const QVariantList &stickers); void handleInstalledStickerSetsUpdated(const QVariantList &stickerSetIds); void handleStickerSetsReceived(const QVariantList &stickerSets); void handleStickerSetReceived(const QVariantMap &stickerSet); private: QVariantList recentStickers; QVariantList recentStickerIds; QVariantList installedStickerSets; QVariantList installedStickerSetIds; QVariantMap stickers; QVariantMap stickerSets; QVariantMap stickerSetMap; bool reloadNeeded; static StickerManager* instance; };