Akonadi

collectioncopyjob.h
1/*
2 SPDX-FileCopyrightText: 2008 Volker Krause <vkrause@kde.org>
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
12namespace Akonadi
13{
14class Collection;
15class 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 <vkrause@kde.org>
43 */
44class AKONADICORE_EXPORT CollectionCopyJob : public Job
45{
46 Q_OBJECT
47
48public:
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
63protected:
64 void doStart() override;
65 bool doHandleResponse(qint64 tag, const Protocol::CommandPtr &response) override;
66
67private:
68 Q_DECLARE_PRIVATE(CollectionCopyJob)
69};
70
71}
Job that copies a collection into another collection in the Akonadi storage.
Represents a collection of PIM items.
Definition collection.h:62
Base class for all actions in the Akonadi storage.
Definition job.h:81
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:38 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.