Akonadi

entitydeletedattribute.h
1/*
2 SPDX-FileCopyrightText: 2011 Christian Mollekopf <chrigi_1@fastmail.fm>
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
13namespace Akonadi
14{
15class 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 <chrigi_1@fastmail.fm>
31 * @see Akonadi::Attribute
32 * @since 4.8
33 */
34class AKONADICORE_EXPORT EntityDeletedAttribute : public Attribute
35{
36public:
37 /**
38 * Creates a new entity deleted attribute.
39 */
40 explicit EntityDeletedAttribute();
41
42 /**
43 * Destroys the entity deleted attribute.
44 */
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 [[nodiscard]] Collection restoreCollection() const;
56
57 /**
58 * Returns the resource of the restoreCollection
59 */
60 [[nodiscard]] QString restoreResource() const;
61
62 /**
63 * Reimplemented from Attribute
64 */
65 [[nodiscard]] QByteArray type() const override;
66
67 /**
68 * Reimplemented from Attribute
69 */
70 EntityDeletedAttribute *clone() const override;
71
72 /**
73 * Reimplemented from Attribute
74 */
75 [[nodiscard]] QByteArray serialized() const override;
76
77 /**
78 * Reimplemented from Attribute
79 */
80 void deserialize(const QByteArray &data) override;
81
82private:
83 /// @cond PRIVATE
84 const std::unique_ptr<EntityDeletedAttributePrivate> d;
85 /// @endcond
86};
87
88} // namespace Akonadi
Provides interface for custom attributes for Entity.
Definition attribute.h:132
Represents a collection of PIM items.
Definition collection.h:62
An Attribute that marks that an entity was marked as deleted.
~EntityDeletedAttribute() override
Destroys the entity deleted attribute.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.