Libkleo

cryptoconfigmodule.h
1 /*
2  cryptoconfigmodule.h
3 
4  This file is part of libkleopatra
5  SPDX-FileCopyrightText: 2004, 2005 Klarälvdalens Datakonsult AB
6 
7  SPDX-License-Identifier: GPL-2.0-or-later
8 */
9 
10 #pragma once
11 
12 #include "kleo_export.h"
13 
14 #include <KPageWidget>
15 
16 #include <QList>
17 
18 namespace QGpgME
19 {
20 class CryptoConfig;
21 } // namespace QGpgME
22 
23 namespace Kleo
24 {
25 class CryptoConfigComponentGUI;
26 
27 /**
28  * Crypto Config Module widget, dynamically generated from CryptoConfig
29  * It's a simple QWidget so that it can be embedded into a dialog or into a KCModule.
30  */
31 class KLEO_EXPORT CryptoConfigModule : public KPageWidget
32 {
33  Q_OBJECT
34 public:
35  enum Layout { TabbedLayout, IconListLayout, LinearizedLayout };
36  explicit CryptoConfigModule(QGpgME::CryptoConfig *config, QWidget *parent = nullptr);
37  explicit CryptoConfigModule(QGpgME::CryptoConfig *config, Layout layout, QWidget *parent = nullptr);
38 
39  bool hasError() const;
40 
41  void save();
42  void reset(); // i.e. reload current settings, discarding user input
43  void defaults();
44  void cancel();
45 
46 Q_SIGNALS:
47  void changed();
48 
49 private:
50  void init(Layout layout);
51  static QStringList sortComponentList(const QStringList &components);
52 
53 public:
54  static QStringList sortGroupList(const QString &moduleName, const QStringList &groups);
55 
56 private:
57  QGpgME::CryptoConfig *mConfig = nullptr;
58  QList<CryptoConfigComponentGUI *> mComponentGUIs;
59 };
60 
61 }
Crypto Config Module widget, dynamically generated from CryptoConfig It's a simple QWidget so that it...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:56:14 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.