1 /*
2     SPDX-FileCopyrightText: 2006-2007 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_p.h"
11 
12 namespace Akonadi
13 {
14 namespace Protocol
15 {
16 class PartMetaData;
17 class Command;
18 class ModifyItemsCommand;
19 using ModifyItemsCommandPtr = QSharedPointer<ModifyItemsCommand>;
20 }
21 
22 /**
23  * @internal
24  */
25 class AKONADICORE_EXPORT ItemModifyJobPrivate : public JobPrivate
26 {
27 public:
28     enum Operation {
29         RemoteId,
30         RemoteRevision,
31         Gid,
32         Dirty,
33     };
34 
35     explicit ItemModifyJobPrivate(ItemModifyJob *parent);
36 
37     void setClean();
38     Protocol::PartMetaData preparePart(const QByteArray &partName);
39 
40     void conflictResolved();
41     void conflictResolveError(const QString &message);
42 
43     void doUpdateItemRevision(Item::Id id, int oldRevision, int newRevision) override;
44 
45     QString jobDebuggingString() const override;
46     Protocol::ModifyItemsCommandPtr fullCommand() const;
47 
48     void setSilent(bool silent);
49 
50     Q_DECLARE_PUBLIC(ItemModifyJob)
51 
52     QSet<int> mOperations;
53     QByteArray mTag;
54     Item::List mItems;
55     bool mRevCheck = true;
56     QSet<QByteArray> mParts;
57     QSet<QByteArray> mForeignParts;
58     QByteArray mPendingData;
59     bool mIgnorePayload = false;
60     bool mAutomaticConflictHandlingEnabled = true;
61     bool mSilent = false;
62 };
63 
64 }
65 
66