File indexing completed on 2024-05-19 15:57:53

0001 /*
0002  *  SPDX-FileCopyrightText: 2020 Dan Leinir Turthra Jensen <admin@leinir.dk>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef ACCOUNTSERVICETOGGLE_H
0008 #define ACCOUNTSERVICETOGGLE_H
0009 
0010 #include "kaccounts_export.h"
0011 
0012 #include <kjob.h>
0013 
0014 #include <QStringList>
0015 
0016 namespace KAccounts
0017 {
0018 
0019 /**
0020  * @brief A job used to change the enabled state of a specific service on a specific account
0021  */
0022 class KACCOUNTS_EXPORT AccountServiceToggleJob : public KJob
0023 {
0024     Q_OBJECT
0025     Q_PROPERTY(QString accountId READ accountId WRITE setAccountId NOTIFY accountIdChanged)
0026     Q_PROPERTY(QString serviceId READ serviceId WRITE setServiceId NOTIFY serviceIdChanged)
0027     Q_PROPERTY(bool serviceEnabled READ serviceEnabled WRITE setServiceEnabled NOTIFY serviceEnabledChanged)
0028 public:
0029     explicit AccountServiceToggleJob(QObject *parent = nullptr);
0030     ~AccountServiceToggleJob() override;
0031 
0032     void start() override;
0033 
0034     QString accountId() const;
0035     void setAccountId(const QString &accountId);
0036     Q_SIGNAL void accountIdChanged();
0037 
0038     QString serviceId() const;
0039     void setServiceId(const QString &serviceId);
0040     Q_SIGNAL void serviceIdChanged();
0041 
0042     bool serviceEnabled() const;
0043     void setServiceEnabled(bool serviceEnabled);
0044 
0045 Q_SIGNALS:
0046     void serviceEnabledChanged();
0047 
0048 private:
0049     class Private;
0050     Private *d;
0051 };
0052 
0053 };
0054 
0055 #endif // ACCOUNTSERVICETOGGLE_H