ewsconfigdialog.h 2.54 KB
Newer Older
1
/*
2
    Copyright (C) 2015-2018 Krzysztof Nowicki <krissn@op.pl>
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/

20
21
#ifndef EWSCONFIGDIALOG_H
#define EWSCONFIGDIALOG_H
22
23

#include <QDialog>
24
#include <QPointer>
25
26
27
28
29


class QDialogButtonBox;
class EwsResource;
class EwsClient;
Laurent Montel's avatar
Laurent Montel committed
30
class KConfigDialogManager;
31
32
33
34
35
36
37
namespace Ui
{
class SetupServerView;
}
class KJob;
class EwsAutodiscoveryJob;
class EwsGetFolderRequest;
38
class EwsProgressDialog;
39
class EwsSubscriptionWidget;
40
class EwsSettings;
41

42
class EwsConfigDialog : public QDialog
43
44
45
{
    Q_OBJECT
public:
46
47
    explicit EwsConfigDialog(EwsResource *parentResource, EwsClient &client, WId windowId,
                             EwsSettings *settings);
48
    ~EwsConfigDialog() override;
Laurent Montel's avatar
Laurent Montel committed
49
private:
50
51
52
53
54
55
56
57
58
59
60
    void save();
    void autoDiscoveryFinished(KJob *job);
    void tryConnectFinished(KJob *job);
    void performAutoDiscovery();
    void autoDiscoveryCancelled();
    void tryConnectCancelled();
    void setAutoDiscoveryNeeded();
    void dialogAccepted();
    void enableTryConnect();
    void tryConnect();
    void userAgentChanged(int index);
Laurent Montel's avatar
Laurent Montel committed
61

62
    QString fullUsername() const;
63
64
65
#ifdef HAVE_NETWORKAUTH
    void tokensRequestFinished(const QString &accessToken, const QString &refreshToken);
#endif
Laurent Montel's avatar
Laurent Montel committed
66
67
68
    EwsResource *mParentResource = nullptr;
    KConfigDialogManager *mConfigManager = nullptr;
    Ui::SetupServerView *mUi = nullptr;
69

Laurent Montel's avatar
Laurent Montel committed
70
71
72
    QDialogButtonBox *mButtonBox = nullptr;
    EwsAutodiscoveryJob *mAutoDiscoveryJob = nullptr;
    EwsGetFolderRequest *mTryConnectJob = nullptr;
73
    bool mTryConnectJobCancelled = false;
Laurent Montel's avatar
Laurent Montel committed
74
75
    bool mAutoDiscoveryNeeded = false;
    bool mTryConnectNeeded = false;
76
    EwsProgressDialog *mProgressDialog = nullptr;
Laurent Montel's avatar
Laurent Montel committed
77
    EwsSubscriptionWidget *mSubWidget = nullptr;
78
    QPointer<EwsSettings> mSettings;
79
80
81
82
#ifdef HAVE_NETWORKAUTH
    QString mAccessToken;
    QString mRefreshToken;
#endif
83
84
85
};

#endif