certmanager Library API Documentation

certmanager.h

00001 /* -*- mode: c++; c-basic-offset:4 -*- 00002 certmanager.h 00003 00004 This file is part of Kleopatra, the KDE keymanager 00005 Copyright (c) 2001,2002,2004 Klarälvdalens Datakonsult AB 00006 00007 Kleopatra is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 Kleopatra is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 00021 In addition, as a special exception, the copyright holders give 00022 permission to link the code of this program with any edition of 00023 the Qt library by Trolltech AS, Norway (or with modified versions 00024 of Qt that use the same license as Qt), and distribute linked 00025 combinations including the two. You must obey the GNU General 00026 Public License in all respects for all of the code used other than 00027 Qt. If you modify this file, you may extend this exception to 00028 your version of the file, but you are not obligated to do so. If 00029 you do not wish to do so, delete this exception statement from 00030 your version. 00031 */ 00032 00033 #ifndef _CERTMANAGER_H_ 00034 #define _CERTMANAGER_H_ 00035 00036 //#include <gpgme.h> 00037 00038 #include <kmainwindow.h> 00039 00040 #include <kurl.h> 00041 #include <qcstring.h> 00042 #include <qptrlist.h> 00043 00044 #include <set> 00045 #include <string> 00046 00047 namespace Kleo { 00048 class KeyListView; 00049 class KeyListViewItem; 00050 class ProgressBar; 00051 class Job; 00052 } 00053 00054 namespace KIO { 00055 class Job; 00056 } 00057 class KProcess; 00058 class KToolBar; 00059 class KAction; 00060 00061 class CRLView; 00062 class HierarchyAnalyser; 00063 00064 class LineEditAction; 00065 class ComboAction; 00066 00067 class KURL; 00068 class QFile; 00069 class QStringList; 00070 class QLabel; 00071 00072 namespace GpgME { 00073 class ImportResult; 00074 class KeyListResult; 00075 class Error; 00076 class Key; 00077 } 00078 00079 class CertManager : public KMainWindow { 00080 Q_OBJECT 00081 public: 00082 CertManager( bool remote = false, const QString& query = QString::null, 00083 const QString& import=QString::null, 00084 QWidget* parent = 0, const char* name = 0); 00085 00086 bool isRemote() const { return mRemote; } 00087 00088 signals: 00089 void stopOperations(); 00090 void enableOperations( bool ); 00091 00092 private slots: 00093 void slotStartCertificateDownload( const QString & fingerprint, const QString& displayName ); 00094 void newCertificate(); 00095 void revokeCertificate(); 00096 void extendCertificate(); 00097 void slotDeleteCertificate(); 00098 void slotExportSecretKey(); 00099 void slotExportCertificate(); 00100 void slotUploadResult( KIO::Job* job ); 00101 00102 void slotImportCertFromFile(); 00103 void slotImportCertFromFile( const KURL & filename ); 00104 void slotImportResult( KIO::Job* ); 00105 00106 void slotCertificateImportResult( const GpgME::ImportResult & result ); 00107 void slotCertificateDownloadResult( const GpgME::Error & error, const QByteArray & keyData ); 00108 void slotKeyListResult( const GpgME::KeyListResult & result ); 00109 void slotDeleteResult( const GpgME::Error & error, const GpgME::Key & ); 00110 void slotSecretKeyExportResult( const GpgME::Error & error, const QByteArray & keyData ); 00111 void slotCertificateExportResult( const GpgME::Error & error, const QByteArray & keyData ); 00112 void slotClearCRLsResult(); 00113 00114 void importCRLFromFile(); 00115 void importCRLFromLDAP(); 00116 void slotImportCRLJobFinished( KIO::Job * ); 00117 00118 void slotDirmngrExited(); 00119 void slotStderr( KProcess*, char*, int ); 00120 00121 void slotToggleRemote(int idx); 00122 void slotToggleHierarchicalView( bool ); 00123 00124 void slotViewCRLs(); 00125 void slotClearCRLs(); 00126 00127 void slotViewDetails(); 00128 void slotViewDetails( Kleo::KeyListViewItem * item ); 00129 void slotSelectionChanged(); 00130 void slotDownloadCertificate(); 00131 void slotStartWatchGnuPG(); 00132 00133 void slotEditKeybindings(); 00134 void slotShowConfigurationDialog(); 00135 void slotConfigureGpgME(); 00136 void slotContextMenu(Kleo::KeyListViewItem*, const QPoint& point); 00137 void slotDropped(const KURL::List&); 00140 void slotRepaint(); 00143 void slotValidate() { startRedisplay( true ); } 00146 void slotRedisplay() { startRedisplay( false ); } 00149 void slotSearch(); 00150 00151 void slotExpandAll(); 00152 void slotCollapseAll(); 00153 void slotRefreshKeys(); 00154 void slotRefreshKeysResult( const GpgME::Error & ); 00155 00156 private: 00157 void createStatusBar(); 00158 void createActions(); 00159 void updateStatusBarLabels(); 00160 void updateImportActions( bool enable ); 00161 void startKeyListing( bool, bool, const QStringList & ); 00162 void startKeyListing( bool, bool, const std::set<std::string> & ); 00163 void startCertificateImport( const QByteArray & keyData, const QString& certDisplayName ); 00164 void startImportCRL( const QString& fileName, bool isTempFile ); 00165 void startClearCRLs(); 00166 void startSecretKeyExport( const QString & fingerprint ); 00167 void startCertificateExport( const QStringList & fingerprints ); 00168 bool connectAndStartDirmngr( const char*, const char* ); 00169 void connectJobToStatusBarProgress( Kleo::Job * job, const QString & initialText ); 00170 void disconnectJobFromStatusBarProgress( const GpgME::Error & err ); 00171 void importNextURLOrRedisplay(); 00172 void startRedisplay( bool validating ); 00173 QString displayNameForJob( const Kleo::Job *job ); 00174 00175 private: 00176 Kleo::KeyListView * mKeyListView; 00177 CRLView * mCrlView; 00178 Kleo::ProgressBar * mProgressBar; 00179 QLabel * mStatusLabel; 00180 00181 KProcess * mDirmngrProc; 00182 QString mErrorbuffer; 00183 QPtrList<Kleo::KeyListViewItem> mItemsToDelete; 00184 KURL::List mURLsToImport; 00185 typedef QMap<const Kleo::Job *, QString> JobsDisplayNameMap; 00186 JobsDisplayNameMap mJobsDisplayNameMap; 00187 HierarchyAnalyser * mHierarchyAnalyser; 00188 00189 LineEditAction * mLineEditAction; 00190 ComboAction * mComboAction; 00191 KAction * mFindAction; 00192 KAction * mImportCertFromFileAction; 00193 KAction * mImportCRLFromFileAction; 00194 KAction * mExportCertificateAction; 00195 KAction * mViewCertDetailsAction; 00196 KAction * mDeleteCertificateAction; 00197 #ifdef NOT_IMPLEMENTED_ANYWAY 00198 KAction * mRevokeCertificateAction; 00199 KAction * mExtendCertificateAction; 00200 #endif 00201 KAction * mExportSecretKeyAction; 00202 KAction * mDownloadCertificateAction; 00203 KAction * mValidateCertificateAction; 00204 00205 QString mImportCRLTempFile; 00206 QString mCurrentQuery; 00207 std::set<std::string> mPreviouslySelectedFingerprints; 00208 bool mNextFindRemote : 1; // state of the combo, i.e. whether the next find action will be remote 00209 bool mRemote : 1; // whether the currently displayed items are from a remote listing 00210 bool mDirMngrFound : 1; 00211 }; 00212 00213 #endif // _CERTMANAGER_H_
KDE Logo
This file is part of the documentation for certmanager Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:49:29 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003