dirservconfigpage.h 2.04 KB
Newer Older
1
2
/* -*- mode: c++; c-basic-offset:4 -*-
    conf/dirservconfigpage.h
3

4
    This file is part of Kleopatra, the KDE keymanager
5
    SPDX-FileCopyrightText: 2004, 2008 Klarälvdalens Datakonsult AB
6

7
    SPDX-License-Identifier: GPL-2.0-or-later
8
9
*/

10
#pragma once
Urs Wolfer's avatar
Urs Wolfer committed
11

12
#include <KCModule>
Urs Wolfer's avatar
Urs Wolfer committed
13

14
#include <QGpgME/CryptoConfig>
15
16

class QCheckBox;
17
class QLabel;
18
class QLineEdit;
Laurent Montel's avatar
Laurent Montel committed
19
class QTimeEdit;
Laurent Montel's avatar
Laurent Montel committed
20
class QSpinBox;
Laurent Montel's avatar
Laurent Montel committed
21
22
23
namespace Kleo
{
class DirectoryServicesWidget;
24
25
26
27
28
29
30
}

/**
 * "Directory Services" configuration page for kleopatra's configuration dialog
 * The user can configure LDAP servers in this page, to be used for listing/fetching
 * remote certificates in kleopatra.
 */
Laurent Montel's avatar
Laurent Montel committed
31
32
33
class DirectoryServicesConfigurationPage : public KCModule
{
    Q_OBJECT
34
public:
Laurent Montel's avatar
Laurent Montel committed
35
    explicit DirectoryServicesConfigurationPage(QWidget *parent = nullptr, const QVariantList &args = QVariantList());
36

37
38
39
    void load() override;
    void save() override;
    void defaults() override;
40
41

private:
42
43
44
45
46
47
48
49
50
    enum EntryMultiplicity {
        SingleValue,
        ListValue
    };
    enum ShowError {
        DoNotShowError,
        DoShowError
    };

51
52
53
    QGpgME::CryptoConfigEntry *configEntry(const char *componentName,
                                           const char *entryName,
                                           QGpgME::CryptoConfigEntry::ArgType argType,
54
55
                                           EntryMultiplicity multiplicity,
                                           ShowError showError);
Laurent Montel's avatar
Laurent Montel committed
56

57
private:
58
    QLineEdit *mOpenPGPKeyserverEdit = nullptr;
59
60
61
62
63
    Kleo::DirectoryServicesWidget *mWidget = nullptr;
    QTimeEdit *mTimeout = nullptr;
    QSpinBox *mMaxItems = nullptr;
    QLabel *mMaxItemsLabel = nullptr;
    QCheckBox *mAddNewServersCB = nullptr;
Laurent Montel's avatar
Laurent Montel committed
64

65
66
67
68
69
    QGpgME::CryptoConfigEntry *mX509ServicesEntry = nullptr;
    QGpgME::CryptoConfigEntry *mOpenPGPServiceEntry = nullptr;
    QGpgME::CryptoConfigEntry *mTimeoutConfigEntry = nullptr;
    QGpgME::CryptoConfigEntry *mMaxItemsConfigEntry = nullptr;
    QGpgME::CryptoConfigEntry *mAddNewServersConfigEntry = nullptr;
Laurent Montel's avatar
Laurent Montel committed
70

71
    QGpgME::CryptoConfig *mConfig = nullptr;
72
};