Attica 5.109.0
metadata.h
1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#ifndef ATTICA_METADATA_H
10#define ATTICA_METADATA_H
11
12#include <QString>
13
14#include <QNetworkReply>
15#include <QSharedDataPointer>
16
17#include "attica_export.h"
18
19namespace Attica
20{
21class BaseJob;
22
28class ATTICA_EXPORT Metadata
29{
30public:
31 Metadata();
32 Metadata(const Metadata &other);
33 ~Metadata();
34 Metadata &operator=(const Metadata &other);
35
36 enum Error {
37 NoError = 0,
38 NetworkError,
39 OcsError,
40 };
41
46 Error error() const;
47 void setError(Error error);
48
54 int statusCode() const;
55 void setStatusCode(int code);
56
60 QString statusString() const;
61 void setStatusString(const QString &status);
62
64 QString message();
65 void setMessage(const QString &message);
66
69 void setTotalItems(int items);
70
73 void setItemsPerPage(int itemsPerPage);
74
76 QString resultingId();
77 void setResultingId(const QString &id);
78
88 QList<QNetworkReply::RawHeaderPair> headers() const;
94 void setHeaders(const QList<QNetworkReply::RawHeaderPair> &headers);
95
96private:
97 class Private;
98 QSharedDataPointer<Private> d;
99
100 friend class Attica::BaseJob;
101};
102
103}
104
105#endif
The baseclass for all job classes.
Definition atticabasejob.h:32
Status messages from the server.
Definition metadata.h:29
int statusCode() const
The status as integer.
QString message()
An optional additional message from the server.
QList< QNetworkReply::RawHeaderPair > headers() const
The http headers for the most recent network action in the case of a network error Use this to furthe...
int totalItems()
The number of items returned by this job (only relevant for list jobs)
void setHeaders(const QList< QNetworkReply::RawHeaderPair > &headers)
Sets the http headers read by headers()
int itemsPerPage()
The number of items per page the server was asked for.
QString statusString() const
The status of the job, for example "Ok".
Error error() const
Check if the job was successful.
QString resultingId()
The resulting ID when a PostJob created a new item.
The Attica namespace,.
Definition activity.h:21