1 /* -*- mode: c++; c-basic-offset:4 -*-
4 This file is part of Kleopatra, the KDE keymanager
5 Copyright (c) 2007 Klarälvdalens Datakonsult AB
7 Kleopatra is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 Kleopatra is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 In addition, as a special exception, the copyright holders give
22 permission to link the code of this program with any edition of
23 the Qt library by Trolltech AS, Norway (or with modified versions
24 of Qt that use the same license as Qt), and distribute linked
25 combinations including the two. You must obey the GNU General
26 Public License in all respects for all of the code used other than
27 Qt. If you modify this file, you may extend this exception to
28 your version of the file, but you are not obligated to do so. If
29 you do not wish to do so, delete this exception statement from
33 #ifndef __KLEOPATRA_UTILS_FORMATTING_H__
34 #define __KLEOPATRA_UTILS_FORMATTING_H__
36 #include <gpgme++/key.h>
47 namespace Formatting
{
49 QString
prettyNameAndEMail( int proto
, const char * id
, const char * name
, const char * email
, const char * comment
);
50 QString
prettyNameAndEMail( int proto
, const QString
& id
, const QString
& name
, const QString
& email
, const QString
& comment
);
51 QString
prettyNameAndEMail( const GpgME::Key
& key
);
52 QString
prettyNameAndEMail( const GpgME::UserID
& key
);
54 QString
prettyUserID( const GpgME::UserID
& uid
);
55 QString
prettyKeyID( const char * id
);
57 QString
prettyName( int proto
, const char * id
, const char * name
, const char * comment
);
58 QString
prettyName( const GpgME::Key
& key
);
59 QString
prettyName( const GpgME::UserID
& uid
);
60 QString
prettyName( const GpgME::UserID::Signature
& sig
);
62 QString
prettyEMail( const char * email
, const char * id
);
63 QString
prettyEMail( const GpgME::Key
& key
);
64 QString
prettyEMail( const GpgME::UserID
& uid
);
65 QString
prettyEMail( const GpgME::UserID::Signature
& sig
);
70 StorageLocation
= 0x004,
75 CertificateType
= 0x080,
76 CertificateUsage
= 0x100,
84 QString
toolTip( const GpgME::Key
& key
, int opts
);
86 QString
expirationDateString( const GpgME::Key
& key
);
87 QString
expirationDateString( const GpgME::Subkey
& subkey
);
88 QString
expirationDateString( const GpgME::UserID::Signature
& sig
);
89 QDate
expirationDate( const GpgME::Key
& key
);
90 QDate
expirationDate( const GpgME::Subkey
& subkey
);
91 QDate
expirationDate( const GpgME::UserID::Signature
& sig
);
93 QString
creationDateString( const GpgME::Key
& key
);
94 QString
creationDateString( const GpgME::Subkey
& subkey
);
95 QString
creationDateString( const GpgME::UserID::Signature
& sig
);
96 QDate
creationDate( const GpgME::Key
& key
);
97 QDate
creationDate( const GpgME::Subkey
& subkey
);
98 QDate
creationDate( const GpgME::UserID::Signature
& sig
);
100 QString
displayName( GpgME::Protocol prot
);
101 QString
type( const GpgME::Key
& key
);
102 QString
type( const GpgME::Subkey
& subkey
);
105 QString
ownerTrustShort( const GpgME::Key
& key
);
106 QString
ownerTrustShort( GpgME::Key::OwnerTrust trust
);
108 QString
validityShort( const GpgME::Subkey
& subkey
);
109 QString
validityShort( const GpgME::UserID
& uid
);
110 QString
validityShort( const GpgME::UserID::Signature
& sig
);
112 QString
formatForComboBox( const GpgME::Key
& key
);
114 QString
formatKeyLink( const GpgME::Key
& key
);
116 QString
signatureToString( const GpgME::Signature
& sig
, const GpgME::Key
& key
);
118 const char * summaryToString( const GpgME::Signature::Summary summary
);
120 QString
importMetaData( const GpgME::Import
& import
);
121 QString
importMetaData( const GpgME::Import
& import
, const QStringList
& sources
);
123 QString
formatOverview( const GpgME::Key
& key
);
127 #endif /* __KLEOPATRA_UTILS_FORMATTING_H__ */