12#include <Libkleo/Enum>
14static const Kleo::CryptoMessageFormat cryptoMessageFormats[] = {Kleo::AutoFormat,
15 Kleo::InlineOpenPGPFormat,
16 Kleo::OpenPGPMIMEFormat,
18 Kleo::SMIMEOpaqueFormat};
19static const int numCryptoMessageFormats =
sizeof cryptoMessageFormats /
sizeof *cryptoMessageFormats;
21static const Kleo::CryptoMessageFormat concreteCryptoMessageFormats[] = {Kleo::OpenPGPMIMEFormat,
23 Kleo::SMIMEOpaqueFormat,
24 Kleo::InlineOpenPGPFormat};
25static const unsigned int numConcreteCryptoMessageFormats =
sizeof concreteCryptoMessageFormats /
sizeof *concreteCryptoMessageFormats;
27static inline Kleo::CryptoMessageFormat cb2format(
int idx)
29 return cryptoMessageFormats[idx >= 0 && idx < numCryptoMessageFormats ? idx : 0];
32static inline int format2cb(Kleo::CryptoMessageFormat f)
34 for (
int i = 0; i < numCryptoMessageFormats; ++i) {
35 if (f == cryptoMessageFormats[i]) {
47static inline bool isSMIME(Kleo::CryptoMessageFormat f)
49 return f == Kleo::SMIMEFormat || f == Kleo::SMIMEOpaqueFormat;
52static inline bool isOpenPGP(Kleo::CryptoMessageFormat f)
54 return f == Kleo::InlineOpenPGPFormat || f == Kleo::OpenPGPMIMEFormat;
57static inline bool containsSMIME(
unsigned int f)
59 return f & (Kleo::SMIMEFormat | Kleo::SMIMEOpaqueFormat);
62static inline bool containsOpenPGP(
unsigned int f)
64 return f & (Kleo::OpenPGPMIMEFormat | Kleo::InlineOpenPGPFormat);
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.