certmanager/lib
keyrequester.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #ifndef __KLEO_UI_KEYREQUESTER_H__
00050 #define __KLEO_UI_KEYREQUESTER_H__
00051
00052 #include <qwidget.h>
00053 #include <kleo/cryptobackend.h>
00054
00055 #include <vector>
00056 #include <kdepimmacros.h>
00057
00058 namespace Kleo {
00059 class KeyListView;
00060 class KeyListViewItem;
00061 }
00062
00063 namespace GpgME {
00064 class Key;
00065 class KeyListResult;
00066 }
00067
00068 class QStringList;
00069 class QString;
00070 class QPushButton;
00071 class QLabel;
00072
00073 namespace Kleo {
00074
00076 class KDE_EXPORT KeyRequester : public QWidget {
00077 Q_OBJECT
00078 public:
00079 KeyRequester( unsigned int allowedKeys, bool multipleKeys=false,
00080 QWidget * parent=0, const char * name=0 );
00081
00082 KeyRequester( QWidget * parent=0, const char * name=0 );
00083 ~KeyRequester();
00084
00085 const GpgME::Key & key() const;
00090 void setKey( const GpgME::Key & key );
00091
00092 const std::vector<GpgME::Key> & keys() const;
00096 void setKeys( const std::vector<GpgME::Key> & keys );
00097
00098 QString fingerprint() const;
00102 void setFingerprint( const QString & fingerprint );
00103
00104 QStringList fingerprints() const;
00108 void setFingerprints( const QStringList & fingerprints );
00109
00110
00111 QPushButton * eraseButton();
00112 QPushButton * dialogButton();
00113
00114 void setDialogCaption( const QString & caption );
00115 void setDialogMessage( const QString & message );
00116
00117 bool isMultipleKeysEnabled() const;
00118 void setMultipleKeysEnabled( bool enable );
00119
00120 unsigned int allowedKeys() const;
00121 void setAllowedKeys( unsigned int allowed );
00122
00123 void setInitialQuery( const QString & s ) { mInitialQuery = s; }
00124 const QString & initialQuery() const { return mInitialQuery; }
00125
00126 signals:
00127 void changed();
00128
00129 private:
00130 void init();
00131 void startKeyListJob( const QStringList & fingerprints );
00132 void updateKeys();
00133
00134 private slots:
00135 void slotNextKey( const GpgME::Key & key );
00136 void slotKeyListResult( const GpgME::KeyListResult & result );
00137 void slotDialogButtonClicked();
00138 void slotEraseButtonClicked();
00139
00140 private:
00141 const CryptoBackend::Protocol * mOpenPGPBackend;
00142 const CryptoBackend::Protocol * mSMIMEBackend;
00143 QLabel * mLabel;
00144 QPushButton * mEraseButton;
00145 QPushButton * mDialogButton;
00146 QString mDialogCaption, mDialogMessage, mInitialQuery;
00147 bool mMulti;
00148 unsigned int mKeyUsage;
00149 int mJobs;
00150 std::vector<GpgME::Key> mKeys;
00151 std::vector<GpgME::Key> mTmpKeys;
00152
00153 private:
00154 class Private;
00155 Private * d;
00156 protected:
00157 virtual void virtual_hook( int, void* );
00158 };
00159
00160
00161 class KDE_EXPORT EncryptionKeyRequester : public KeyRequester {
00162 Q_OBJECT
00163 public:
00164 enum { OpenPGP = 1, SMIME = 2, AllProtocols = OpenPGP|SMIME };
00165
00169 EncryptionKeyRequester( bool multipleKeys=false, unsigned int proto=AllProtocols,
00170 QWidget * parent=0, const char * name=0,
00171 bool onlyTrusted=true, bool onlyValid=true );
00175 EncryptionKeyRequester( QWidget * parent=0, const char * name=0 );
00176 ~EncryptionKeyRequester();
00177
00178 void setAllowedKeys( unsigned int proto, bool onlyTrusted=true, bool onlyValid=true );
00179
00180 private:
00181 class Private;
00182 Private * d;
00183 protected:
00184 virtual void virtual_hook( int, void* );
00185 };
00186
00187
00188 class KDE_EXPORT SigningKeyRequester : public KeyRequester {
00189 Q_OBJECT
00190 public:
00191 enum { OpenPGP = 1, SMIME = 2, AllProtocols = OpenPGP|SMIME };
00192
00201 SigningKeyRequester( bool multipleKeys=false, unsigned int proto=AllProtocols,
00202 QWidget * parent=0, const char * name=0,
00203 bool onlyTrusted=true, bool onlyValid=true );
00207 SigningKeyRequester( QWidget * parent=0, const char * name=0 );
00208 ~SigningKeyRequester();
00209
00210
00211
00212
00213
00214
00215
00216 void setAllowedKeys( unsigned int proto, bool onlyTrusted=true, bool onlyValid=true );
00217
00218 private:
00219 class Private;
00220 Private * d;
00221 protected:
00222 virtual void virtual_hook( int, void* );
00223 };
00224
00225 }
00226
00227 #endif // __KLEO_UI_KEYREQUESTER_H__
|