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
16class QString;
17
18namespace GpgME
19{
20class Key;
21class UserID;
22}
23
24namespace Kleo
25{
26
27enum 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
39KLEO_EXPORT QString cryptoMessageFormatToLabel(CryptoMessageFormat f);
40
41KLEO_EXPORT const char *cryptoMessageFormatToString(CryptoMessageFormat f);
42KLEO_EXPORT QStringList cryptoMessageFormatsToStringList(unsigned int f);
43KLEO_EXPORT CryptoMessageFormat stringToCryptoMessageFormat(const QString &s);
44KLEO_EXPORT unsigned int stringListToCryptoMessageFormats(const QStringList &sl);
45
46enum Action { Conflict, DoIt, DontDoIt, Ask, AskOpportunistic, Impossible };
47
48enum 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
60KLEO_EXPORT QString encryptionPreferenceToLabel(EncryptionPreference pref);
61KLEO_EXPORT const char *encryptionPreferenceToString(EncryptionPreference pref);
62KLEO_EXPORT EncryptionPreference stringToEncryptionPreference(const QString &str);
63
64enum 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
76KLEO_EXPORT QString signingPreferenceToLabel(SigningPreference pref);
77KLEO_EXPORT const char *signingPreferenceToString(SigningPreference pref);
78KLEO_EXPORT SigningPreference stringToSigningPreference(const QString &str);
79
80enum TrustLevel { Level0, Level1, Level2, Level3, Level4 };
81
82KLEO_EXPORT TrustLevel trustLevel(const GpgME::Key &key);
83KLEO_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 Fri Dec 6 2024 12:02:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.