Libkleo

enum.h
1 /*
2  kleo/enum.h
3 
4  This file is part of libkleopatra, the KDE keymanagement library
5  SPDX-FileCopyrightText: 2004 Klarälvdalens Datakonsult AB
6 
7  SPDX-License-Identifier: GPL-2.0-or-later
8 */
9 
10 #pragma once
11 
12 #include "kleo_export.h"
13 
14 #include <QStringList>
15 
16 class QString;
17 
18 namespace GpgME
19 {
20 class Key;
21 class UserID;
22 }
23 
24 namespace Kleo
25 {
26 
27 enum CryptoMessageFormat {
28  // clang-format off
29  InlineOpenPGPFormat = 1,
30  OpenPGPMIMEFormat = 2,
31  SMIMEFormat = 4,
32  SMIMEOpaqueFormat = 8,
33  AnyOpenPGP = InlineOpenPGPFormat | OpenPGPMIMEFormat,
34  AnySMIME = SMIMEOpaqueFormat | SMIMEFormat,
35  AutoFormat = AnyOpenPGP | AnySMIME
36  // clang-format on
37 };
38 
39 KLEO_EXPORT QString cryptoMessageFormatToLabel(CryptoMessageFormat f);
40 
41 KLEO_EXPORT const char *cryptoMessageFormatToString(CryptoMessageFormat f);
42 KLEO_EXPORT QStringList cryptoMessageFormatsToStringList(unsigned int f);
43 KLEO_EXPORT CryptoMessageFormat stringToCryptoMessageFormat(const QString &s);
44 KLEO_EXPORT unsigned int stringListToCryptoMessageFormats(const QStringList &sl);
45 
46 enum Action { Conflict, DoIt, DontDoIt, Ask, AskOpportunistic, Impossible };
47 
48 enum EncryptionPreference {
49  // clang-format off
50  UnknownPreference = 0,
51  NeverEncrypt = 1,
52  AlwaysEncrypt = 2,
53  AlwaysEncryptIfPossible = 3,
54  AlwaysAskForEncryption = 4,
55  AskWheneverPossible = 5,
56  MaxEncryptionPreference = AskWheneverPossible
57  // clang-format on
58 };
59 
60 KLEO_EXPORT QString encryptionPreferenceToLabel(EncryptionPreference pref);
61 KLEO_EXPORT const char *encryptionPreferenceToString(EncryptionPreference pref);
62 KLEO_EXPORT EncryptionPreference stringToEncryptionPreference(const QString &str);
63 
64 enum SigningPreference {
65  // clang-format off
66  UnknownSigningPreference = 0,
67  NeverSign = 1,
68  AlwaysSign = 2,
69  AlwaysSignIfPossible = 3,
70  AlwaysAskForSigning = 4,
71  AskSigningWheneverPossible = 5,
72  MaxSigningPreference = AskSigningWheneverPossible
73  // clang-format on
74 };
75 
76 KLEO_EXPORT QString signingPreferenceToLabel(SigningPreference pref);
77 KLEO_EXPORT const char *signingPreferenceToString(SigningPreference pref);
78 KLEO_EXPORT SigningPreference stringToSigningPreference(const QString &str);
79 
80 enum TrustLevel { Level0, Level1, Level2, Level3, Level4 };
81 
82 KLEO_EXPORT TrustLevel trustLevel(const GpgME::Key &key);
83 KLEO_EXPORT TrustLevel trustLevel(const GpgME::UserID &uid);
84 
85 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:56:14 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.