File indexing completed on 2024-04-21 03:53:52

0001 /*
0002     SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDAV_DAVITEMMODIFYJOB_H
0008 #define KDAV_DAVITEMMODIFYJOB_H
0009 
0010 #include "kdav_export.h"
0011 
0012 #include "davitem.h"
0013 #include "davjobbase.h"
0014 #include "davurl.h"
0015 
0016 namespace KDAV
0017 {
0018 class DavItemModifyJobPrivate;
0019 
0020 /**
0021  * @class DavItemModifyJob davitemmodifyjob.h <KDAV/DavItemModifyJob>
0022  *
0023  * @short A job that modifies a DAV item on the DAV server.
0024  */
0025 class KDAV_EXPORT DavItemModifyJob : public DavJobBase
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     /**
0031      * Creates a new DAV item modify job.
0032      *
0033      * @param item The item that shall be modified.
0034      * @param parent The parent object.
0035      */
0036     explicit DavItemModifyJob(const DavItem &item, QObject *parent = nullptr);
0037 
0038     /**
0039      * Starts the job.
0040      */
0041     void start() override;
0042 
0043     /**
0044      * Returns the modified item including the updated ETag information.
0045      */
0046     Q_REQUIRED_RESULT DavItem item() const;
0047 
0048     Q_REQUIRED_RESULT QUrl itemUrl() const;
0049 
0050     /**
0051      * Returns the item that triggered the conflict, if any.
0052      */
0053     Q_REQUIRED_RESULT DavItem freshItem() const;
0054 
0055     /**
0056      * Returns the response code we got when fetching the fresh item.
0057      */
0058     Q_REQUIRED_RESULT int freshResponseCode() const;
0059 
0060 private:
0061     Q_DECLARE_PRIVATE(DavItemModifyJob)
0062 };
0063 }
0064 
0065 #endif