MailTransport

errorattribute.h
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "mailtransportakonadi_export.h"
10 
11 #include <QString>
12 
13 #include <Akonadi/Attribute>
14 
15 #include <memory>
16 
17 namespace MailTransport
18 {
19 class ErrorAttributePrivate;
20 
21 /**
22  * @short An Attribute to mark messages that failed to be sent.
23  *
24  * This attribute contains the error message encountered.
25  *
26  * @author Constantin Berzan <[email protected]>
27  * @since 4.4
28  */
29 class MAILTRANSPORTAKONADI_EXPORT ErrorAttribute : public Akonadi::Attribute
30 {
31 public:
32  /**
33  * Creates a new error attribute.
34  *
35  * @param msg The i18n'ed error message.
36  */
37  explicit ErrorAttribute(const QString &msg = QString());
38 
39  /**
40  * Destroys the error attribute.
41  */
42  ~ErrorAttribute() override;
43 
44  /**
45  * Returns the i18n'ed error message.
46  */
47  Q_REQUIRED_RESULT QString message() const;
48 
49  /**
50  * Sets the i18n'ed error message.
51  */
52  void setMessage(const QString &msg);
53 
54  /* reimpl */
55  ErrorAttribute *clone() const override;
56  Q_REQUIRED_RESULT QByteArray type() const override;
57  Q_REQUIRED_RESULT QByteArray serialized() const override;
58  void deserialize(const QByteArray &data) override;
59 
60 private:
61  //@cond PRIVATE
62  std::unique_ptr<ErrorAttributePrivate> const d;
63  //@endcond
64 };
65 }
An Attribute to mark messages that failed to be sent.
QString message
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:58:25 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.