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 <tqwidget.h>
00053 #include <kleo/cryptobackend.h>
00054
00055 #include <vector>
00056 #include <tdepimmacros.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 TQStringList;
00069 class TQString;
00070 class TQPushButton;
00071 class TQLabel;
00072
00073 namespace Kleo {
00074
00076 class KDE_EXPORT KeyRequester : public TQWidget {
00077 Q_OBJECT
00078
00079 public:
00080 KeyRequester( unsigned int allowedKeys, bool multipleKeys=false,
00081 TQWidget * parent=0, const char * name=0 );
00082
00083 KeyRequester( TQWidget * parent=0, const char * name=0 );
00084 ~KeyRequester();
00085
00086 const GpgME::Key & key() const;
00091 void setKey( const GpgME::Key & key );
00092
00093 const std::vector<GpgME::Key> & keys() const;
00097 void setKeys( const std::vector<GpgME::Key> & keys );
00098
00099 TQString fingerprint() const;
00103 void setFingerprint( const TQString & fingerprint );
00104
00105 TQStringList fingerprints() const;
00109 void setFingerprints( const TQStringList & fingerprints );
00110
00111
00112 TQPushButton * eraseButton();
00113 TQPushButton * dialogButton();
00114
00115 void setDialogCaption( const TQString & caption );
00116 void setDialogMessage( const TQString & message );
00117
00118 bool isMultipleKeysEnabled() const;
00119 void setMultipleKeysEnabled( bool enable );
00120
00121 unsigned int allowedKeys() const;
00122 void setAllowedKeys( unsigned int allowed );
00123
00124 void setInitialQuery( const TQString & s ) { mInitialQuery = s; }
00125 const TQString & initialQuery() const { return mInitialQuery; }
00126
00127 signals:
00128 void changed();
00129
00130 private:
00131 void init();
00132 void startKeyListJob( const TQStringList & fingerprints );
00133 void updateKeys();
00134
00135 private slots:
00136 void slotNextKey( const GpgME::Key & key );
00137 void slotKeyListResult( const GpgME::KeyListResult & result );
00138 void slotDialogButtonClicked();
00139 void slotEraseButtonClicked();
00140
00141 private:
00142 const CryptoBackend::Protocol * mOpenPGPBackend;
00143 const CryptoBackend::Protocol * mSMIMEBackend;
00144 TQLabel * mLabel;
00145 TQPushButton * mEraseButton;
00146 TQPushButton * mDialogButton;
00147 TQString mDialogCaption, mDialogMessage, mInitialQuery;
00148 bool mMulti;
00149 unsigned int mKeyUsage;
00150 int mJobs;
00151 std::vector<GpgME::Key> mKeys;
00152 std::vector<GpgME::Key> mTmpKeys;
00153
00154 private:
00155 class Private;
00156 Private * d;
00157 protected:
00158 virtual void virtual_hook( int, void* );
00159 };
00160
00161
00162 class KDE_EXPORT EncryptionKeyRequester : public KeyRequester {
00163 Q_OBJECT
00164
00165 public:
00166 enum { OpenPGP = 1, SMIME = 2, AllProtocols = OpenPGP|SMIME };
00167
00171 EncryptionKeyRequester( bool multipleKeys=false, unsigned int proto=AllProtocols,
00172 TQWidget * parent=0, const char * name=0,
00173 bool onlyTrusted=true, bool onlyValid=true );
00177 EncryptionKeyRequester( TQWidget * parent=0, const char * name=0 );
00178 ~EncryptionKeyRequester();
00179
00180 void setAllowedKeys( unsigned int proto, bool onlyTrusted=true, bool onlyValid=true );
00181
00182 private:
00183 class Private;
00184 Private * d;
00185 protected:
00186 virtual void virtual_hook( int, void* );
00187 };
00188
00189
00190 class KDE_EXPORT SigningKeyRequester : public KeyRequester {
00191 Q_OBJECT
00192
00193 public:
00194 enum { OpenPGP = 1, SMIME = 2, AllProtocols = OpenPGP|SMIME };
00195
00204 SigningKeyRequester( bool multipleKeys=false, unsigned int proto=AllProtocols,
00205 TQWidget * parent=0, const char * name=0,
00206 bool onlyTrusted=true, bool onlyValid=true );
00210 SigningKeyRequester( TQWidget * parent=0, const char * name=0 );
00211 ~SigningKeyRequester();
00212
00213
00214
00215
00216
00217
00218
00219 void setAllowedKeys( unsigned int proto, bool onlyTrusted=true, bool onlyValid=true );
00220
00221 private:
00222 class Private;
00223 Private * d;
00224 protected:
00225 virtual void virtual_hook( int, void* );
00226 };
00227
00228 }
00229
00230 #endif // __KLEO_UI_KEYREQUESTER_H__
|