1 | /* |
2 | Copyright (c) 2009 Volker Krause <vkrause@kde.org> |
3 | |
4 | This library is free software; you can redistribute it and/or modify it |
5 | under the terms of the GNU Library General Public License as published by |
6 | the Free Software Foundation; either version 2 of the License, or (at your |
7 | option) any later version. |
8 | |
9 | This library is distributed in the hope that it will be useful, but WITHOUT |
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public |
12 | License for more details. |
13 | |
14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to the |
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
17 | 02110-1301, USA. |
18 | */ |
19 | |
20 | #ifndef AKONADI_COLLECTIONMOVEJOB_H |
21 | #define AKONADI_COLLECTIONMOVEJOB_H |
22 | |
23 | #include "akonadi_export.h" |
24 | |
25 | #include <akonadi/job.h> |
26 | |
27 | namespace Akonadi { |
28 | |
29 | class Collection; |
30 | class CollectionMoveJobPrivate; |
31 | |
32 | /** |
33 | * @short Job that moves a collection in the Akonadi storage to a new parent collection. |
34 | * |
35 | * This job moves an existing collection to a new parent collection. |
36 | * |
37 | * @code |
38 | * |
39 | * const Akonadi::Collection collection = ... |
40 | * const Akonadi::Collection newParent = ... |
41 | * |
42 | * Akonadi::CollectionMoveJob *job = new Akonadi::CollectionMoveJob( collection, newParent ); |
43 | * connect( job, SIGNAL(result(KJob*)), this, SLOT(moveResult(KJob*)) ); |
44 | * |
45 | * @endcode |
46 | * |
47 | * @since 4.4 |
48 | * @author Volker Krause <vkrause@kde.org> |
49 | */ |
50 | class AKONADI_EXPORT CollectionMoveJob : public Job |
51 | { |
52 | Q_OBJECT |
53 | |
54 | public: |
55 | /** |
56 | * Creates a new collection move job for the given collection and destination |
57 | * |
58 | * @param collection The collection to move. |
59 | * @param destination The destination collection where @p collection should be moved to. |
60 | * @param parent The parent object. |
61 | */ |
62 | CollectionMoveJob(const Collection &collection, const Collection &destination, QObject *parent = 0); |
63 | |
64 | protected: |
65 | virtual void doStart(); |
66 | |
67 | private: |
68 | Q_DECLARE_PRIVATE(CollectionMoveJob) |
69 | template <typename T, typename MoveJob> friend class MoveJobImpl; |
70 | }; |
71 | |
72 | } |
73 | |
74 | #endif |
75 | |