keyselectiondialog.h
00001
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 #ifndef __KLEO_UI_KEYSELECTIONDIALOG_H__
00038 #define __KLEO_UI_KEYSELECTIONDIALOG_H__
00039
00040 #include <kdialogbase.h>
00041
00042 #include <kleo/cryptobackend.h>
00043 #include <gpgmepp/key.h>
00044
00045 #include <vector>
00046
00047 class QCheckBox;
00048 class QPixmap;
00049 class QTimer;
00050 class QListViewItem;
00051 class QRegExp;
00052 class QPoint;
00053
00054 namespace Kleo {
00055 class KeyListView;
00056 class KeyListViewItem;
00057 }
00058
00059 namespace GpgME {
00060 class KeyListResult;
00061 }
00062
00063 namespace Kleo {
00064
00065 class KeySelectionDialog : public KDialogBase {
00066 Q_OBJECT
00067 public:
00068
00069 enum KeyUsage {
00070 PublicKeys = 1,
00071 SecretKeys = 2,
00072 EncryptionKeys = 4,
00073 SigningKeys = 8,
00074 ValidKeys = 16,
00075 TrustedKeys = 32,
00076 CertificationKeys = 64,
00077 AuthenticationKeys = 128,
00078 OpenPGPKeys = 256,
00079 SMIMEKeys = 512,
00080 AllKeys = PublicKeys | SecretKeys | OpenPGPKeys | SMIMEKeys,
00081 ValidTrustedEncryptionKeys = AllKeys | EncryptionKeys | ValidKeys | TrustedKeys
00082 };
00083
00084 KeySelectionDialog( const QString & title,
00085 const QString & text,
00086 const std::vector<GpgME::Key> & selectedKeys=std::vector<GpgME::Key>(),
00087 unsigned int keyUsage=AllKeys,
00088 bool extendedSelection=false,
00089 bool rememberChoice=false,
00090 QWidget * parent=0, const char * name=0,
00091 bool modal=true );
00092 KeySelectionDialog( const QString & title,
00093 const QString & text,
00094 const QString & initialPattern,
00095 unsigned int keyUsage=AllKeys,
00096 bool extendedSelection=false,
00097 bool rememberChoice=false,
00098 QWidget * parent=0, const char * name=0,
00099 bool modal=true );
00100 ~KeySelectionDialog();
00101
00104 const GpgME::Key & selectedKey() const;
00105
00106 QString fingerprint() const;
00107
00109 const std::vector<GpgME::Key> & selectedKeys() const { return mSelectedKeys; }
00110
00112 QStringList fingerprints() const;
00113
00115 QStringList pgpKeyFingerprints() const;
00117 QStringList smimeFingerprints() const;
00118
00119 bool rememberSelection() const;
00120 protected slots:
00121
00122
00123 void slotHelp();
00124
00125 private slots:
00126 void slotRereadKeys();
00127 void slotStartCertificateManager();
00128 void slotKeyListResult( const GpgME::KeyListResult & );
00129 void slotSelectionChanged();
00130 void slotCheckSelection() { slotCheckSelection( 0 ); }
00131 void slotCheckSelection( Kleo::KeyListViewItem * );
00132 void slotRMB( Kleo::KeyListViewItem *, const QPoint & );
00133 void slotRecheckKey();
00134 void slotTryOk();
00135 void slotOk();
00136 void slotCancel();
00137 void slotSearch( const QString & text );
00138 void slotSearch();
00139 void slotFilter();
00140
00141 private:
00142 void filterByKeyID( const QString & keyID );
00143 void filterByKeyIDOrUID( const QString & keyID );
00144 void filterByUID( const QString & uid );
00145 void showAllItems();
00146 bool anyChildMatches( const Kleo::KeyListViewItem * item, QRegExp & rx ) const;
00147
00148 void connectSignals();
00149 void disconnectSignals();
00150
00151 void startKeyListJobForBackend( const Kleo::CryptoBackend::Protocol *, const std::vector<GpgME::Key> &, bool );
00152 void startValidatingKeyListing();
00153
00154 void init( bool, bool, const QString &, const QString & );
00155
00156 private:
00157 Kleo::KeyListView * mKeyListView;
00158 const Kleo::CryptoBackend::Protocol * mOpenPGPBackend;
00159 const Kleo::CryptoBackend::Protocol * mSMIMEBackend;
00160 QCheckBox * mRememberCB;
00161 std::vector<GpgME::Key> mSelectedKeys, mKeysToCheck;
00162 unsigned int mKeyUsage;
00163 QTimer * mCheckSelectionTimer;
00164 QTimer * mStartSearchTimer;
00165
00166 QString mSearchText;
00167 Kleo::KeyListViewItem * mCurrentContextMenuItem;
00168 int mTruncated, mListJobCount, mSavedOffsetY;
00169 };
00170
00171 }
00172
00173 #endif // __KLEO_UI_KEYSELECTIONDIALOG_H__
This file is part of the documentation for certmanager/lib Library Version 3.3.2.