Akonadi

entitydeletedattribute.h
1 /*
2  SPDX-FileCopyrightText: 2011 Christian Mollekopf <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 #pragma once
8 
9 #include "akonadicore_export.h"
10 #include "attribute.h"
11 #include "collection.h"
12 
13 namespace Akonadi
14 {
15 class EntityDeletedAttributePrivate;
16 
17 /**
18  * @short An Attribute that marks that an entity was marked as deleted
19  *
20  * This class represents the attribute of all hidden items. The hidden
21  * items shouldn't be displayed in UI applications (unless in some kind
22  * of "debug" mode).
23  *
24  * Example:
25  *
26  * @code
27  *
28  * @endcode
29  *
30  * @author Christian Mollekopf <[email protected]>
31  * @see Akonadi::Attribute
32  * @since 4.8
33  */
34 class AKONADICORE_EXPORT EntityDeletedAttribute : public Attribute
35 {
36 public:
37  /**
38  * Creates a new entity deleted attribute.
39  */
40  explicit EntityDeletedAttribute();
41 
42  /**
43  * Destroys the entity deleted attribute.
44  */
45  ~EntityDeletedAttribute() override;
46  /**
47  * Sets the collection used to restore items which have been moved to trash using a TrashJob
48  * If the Resource is set on the collection, the resource root will be used as fallback during the restore operation.
49  */
50  void setRestoreCollection(const Collection &col);
51 
52  /**
53  * Returns the original collection of an item that has been moved to trash using a TrashJob
54  */
55  Collection restoreCollection() const;
56 
57  /**
58  * Returns the resource of the restoreCollection
59  */
60  QString restoreResource() const;
61 
62  /**
63  * Reimplemented from Attribute
64  */
65  QByteArray type() const override;
66 
67  /**
68  * Reimplemented from Attribute
69  */
70  EntityDeletedAttribute *clone() const override;
71 
72  /**
73  * Reimplemented from Attribute
74  */
75  QByteArray serialized() const override;
76 
77  /**
78  * Reimplemented from Attribute
79  */
80  void deserialize(const QByteArray &data) override;
81 
82 private:
83  /// @cond PRIVATE
84  const std::unique_ptr<EntityDeletedAttributePrivate> d;
85  /// @endcond
86 };
87 
88 } // namespace Akonadi
89 
Represents a collection of PIM items.
Definition: collection.h:61
Provides interface for custom attributes for Entity.
Definition: attribute.h:124
An Attribute that marks that an entity was marked as deleted.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:00:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.