findaccountinfojob.h 1.5 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
3
4
5
6
7
8
9
/*
   SPDX-FileCopyrightText: 2020 Laurent Montel <montel@kde.org>

   SPDX-License-Identifier: GPL-2.0-or-later
*/

#ifndef FINDACCOUNTINFOJOB_H
#define FINDACCOUNTINFOJOB_H

10
#include "util_p.h"
Laurent Montel's avatar
Laurent Montel committed
11
#include "ksieveui_export.h" //TODO use specific export for testing ?
12

Laurent Montel's avatar
Laurent Montel committed
13
14
#include <QObject>
namespace KSieveUi {
15
class SieveImapPasswordProvider;
Laurent Montel's avatar
Laurent Montel committed
16
class KSIEVEUI_EXPORT FindAccountInfoJob : public QObject
Laurent Montel's avatar
Laurent Montel committed
17
18
19
{
    Q_OBJECT
public:
Laurent Montel's avatar
Laurent Montel committed
20
21
    explicit FindAccountInfoJob(QObject *parent = nullptr);
    ~FindAccountInfoJob() override;
Laurent Montel's avatar
Laurent Montel committed
22
23

    void start();
24
25
26
27

    Q_REQUIRED_RESULT QString identifier() const;
    void setIdentifier(const QString &newIdentifier);

28
    Q_REQUIRED_RESULT bool withVacationFileName() const;
29
30
31
32
33
    void setWithVacationFileName(bool newWithVacationFileName);

    SieveImapPasswordProvider *provider() const;
    void setProvider(SieveImapPasswordProvider *newProvider);

34
35
    Q_REQUIRED_RESULT bool canStart() const;

Laurent Montel's avatar
Laurent Montel committed
36
37
    void setCustomImapSettingsInterface(KSieveUi::AbstractAkonadiImapSettingInterface *newCustomImapSettingsInterface);

38
39
40
Q_SIGNALS:
    void findAccountInfoFinished(const KSieveUi::Util::AccountInfo &info);

41
private:
42
    void passwordDone(const QString &pwd, const QString &server);
Laurent Montel's avatar
Laurent Montel committed
43
44
    void sendAccountInfo();
    KSieveUi::Util::AccountInfo mAccountInfo;
45
    QString mIdentifier;
Laurent Montel's avatar
Laurent Montel committed
46
    KSieveUi::AbstractAkonadiImapSettingInterface *mCustomImapSettingsInterface = nullptr;
Laurent Montel's avatar
Laurent Montel committed
47
    SieveImapPasswordProvider *mPasswordProvider = nullptr;
Laurent Montel's avatar
Laurent Montel committed
48
    bool mWithVacationFileName = true;
Laurent Montel's avatar
Laurent Montel committed
49
50
51
52
};
}

#endif // FINDACCOUNTINFOJOB_H