File indexing completed on 2024-06-16 04:52:27
0001 /* 0002 Copyright (c) 2010 Tobias Koenig <tokoe@kde.org> 0003 0004 This program is free software; you can redistribute it and/or modify 0005 it under the terms of the GNU General Public License as published by 0006 the Free Software Foundation; either version 2 of the License, or 0007 (at your option) any later version. 0008 0009 This program is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0012 GNU General Public License for more details. 0013 0014 You should have received a copy of the GNU General Public License 0015 along with this program; if not, write to the Free Software 0016 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0017 */ 0018 0019 #ifndef KDAV2_DAVITEMMODIFYJOB_H 0020 #define KDAV2_DAVITEMMODIFYJOB_H 0021 0022 #include "kpimkdav2_export.h" 0023 0024 #include "davitem.h" 0025 #include "davjobbase.h" 0026 #include "davurl.h" 0027 0028 namespace KDAV2 0029 { 0030 0031 /** 0032 * @short A job that modifies a DAV item on the DAV server. 0033 */ 0034 class KPIMKDAV2_EXPORT DavItemModifyJob : public DavJobBase 0035 { 0036 Q_OBJECT 0037 0038 public: 0039 /** 0040 * Creates a new dav item modify job. 0041 * 0042 * @param item The item that shall be modified. 0043 * @param parent The parent object. 0044 */ 0045 DavItemModifyJob(const DavItem &item, QObject *parent = nullptr); 0046 0047 /** 0048 * Starts the job. 0049 */ 0050 void start() Q_DECL_OVERRIDE; 0051 0052 /** 0053 * Returns the modified item including the updated etag information. 0054 */ 0055 DavItem item() const; 0056 0057 QUrl itemUrl() const; 0058 0059 /** 0060 * Returns the item that triggered the conflict, if any. 0061 */ 0062 DavItem freshItem() const; 0063 0064 /** 0065 * Returns the http response code we got when fetching the fresh item. 0066 */ 0067 int freshResponseCode() const; 0068 0069 private Q_SLOTS: 0070 void davJobFinished(KJob *); 0071 void itemRefreshed(KJob *); 0072 void conflictingItemFetched(KJob *); 0073 0074 private: 0075 DavItem mItem; 0076 DavItem mFreshItem; 0077 int mFreshResponseCode; 0078 }; 0079 0080 } 0081 0082 #endif