File indexing completed on 2024-12-01 13:08:21

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 CHANGEACCOUNTDISPLAYNAMEJOB_H
0008 #define CHANGEACCOUNTDISPLAYNAMEJOB_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 human-readable name of a specified account
0021  *
0022  * This job will refuse to change the name to something empty (while it is technically
0023  * possible to do so for an account, it is highly undesirable)
0024  */
0025 class KACCOUNTS_EXPORT ChangeAccountDisplayNameJob : public KJob
0026 {
0027     Q_OBJECT
0028     Q_PROPERTY(QString accountId READ accountId WRITE setAccountId NOTIFY accountIdChanged)
0029     Q_PROPERTY(QString displayName READ displayName WRITE setDisplayName NOTIFY displayNameChanged)
0030 public:
0031     explicit ChangeAccountDisplayNameJob(QObject *parent = nullptr);
0032     ~ChangeAccountDisplayNameJob() override;
0033 
0034     void start() override;
0035 
0036     QString accountId() const;
0037     void setAccountId(const QString &accountId);
0038     Q_SIGNAL void accountIdChanged();
0039 
0040     QString displayName() const;
0041     void setDisplayName(const QString &displayName);
0042     Q_SIGNAL void displayNameChanged();
0043 
0044 private:
0045     class Private;
0046     Private *d;
0047 };
0048 
0049 };
0050 
0051 #endif // CHANGEACCOUNTDISPLAYNAMEJOB_H