Akonadi

collectioncopyjob.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 "akonadicore_export.h"
10 #include "job.h"
11 
12 namespace Akonadi
13 {
14 class Collection;
15 class CollectionCopyJobPrivate;
16 
17 /**
18  * @short Job that copies a collection into another collection in the Akonadi storage.
19  *
20  * This job copies a single collection into a specified target collection.
21  *
22  * @code
23  *
24  * Akonadi::Collection source = ...
25  * Akonadi::Collection target = ...
26  *
27  * Akonadi::CollectionCopyJob *job = new Akonadi::CollectionCopyJob( source, target );
28  * connect( job, SIGNAL(result(KJob*)), SLOT(copyFinished(KJob*)) );
29  *
30  * ...
31  *
32  * MyClass::copyFinished( KJob *job )
33  * {
34  * if ( job->error() )
35  * qDebug() << "Error occurred";
36  * else
37  * qDebug() << "Copied successfully";
38  * }
39  *
40  * @endcode
41  *
42  * @author Volker Krause <[email protected]>
43  */
44 class AKONADICORE_EXPORT CollectionCopyJob : public Job
45 {
46  Q_OBJECT
47 
48 public:
49  /**
50  * Creates a new collection copy job to copy the given @p source collection into @p target.
51  *
52  * @param source The collection to copy.
53  * @param target The target collection.
54  * @param parent The parent object.
55  */
56  CollectionCopyJob(const Collection &source, const Collection &target, QObject *parent = nullptr);
57 
58  /**
59  * Destroys the collection copy job.
60  */
61  ~CollectionCopyJob() override;
62 
63 protected:
64  void doStart() override;
65  bool doHandleResponse(qint64 tag, const Protocol::CommandPtr &response) override;
66 
67 private:
68  Q_DECLARE_PRIVATE(CollectionCopyJob)
69 };
70 
71 }
72 
Represents a collection of PIM items.
Definition: collection.h:61
Job that copies a collection into another collection in the Akonadi storage.
Base class for all actions in the Akonadi storage.
Definition: job.h:80
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jun 27 2022 04:01:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.