certmanager/lib

keyapprovaldialog.h
00001 /*  -*- c++ -*-
00002     keyselectiondialog.h
00003 
00004     This file is part of libkleopatra, the KDE keymanagement library
00005     Copyright (c) 2004 Klarälvdalens Datakonsult AB
00006 
00007     Based on kpgpui.h
00008     Copyright (C) 2001,2002 the KPGP authors
00009     See file libtdenetwork/AUTHORS.kpgp for details
00010 
00011     Libkleopatra is free software; you can redistribute it and/or
00012     modify it under the terms of the GNU General Public License as
00013     published by the Free Software Foundation; either version 2 of the
00014     License, or (at your option) any later version.
00015 
00016     Libkleopatra is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019     General Public License for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with this program; if not, write to the Free Software
00023     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00024 
00025     In addition, as a special exception, the copyright holders give
00026     permission to link the code of this program with any edition of
00027     the TQt library by Trolltech AS, Norway (or with modified versions
00028     of TQt that use the same license as TQt), and distribute linked
00029     combinations including the two.  You must obey the GNU General
00030     Public License in all respects for all of the code used other than
00031     TQt.  If you modify this file, you may extend this exception to
00032     your version of the file, but you are not obligated to do so.  If
00033     you do not wish to do so, delete this exception statement from
00034     your version.
00035 */
00036 
00037 #ifndef __KLEO_KEYAPPROVALDIALOG_H__
00038 #define __KLEO_KEYAPPROVALDIALOG_H__
00039 
00040 #include <kleo/enum.h>
00041 
00042 #include <kdialogbase.h>
00043 #include <tdepimmacros.h>
00044 
00045 #include <kpgpkey.h> // for EncryptPref
00046 #include <gpgmepp/key.h>
00047 
00048 #include <vector>
00049 
00050 namespace GpgME {
00051   class Key;
00052 }
00053 
00054 class TQStringList;
00055 
00056 namespace Kleo {
00057 
00058   class KDE_EXPORT KeyApprovalDialog : public KDialogBase {
00059     Q_OBJECT
00060   
00061   public:
00062     struct Item {
00063       Item() : pref( UnknownPreference ) {}
00064       Item( const TQString & a, const std::vector<GpgME::Key> & k,
00065         EncryptionPreference p=UnknownPreference )
00066     : address( a ), keys( k ), pref( p ) {}
00067       TQString address;
00068       std::vector<GpgME::Key> keys;
00069       EncryptionPreference pref;
00070     };
00071 
00072     KeyApprovalDialog( const std::vector<Item> & recipients,
00073                const std::vector<GpgME::Key> & sender,
00074                TQWidget * parent=0, const char * name=0,
00075                        bool modal=true );
00076     ~KeyApprovalDialog();
00077 
00078     std::vector<Item> items() const;
00079     std::vector<GpgME::Key> senderKeys() const;
00080 
00081     bool preferencesChanged() const;
00082 
00083   private slots:
00084     void slotPrefsChanged();
00085 
00086   private:
00087     class Private;
00088     Private * d;
00089   };
00090 
00091 } // namespace Kleo
00092 
00093 #endif // __KLEO_KEYAPPROVALDIALOG_H__