Akonadi

itemcopyhandler.h
1 /*
2  SPDX-FileCopyrightText: 2008 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "entities.h"
10 #include "handler.h"
11 
12 namespace Akonadi
13 {
14 namespace Server
15 {
16 /**
17  @ingroup akonadi_server_handler
18 
19  Handler for the COPY command.
20 
21  This command is used to copy a set of items into the specific collection. It
22  is syntactically identical to the IMAP COPY command.
23 
24  The copied items differ in the following points from the originals:
25  - new unique id
26  - empty remote id
27  - possible located in a different collection (and thus resource)
28 
29  There is only the usual status response indicating success or failure of the
30  COPY command
31  */
32 class ItemCopyHandler : public Handler
33 {
34 public:
35  ItemCopyHandler(AkonadiServer &akonadi);
36  ~ItemCopyHandler() override = default;
37 
38  bool parseStream() override;
39 
40 protected:
41  /**
42  Copy the given item and all its parts into the @p target.
43  The changes mentioned above are applied.
44  */
45  bool copyItem(const PimItem &item, const Collection &target);
46  void processItems(const QVector<qint64> &ids);
47 
48 private:
49  Collection mTargetCollection;
50 };
51 
52 } // namespace Server
53 } // namespace Akonadi
54 
Represents a collection of PIM items.
Definition: collection.h:61
bool parseStream() override
Parse and handle the IMAP message using the streaming parser.
The handler interfaces describes an entity capable of handling an AkonadiIMAP command.
Definition: handler.h:39
bool copyItem(const PimItem &item, const Collection &target)
Copy the given item and all its parts into the target.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jun 30 2022 03:51:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.