certmanager/lib

keyapprovaldialog.h
1/*
2 keyselectiondialog.h
3
4 This file is part of libkleopatra, the KDE keymanagement library
5 Copyright (c) 2004 Klarälvdalens Datakonsult AB
6
7 Based on kpgpui.h
8 Copyright (C) 2001,2002 the KPGP authors
9 See file libtdenetwork/AUTHORS.kpgp for details
10
11 Libkleopatra is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of the
14 License, or (at your option) any later version.
15
16 Libkleopatra is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24
25 In addition, as a special exception, the copyright holders give
26 permission to link the code of this program with any edition of
27 the TQt library by Trolltech AS, Norway (or with modified versions
28 of TQt that use the same license as TQt), and distribute linked
29 combinations including the two. You must obey the GNU General
30 Public License in all respects for all of the code used other than
31 TQt. If you modify this file, you may extend this exception to
32 your version of the file, but you are not obligated to do so. If
33 you do not wish to do so, delete this exception statement from
34 your version.
35*/
36
37#ifndef __KLEO_KEYAPPROVALDIALOG_H__
38#define __KLEO_KEYAPPROVALDIALOG_H__
39
40#include <kleo/enum.h>
41
42#include <kdialogbase.h>
43#include <tdemacros.h>
44
45#include <kpgpkey.h> // for EncryptPref
46#include <gpgmepp/key.h>
47
48#include <vector>
49
50namespace GpgME {
51 class Key;
52}
53
54class TQStringList;
55
56namespace Kleo {
57
58 class TDE_EXPORT KeyApprovalDialog : public KDialogBase {
59 TQ_OBJECT
60
61 public:
62 struct Item {
63 Item() : pref( UnknownPreference ) {}
64 Item( const TQString & a, const std::vector<GpgME::Key> & k,
65 EncryptionPreference p=UnknownPreference )
66 : address( a ), keys( k ), pref( p ) {}
67 TQString address;
68 std::vector<GpgME::Key> keys;
69 EncryptionPreference pref;
70 };
71
72 KeyApprovalDialog( const std::vector<Item> & recipients,
73 const std::vector<GpgME::Key> & sender,
74 TQWidget * parent=0, const char * name=0,
75 bool modal=true );
76 ~KeyApprovalDialog();
77
78 std::vector<Item> items() const;
79 std::vector<GpgME::Key> senderKeys() const;
80
81 bool preferencesChanged() const;
82
83 private slots:
84 void slotPrefsChanged();
85
86 private:
87 class Private;
88 Private * d;
89 };
90
91} // namespace Kleo
92
93#endif // __KLEO_KEYAPPROVALDIALOG_H__