Akonadi

itemmodifyhandler.h
1/***************************************************************************
2 * SPDX-FileCopyrightText: 2006 Tobias Koenig <tokoe@kde.org> *
3 * SPDX-FileCopyrightText: 2009 Volker Krause <vkrause@kde.org> *
4 * *
5 * SPDX-License-Identifier: LGPL-2.0-or-later *
6 ***************************************************************************/
7
8#pragma once
9
10#include "entities.h"
11#include "handler.h"
12
13namespace Akonadi
14{
15namespace Server
16{
17/**
18 @ingroup akonadi_server_handler
19
20 Handler for the item modification command.
21
22 <h4>Semantics</h4>
23 Modifies the selected items. Item selection can happen within the usual three scopes:
24 - based on a uid set relative to the currently selected collection
25 - based on a uid set (UID)
26 - based on a list of remote identifiers within the currently selected collection (RID)
27
28 The following item properties can be modified:
29 - the remote identifier (@c REMOTEID)
30 - the remote revision (@c REMOTEREVISION)
31 - the global identifier (@c GID)
32 - resetting the dirty flag indication local changes not yet replicated to the backend (@c DIRTY)
33 - adding/deleting/setting item flags (@c FLAGS)
34 - setting the item size hint (@c SIZE)
35 - changing item attributes
36 - changing item payload parts
37
38 If multiple items are selected only the following operations are valid:
39 - adding flags
40 - removing flags
41 - settings flags
42
43 The following operations are only allowed by resources:
44 - resetting the dirty flag
45 - invalidating the cache
46 - modifying the remote identifier
47 - modifying the remote revision
48
49 Conflict detection:
50 - only available when modifying a single item
51 - requires the previous item revision to be provided (@c REV)
52*/
53
55{
56public:
57 ItemModifyHandler(AkonadiServer &akonadi);
58 ~ItemModifyHandler() override = default;
59
60 bool parseStream() override;
61
62private:
63 bool replaceFlags(const PimItem::List &items, const QSet<QByteArray> &flags, bool &flagsChanged);
64 bool addFlags(const PimItem::List &items, const QSet<QByteArray> &flags, bool &flagsChanged);
65 bool deleteFlags(const PimItem::List &items, const QSet<QByteArray> &flags, bool &flagsChanged);
66 bool replaceTags(const PimItem::List &items, const Scope &tags, bool &tagsChanged);
67 bool addTags(const PimItem::List &items, const Scope &tags, bool &tagsChanged);
68 bool deleteTags(const PimItem::List &items, const Scope &tags, bool &tagsChanged);
69};
70
71} // namespace Server
72} // namespace Akonadi
The handler interfaces describes an entity capable of handling an AkonadiIMAP command.
Definition handler.h:32
Handler for the item modification command.
bool parseStream() override
Parse and handle the IMAP message using the streaming parser.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 7 2024 11:56:45 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.