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

0001 /*
0002     SPDX-FileCopyrightText: 2014 Gregory Oestreicher <greg@kamago.net>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDAV_DAVJOBBASE_P_H
0008 #define KDAV_DAVJOBBASE_P_H
0009 
0010 #include <QString>
0011 
0012 #include <memory>
0013 
0014 namespace KDAV
0015 {
0016 class DavJobBase;
0017 
0018 class DavJobBasePrivate
0019 {
0020 public:
0021     virtual ~DavJobBasePrivate() = default;
0022 
0023     /**
0024      * Sets the latest response code received.
0025      *
0026      * Only really useful in case of error, though success codes can
0027      * also be set.
0028      *
0029      * @param code The code to set, should be a valid HTTP response code or zero.
0030      */
0031     void setLatestResponseCode(int code);
0032 
0033     void setJobErrorText(const QString &errorText);
0034     void setJobError(int jobErrorCode);
0035     void setErrorTextFromDavError();
0036     void setDavError(const Error &error);
0037 
0038     // forwarded protected KJob API, so we can use this from subclasses of this
0039     void setError(int errorCode);
0040     void setErrorText(const QString &errorText);
0041     void emitResult();
0042 
0043     DavJobBase *q_ptr = nullptr;
0044     int mLatestResponseCode = 0;
0045     int mJobErrorCode = 0;
0046     QString mInternalErrorText;
0047 };
0048 
0049 }
0050 
0051 #endif