Messagelib

dkimauthenticationstatusinfo.h
1 /*
2  SPDX-FileCopyrightText: 2018-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "messageviewer_private_export.h"
10 #include <QDebug>
11 #include <QString>
12 namespace MessageViewer
13 {
14 class MESSAGEVIEWER_TESTS_EXPORT DKIMAuthenticationStatusInfo
15 {
16 public:
17  DKIMAuthenticationStatusInfo();
18 
19  struct AuthStatusInfo {
20  struct Property {
21  QString type;
22  QString value;
23  Q_REQUIRED_RESULT bool isValid() const
24  {
25  return !type.isEmpty() && !value.isEmpty();
26  }
27 
28  Q_REQUIRED_RESULT bool operator==(const Property &other) const
29  {
30  return other.type == type && other.value == value;
31  }
32  };
33 
34  QString method;
35  QString result;
36  QString reason;
37  int methodVersion = -1;
38 
39  // Add Properties
40  QVector<Property> smtp;
41  QVector<Property> header;
42  QVector<Property> body;
43  QVector<Property> policy;
44 
45  Q_REQUIRED_RESULT bool operator==(const AuthStatusInfo &other) const;
46  Q_REQUIRED_RESULT bool isValid() const;
47  };
48 
49  Q_REQUIRED_RESULT QString authservId() const;
50  void setAuthservId(const QString &authservId);
51 
52  Q_REQUIRED_RESULT bool parseAuthenticationStatus(const QString &key, bool relaxingParsing);
53 
54  Q_REQUIRED_RESULT int authVersion() const;
55  void setAuthVersion(int authVersion);
56 
57  Q_REQUIRED_RESULT QString reasonSpec() const;
58  void setReasonSpec(const QString &reasonSpec);
59 
60  Q_REQUIRED_RESULT bool operator==(const DKIMAuthenticationStatusInfo &other) const;
61 
62  Q_REQUIRED_RESULT QVector<AuthStatusInfo> listAuthStatusInfo() const;
63  void setListAuthStatusInfo(const QVector<AuthStatusInfo> &listAuthStatusInfo);
64 
65 private:
66  Q_REQUIRED_RESULT AuthStatusInfo parseAuthResultInfo(QString &valueKey, bool relaxingParsing);
67  QVector<AuthStatusInfo> mListAuthStatusInfo;
68  QString mAuthservId;
69  QString mReasonSpec;
70  int mAuthVersion = -1;
71 };
72 }
73 Q_DECLARE_METATYPE(MessageViewer::DKIMAuthenticationStatusInfo)
74 Q_DECLARE_TYPEINFO(MessageViewer::DKIMAuthenticationStatusInfo::AuthStatusInfo, Q_MOVABLE_TYPE);
75 MESSAGEVIEWER_EXPORT QDebug operator<<(QDebug d, const MessageViewer::DKIMAuthenticationStatusInfo &t);
76 
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
PartitionTable::TableType type
bool isEmpty() const const
Property
bool isValid(QStringView ifopt)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.