1 /*
2    SPDX-FileCopyrightText: 2020-2021 Laurent Montel <montel@kde.org>
3 
4    SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "libsieveeditor_export.h"
10 #include <QObject>
11 namespace QKeychain
12 {
13 class Job;
14 }
15 class LIBSIEVEEDITOR_EXPORT SieveEditorSavePasswordJob : public QObject
16 {
17     Q_OBJECT
18 public:
19     explicit SieveEditorSavePasswordJob(QObject *parent = nullptr);
20     ~SieveEditorSavePasswordJob() override;
21 
22     Q_REQUIRED_RESULT bool canStart() const;
23 
24     void start();
25 
26     Q_REQUIRED_RESULT QString password() const;
27     void setPassword(const QString &password);
28 
29     Q_REQUIRED_RESULT QString key() const;
30     void setKey(const QString &key);
31 
32     Q_REQUIRED_RESULT QString name() const;
33     void setName(const QString &name);
34 
35 private:
36     void slotPasswordWritten(QKeychain::Job *baseJob);
37     QString mPassword;
38     QString mKey;
39     QString mName;
40 };
41 
42