File indexing completed on 2024-05-26 05:17:00

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_DAVITEMFETCHJOB_H
0020 #define KDAV2_DAVITEMFETCHJOB_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 fetches a DAV item from the DAV server.
0033  */
0034 class KPIMKDAV2_EXPORT DavItemFetchJob : public DavJobBase
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039     /**
0040      * Creates a new dav item fetch job.
0041      *
0042      * @param item The item that shall be fetched.
0043      * @param parent The parent object.
0044      */
0045     DavItemFetchJob(const DavItem &item, QObject *parent = nullptr);
0046 
0047     /**
0048      * Starts the job.
0049      */
0050     void start() Q_DECL_OVERRIDE;
0051 
0052     /**
0053      * Returns the fetched item including current etag information.
0054      */
0055     DavItem item() const;
0056 
0057 private Q_SLOTS:
0058     void davJobFinished(KJob *);
0059 
0060 private:
0061     DavUrl mUrl;
0062     DavItem mItem;
0063 };
0064 
0065 }
0066 
0067 #endif