| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #ifndef KDAV_DAVITEMMODIFYJOB_H |
| 8 | #define KDAV_DAVITEMMODIFYJOB_H |
| 9 | |
| 10 | #include "kdav_export.h" |
| 11 | |
| 12 | #include "davitem.h" |
| 13 | #include "davjobbase.h" |
| 14 | #include "davurl.h" |
| 15 | |
| 16 | namespace KDAV |
| 17 | { |
| 18 | class DavItemModifyJobPrivate; |
| 19 | |
| 20 | /*! |
| 21 | * \class KDAV::DavItemModifyJob |
| 22 | * \inheaderfile KDAV/DavItemModifyJob |
| 23 | * \inmodule KDAV |
| 24 | * |
| 25 | * \brief A job that modifies a DAV item on the DAV server. |
| 26 | */ |
| 27 | class KDAV_EXPORT DavItemModifyJob : public DavJobBase |
| 28 | { |
| 29 | Q_OBJECT |
| 30 | |
| 31 | public: |
| 32 | /*! |
| 33 | * Creates a new DAV item modify job. |
| 34 | * |
| 35 | * \a item The item that shall be modified. |
| 36 | * |
| 37 | * \a parent The parent object. |
| 38 | */ |
| 39 | explicit DavItemModifyJob(const DavItem &item, QObject *parent = nullptr); |
| 40 | |
| 41 | /*! |
| 42 | * Starts the job. |
| 43 | */ |
| 44 | void start() override; |
| 45 | |
| 46 | /*! |
| 47 | * Returns the modified item including the updated ETag information. |
| 48 | */ |
| 49 | Q_REQUIRED_RESULT DavItem item() const; |
| 50 | |
| 51 | /*! |
| 52 | * |
| 53 | */ |
| 54 | Q_REQUIRED_RESULT QUrl itemUrl() const; |
| 55 | |
| 56 | /*! |
| 57 | * Returns the item that triggered the conflict, if any. |
| 58 | */ |
| 59 | Q_REQUIRED_RESULT DavItem freshItem() const; |
| 60 | |
| 61 | /*! |
| 62 | * Returns the response code we got when fetching the fresh item. |
| 63 | */ |
| 64 | Q_REQUIRED_RESULT int freshResponseCode() const; |
| 65 | |
| 66 | private: |
| 67 | Q_DECLARE_PRIVATE(DavItemModifyJob) |
| 68 | }; |
| 69 | } |
| 70 | |
| 71 | #endif |
| 72 | |