10#include <KLocalizedString>
15using namespace KContacts;
25 Private(
const Private &other)
29 mBinaryData = other.mBinaryData;
30 mTextData = other.mTextData;
31 mCustomTypeString = other.mCustomTypeString;
32 mIsBinary = other.mIsBinary;
37 QByteArray mBinaryData;
39 QString mCustomTypeString;
64 if (d->mId != other.d->mId) {
68 if (d->mType != other.d->mType) {
72 if (d->mIsBinary != other.d->mIsBinary) {
77 if (d->mBinaryData != other.d->mBinaryData) {
81 if (d->mTextData != other.d->mTextData) {
86 if (d->mCustomTypeString != other.d->mCustomTypeString) {
95 return !(*
this == other);
100 if (
this != &other) {
119 d->mBinaryData = binary;
125 return d->mBinaryData;
131 d->mIsBinary =
false;
151 d->mCustomTypeString = custom;
161 return d->mCustomTypeString;
167 str += QStringLiteral(
" Id: %1\n").
arg(d->mId);
168 str += QStringLiteral(
" Type: %1\n").
arg(
typeLabel(d->mType));
170 str += QStringLiteral(
" CustomType: %1\n").
arg(d->mCustomTypeString);
172 str += QStringLiteral(
" IsBinary: %1\n").
arg(d->mIsBinary ? QStringLiteral(
"true") : QStringLiteral(
"false"));
176 str += QStringLiteral(
" Text: %1\n").
arg(d->mTextData);
198 return i18nc(
"X.509 public key",
"X509");
201 return i18nc(
"Pretty Good Privacy key",
"PGP");
204 return i18nc(
"A custom key",
"Custom");
207 return i18nc(
"another type of encryption key",
"Unknown type");
215 return s << key.d->mId << key.d->mType << key.d->mIsBinary << key.d->mBinaryData
216 << key.d->mTextData << key.d->mCustomTypeString;
222 s >> key.d->mId >> type >> key.d->mIsBinary >> key.d->mBinaryData >> key.d->mTextData
223 >> key.d->mCustomTypeString;
QString i18nc(const char *context, const char *text, const TYPE &arg...)
KCOREADDONS_EXPORT QString randomString(int length)
bool isEmpty() const const
QString arg(Args &&... args) const const
QString fromLatin1(QByteArrayView str)