accountdialog.h 2.67 KB
Newer Older
1
/*
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
2
 *   Copyright (C) 2000 Espen Sand, espen@kde.org
3
 *   Copyright 2009 Thomas McGuire <mcguire@kde.org>
4
5
 *   Copyright (c) 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
 *   Copyright (C) 2010 Casey Link <unnamedrambler@gmail.com>
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program 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 General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

#ifndef _ACCOUNT_DIALOG_H_
#define _ACCOUNT_DIALOG_H_

#include "ui_popsettings.h"

Laurent Montel's avatar
Laurent Montel committed
28
29
namespace MailTransport
{
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
30
31
class ServerTest;
}
Laurent Montel's avatar
Laurent Montel committed
32
33
34
namespace KWallet
{
class Wallet;
Volker Krause's avatar
Volker Krause committed
35
}
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
36

37
class POP3Resource;
38
class KJob;
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
39

Laurent Montel's avatar
Laurent Montel committed
40
class AccountDialog : public QDialog, private Ui::PopPage
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
41
{
Laurent Montel's avatar
Laurent Montel committed
42
    Q_OBJECT
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
43

Laurent Montel's avatar
Laurent Montel committed
44
45
public:
    AccountDialog(POP3Resource *parentResource, WId parentWindow);
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
46
47
    virtual ~AccountDialog();

Laurent Montel's avatar
Laurent Montel committed
48
private Q_SLOTS:
Laurent Montel's avatar
Laurent Montel committed
49
    void slotEnablePopInterval(bool state);
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
50
    void slotLeaveOnServerClicked();
Laurent Montel's avatar
Laurent Montel committed
51
52
53
    void slotEnableLeaveOnServerDays(bool state);
    void slotEnableLeaveOnServerCount(bool state);
    void slotEnableLeaveOnServerSize(bool state);
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
54
55
56
57
    void slotFilterOnServerClicked();
    void slotPipeliningClicked();
    void slotPopEncryptionChanged(int);
    void slotCheckPopCapabilities();
58
    void slotPopCapabilities(const QVector<int> &);
Laurent Montel's avatar
Laurent Montel committed
59
60
61
    void slotLeaveOnServerDaysChanged(int value);
    void slotLeaveOnServerCountChanged(int value);
    void slotFilterOnServerSizeChanged(int value);
62

Laurent Montel's avatar
Laurent Montel committed
63
64
65
66
    void targetCollectionReceived(Akonadi::Collection::List collections);
    void localFolderRequestJobFinished(KJob *job);
    void walletOpenedForLoading(bool success);
    void walletOpenedForSaving(bool success);
Laurent Montel's avatar
Laurent Montel committed
67
    void slotAccepted();
Laurent Montel's avatar
Laurent Montel committed
68
private:
69
70
    void setupWidgets();
    void loadSettings();
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
71
    void saveSettings();
Laurent Montel's avatar
Laurent Montel committed
72
    void checkHighest(QButtonGroup *);
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
73
    void enablePopFeatures();
74
    void populateDefaultAuthenticationOptions();
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
75

Laurent Montel's avatar
Laurent Montel committed
76
private:
77
78
    POP3Resource *mParentResource;
    QButtonGroup *encryptionButtonGroup;
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
79
    MailTransport::ServerTest *mServerTest;
80
    QRegExpValidator mValidator;
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
81
    bool mServerTestFailed;
Volker Krause's avatar
Volker Krause committed
82
83
    KWallet::Wallet *mWallet;
    QString mInitalPassword;
Laurent Montel's avatar
Laurent Montel committed
84
    QPushButton *mOkButton;
Igor Trindade Oliveira's avatar
Igor Trindade Oliveira committed
85
86
87
};

#endif