• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

libkleo

  • sources
  • kde-4.12
  • kdepim
  • libkleo
  • ui
keyrequester.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  keyrequester.h
3 
4  This file is part of libkleopatra, the KDE keymanagement library
5  Copyright (c) 2004 Klarälvdalens Datakonsult AB
6 
7  Libkleopatra is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of the
10  License, or (at your option) any later version.
11 
12  Libkleopatra is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the Qt library by Trolltech AS, Norway (or with modified versions
24  of Qt that use the same license as Qt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  Qt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 
32 
33  Based on kpgpui.h
34  Copyright (C) 2001,2002 the KPGP authors
35  See file libkdenetwork/AUTHORS.kpgp for details
36 
37  This file is part of KPGP, the KDE PGP/GnuPG support library.
38 
39  KPGP is free software; you can redistribute it and/or modify
40  it under the terms of the GNU General Public License as published by
41  the Free Software Foundation; either version 2 of the License, or
42  (at your option) any later version.
43 
44  You should have received a copy of the GNU General Public License
45  along with this program; if not, write to the Free Software Foundation,
46  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
47  */
48 
49 #ifndef __KLEO_UI_KEYREQUESTER_H__
50 #define __KLEO_UI_KEYREQUESTER_H__
51 
52 #include "kleo/kleo_export.h"
53 #include "kleo/cryptobackend.h"
54 
55 #include <QWidget>
56 #include <QLabel>
57 
58 #include <vector>
59 
60 
61 namespace GpgME {
62  class Key;
63  class KeyListResult;
64 }
65 
66 class QStringList;
67 class QString;
68 class QPushButton;
69 class QLabel;
70 
71 namespace Kleo {
72 
74  class KLEO_EXPORT KeyRequester : public QWidget {
75  Q_OBJECT
76  public:
77  explicit KeyRequester( unsigned int allowedKeys, bool multipleKeys=false,
78  QWidget * parent=0 );
79  // Constructor for Qt Designer
80  explicit KeyRequester( QWidget * parent=0 );
81  ~KeyRequester();
82 
83  const GpgME::Key & key() const;
88  void setKey( const GpgME::Key & key );
89 
90  const std::vector<GpgME::Key> & keys() const;
94  void setKeys( const std::vector<GpgME::Key> & keys );
95 
96  QString fingerprint() const;
100  void setFingerprint( const QString & fingerprint );
101 
102  QStringList fingerprints() const;
106  void setFingerprints( const QStringList & fingerprints );
107 
108 
109  QPushButton * eraseButton();
110  QPushButton * dialogButton();
111 
112  void setDialogCaption( const QString & caption );
113  void setDialogMessage( const QString & message );
114 
115  bool isMultipleKeysEnabled() const;
116  void setMultipleKeysEnabled( bool enable );
117 
118  unsigned int allowedKeys() const;
119  void setAllowedKeys( unsigned int allowed );
120 
121  void setInitialQuery( const QString & s ) { mInitialQuery = s; }
122  const QString & initialQuery() const { return mInitialQuery; }
123 
124  Q_SIGNALS:
125  void changed();
126 
127  private:
128  void init();
129  void startKeyListJob( const QStringList & fingerprints );
130  void updateKeys();
131 
132  private Q_SLOTS:
133  void slotNextKey( const GpgME::Key & key );
134  void slotKeyListResult( const GpgME::KeyListResult & result );
135  void slotDialogButtonClicked();
136  void slotEraseButtonClicked();
137 
138  private:
139  const CryptoBackend::Protocol * mOpenPGPBackend;
140  const CryptoBackend::Protocol * mSMIMEBackend;
141  QLabel * mLabel;
142  QPushButton * mEraseButton;
143  QPushButton * mDialogButton;
144  QString mDialogCaption, mDialogMessage, mInitialQuery;
145  bool mMulti;
146  unsigned int mKeyUsage;
147  int mJobs;
148  std::vector<GpgME::Key> mKeys;
149  std::vector<GpgME::Key> mTmpKeys;
150 
151  private:
152  class Private;
153  Private *const d;
154  protected:
155  virtual void virtual_hook( int, void* );
156  };
157 
158 
159  class KLEO_EXPORT EncryptionKeyRequester : public KeyRequester {
160  Q_OBJECT
161  public:
162  enum { OpenPGP = 1, SMIME = 2, AllProtocols = OpenPGP|SMIME };
163 
167  explicit EncryptionKeyRequester( bool multipleKeys=false,
168  unsigned int proto=AllProtocols,
169  QWidget * parent=0,
170  bool onlyTrusted=true,
171  bool onlyValid=true );
175  explicit EncryptionKeyRequester( QWidget * parent );
176  ~EncryptionKeyRequester();
177 
178  void setAllowedKeys( unsigned int proto, bool onlyTrusted=true, bool onlyValid=true );
179 
180  private:
181  class Private;
182  Private *const d;
183  protected:
184  virtual void virtual_hook( int, void* );
185  };
186 
187 
188  class KLEO_EXPORT SigningKeyRequester : public KeyRequester {
189  Q_OBJECT
190  public:
191  enum { OpenPGP = 1, SMIME = 2, AllProtocols = OpenPGP|SMIME };
192 
201  explicit SigningKeyRequester( bool multipleKeys=false,
202  unsigned int proto=AllProtocols,
203  QWidget * parent=0,
204  bool onlyTrusted=true, bool onlyValid=true );
208  explicit SigningKeyRequester( QWidget * parent );
209  ~SigningKeyRequester();
210 
211  /*
212  * Those parameters affect the parameters given to the key selection dialog.
213  * @param proto the allowed protocols, OpenPGP and/or SMIME
214  * @param onlyTrusted only show trusted keys
215  * @param onlyValid only show valid keys
216  */
217  void setAllowedKeys( unsigned int proto, bool onlyTrusted=true, bool onlyValid=true );
218 
219  private:
220  class Private;
221  Private *const d;
222  protected:
223  virtual void virtual_hook( int, void* );
224  };
225 
226 }
227 
228 #endif // __KLEO_UI_KEYREQUESTER_H__
QWidget
Kleo::EncryptionKeyRequester
Definition: keyrequester.h:159
QString
cryptobackend.h
Kleo::KeyRequester::setInitialQuery
void setInitialQuery(const QString &s)
Definition: keyrequester.h:121
KLEO_EXPORT
#define KLEO_EXPORT
Definition: kleo_export.h:41
Kleo::KeyRequester::initialQuery
const QString & initialQuery() const
Definition: keyrequester.h:122
Kleo::KeyRequester
Base class for SigningKeyRequester and EncryptionKeyRequester.
Definition: keyrequester.h:74
kleo_export.h
Kleo::CryptoBackend::Protocol
Definition: cryptobackend.h:99
Kleo::SigningKeyRequester
Definition: keyrequester.h:188
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:57:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkleo

Skip menu "libkleo"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal