Akonadi Mime

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 "akonadi-mime_export.h"
10 
11 #include <QString>
12 
13 #include <Akonadi/Attribute>
14 
15 #include <memory>
16 
17 namespace Akonadi
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 AKONADI_MIME_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  [[nodiscard]] 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  [[nodiscard]] QByteArray type() const override;
57  [[nodiscard]] 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 Dec 5 2023 04:11:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.