kgpg
keysmanager.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KEYSMANAGER_H
00019 #define KEYSMANAGER_H
00020
00021 #include <QDropEvent>
00022 #include <QClipboard>
00023 #include <QPixmap>
00024 #include <Q3ListViewItem>
00025
00026 #include <KToggleAction>
00027 #include <K3ListViewSearchLine>
00028 #include <KXmlGuiWindow>
00029 #include <KDialog>
00030 #include <K3ListView>
00031 #include <KUrl>
00032
00033 #include "kgpgkey.h"
00034 #include "keylistview.h"
00035 #include "ui_adduid.h"
00036 #include "ui_groupedit.h"
00037 #include "kgpginterface.h"
00038
00039 class QCloseEvent;
00040 class QEvent;
00041
00042 class KSelectAction;
00043 class KPassivePopup;
00044 class KStatusBar;
00045 class KMenu;
00046
00047 class KgpgInterface;
00048 class groupEdit;
00049 class KeyServer;
00050 class KgpgEditor;
00051 class KeyServer;
00052 class KGpgTransaction;
00053
00054 class groupEdit : public QWidget, public Ui::groupEdit
00055 {
00056 public:
00057 groupEdit( QWidget *parent = 0 ) : QWidget( parent ) {
00058 setupUi( this );
00059 }
00060 };
00061
00062
00063 class AddUid : public QWidget, public Ui::AddUid
00064 {
00065 public:
00066 AddUid( QWidget *parent ) : QWidget( parent ) {
00067 setupUi( this );
00068 }
00069 };
00070
00071 class KeysManager : public KXmlGuiWindow
00072 {
00073 Q_OBJECT
00074
00075 public:
00076 KeysManager(QWidget *parent = 0);
00077
00078 KToggleAction *sTrust;
00079 KToggleAction *sCreat;
00080 KToggleAction *sExpi;
00081 KToggleAction *sSize;
00082 KToggleAction *hPublic;
00083 KToggleAction *hExRev;
00084 KSelectAction *photoProps;
00085 KgpgEditor *s_kgpgEditor;
00086
00087 void saveToggleOpts(void);
00088 signals:
00089 void readAgainOptions();
00090 void certificate(QString);
00091 void closeAsked();
00092 void fontChanged(QFont);
00093 void encryptFiles(KUrl::List);
00094
00095 public slots:
00096 void slotGenerateKey();
00097 void refreshkey();
00098 void readAllOptions();
00099 void showKeyInfo(const QString &keyID);
00100 void findKey();
00101 void findFirstKey();
00102 void findNextKey();
00103 void slotSetDefaultKey(const QString &newID);
00104 void showKeyManager();
00105 bool importRemoteKey(const QString &keyIDs);
00106 void showKeyServer();
00107 void showOptions();
00108 void slotOpenEditor();
00109
00110 protected:
00111 void closeEvent(QCloseEvent *e);
00112 bool eventFilter(QObject *, QEvent *e);
00113 bool isSignature(KeyListViewItem *);
00114 bool isSignatureUnknown(KeyListViewItem *);
00115
00116 private slots:
00117 void statusBarTimeout();
00118 void changeMessage(const QString &msg, const int nb, const bool keep = false);
00119
00120 void slotGenerateKeyProcess(KgpgInterface *);
00121 void slotGenerateKeyDone(int res, KgpgInterface *interface, const QString &name, const QString &email, const QString &id, const QString &fingerprint);
00122
00123 void slotShowTrust();
00124 void slotShowSize();
00125 void slotShowCreation();
00126 void slotShowExpiration();
00127
00128 void slotAddUidFin(int res, KgpgInterface *interface);
00129 void slotDelPhotoFinished(int res, KgpgInterface *interface);
00130 void quitApp();
00131 void slotToggleSecret();
00132 void slotToggleDisabled();
00133 void slotGotoDefaultKey();
00134 void slotDelUid();
00135 void slotPrimUid();
00136 void slotAddUid();
00137 void slotAddUidEnable(const QString &name);
00138 void slotUpdatePhoto();
00139 void slotDeletePhoto();
00140 void slotAddPhoto();
00141 void slotSetPhotoSize(int size);
00142 void slotShowPhoto();
00143 void slotrevoke(const QString &keyID, const QString &revokeUrl, const int reason, const QString &description);
00144 void revokeWidget();
00145 void doFilePrint(const QString &url);
00146 void doPrint(const QString &txt);
00147 void checkList();
00148 void signLoop();
00149 void slotManpage();
00150 void slotTip();
00151 void slotProcessExportMail(const QString &keys);
00152 void slotProcessExportClip(const QString &keys);
00153 void readOptions();
00154 void slotSetDefKey();
00155 void slotSetDefaultKey(KeyListViewItem *newdef);
00156 void annule();
00157 void confirmdeletekey();
00158 void deletekey();
00159 void deleteseckey();
00160 void signkey();
00161 void delsignkey();
00162 void preimportsignkey();
00163 void importsignkey(const QStringList &importKeyId);
00164 void importallsignkey();
00165 void importfinished();
00166 void signatureResult(int success, KgpgInterface*);
00167 void delsignatureResult(bool);
00168 void defaultAction();
00169 void keyproperties();
00170 void slotexport();
00171 void slotexportsec();
00172
00173 void slotMenu(Q3ListViewItem *, const QPoint &, int);
00174
00175 void slotPreImportKey();
00176 void slotedit();
00177 void addToKAB();
00178 void editGroup();
00179 void groupAdd();
00180 void groupRemove();
00181 void groupInit(const QStringList &keysGroup);
00182 void groupChange();
00183 void createNewGroup();
00184 void deleteGroup();
00185 void slotImportRevoke(const QString &url);
00186 void slotImportRevokeTxt(const QString &revokeText);
00187 void refreshKeyFromServer();
00188 void refreshFinished(const QStringList &ids);
00189 void slotregenerate();
00190 void reloadSecretKeys();
00191 void getMissingSigs(QStringList *missingKeys, KeyListViewItem *item);
00192 void slotEditDone(int exitcode);
00193 void importRemoteFinished(KGpgTransaction *);
00194
00195 private:
00196 KeyListView *keysList2;
00197
00198 QString globalkeyMail;
00199 QString globalkeyID;
00200 QString searchString;
00201
00202 QList<KeyListViewItem*> signList;
00203 QList<KeyListViewItem*> keysList;
00204
00205 QClipboard::Mode m_clipboardmode;
00206 QTimer *m_statusbartimer;
00207
00208 KMenu *m_popuppub;
00209 KMenu *m_popupsec;
00210 KMenu *m_popupgroup;
00211 KMenu *m_popupout;
00212 KMenu *m_popupsig;
00213 KMenu *m_popupphoto;
00214 KMenu *m_popupuid;
00215 KMenu *m_popuporphan;
00216
00217 KPassivePopup *pop;
00218 KStatusBar *m_statusbar;
00219
00220 KeyListViewSearchLine* m_listviewsearch;
00221 KDialog *addUidWidget;
00222
00223 QAction *importSignatureKey;
00224 QAction *importAllSignKeys;
00225 QAction *signKey;
00226 QAction *refreshKey;
00227 QAction *setPrimUid;
00228 QAction *delSignKey;
00229 QAction *deleteKey;
00230 QAction *editCurrentGroup;
00231 QAction *delGroup;
00232
00233 KeyServer *kServer;
00234 groupEdit *gEdit;
00235 KgpgInterface *revKeyProcess;
00236
00237 bool continueSearch;
00238 bool showPhoto;
00239 bool globalisLocal;
00240 bool showTipOfDay;
00241 bool m_isterminal;
00242
00243 uint globalCount;
00244 uint keyCount;
00245 int globalChecked;
00246
00247 long searchOptions;
00248
00249 QString terminalkey;
00250 };
00251
00252 class KGpgTransaction : public QObject
00253 {
00254
00255 Q_OBJECT
00256
00257 public:
00258 KgpgInterface *iface;
00259
00260 explicit KGpgTransaction();
00261
00262 ~KGpgTransaction()
00263 {
00264 delete iface;
00265 }
00266
00267 private slots:
00268 void slotDownloadKeysFinished(QList<int>, QStringList, bool, QString, KgpgInterface*);
00269
00270 signals:
00271 void receiveComplete(KGpgTransaction *);
00272 };
00273
00274 #endif // KEYSMANAGER_H