KDAV 5.109.0
davitem.h
1/*
2 SPDX-FileCopyrightText: 2009 Grégory Oestreicher <greg@kamago.net>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KDAV_DAVITEM_H
8#define KDAV_DAVITEM_H
9
10#include "kdav_export.h"
11
12#include <QByteArray>
13#include <QDataStream>
14#include <QSharedDataPointer>
15#include <QString>
16#include <QVector>
17
18class DavItemPrivate;
19
20namespace KDAV
21{
22class DavUrl;
23}
24
25namespace KDAV
26{
38class KDAV_EXPORT DavItem
39{
40public:
44 typedef QVector<DavItem> List;
45
50
59 DavItem(const DavUrl &url, const QString &contentType, const QByteArray &data, const QString &etag);
60
61 DavItem(const DavItem &other);
62 DavItem(DavItem &&);
63 DavItem &operator=(const DavItem &other);
64 DavItem &operator=(DavItem &&);
65
66 ~DavItem();
67
71 void setUrl(const DavUrl &url);
72
76 Q_REQUIRED_RESULT DavUrl url() const;
77
81 void setContentType(const QString &type);
82
86 Q_REQUIRED_RESULT QString contentType() const;
87
91 void setData(const QByteArray &data);
92
96 Q_REQUIRED_RESULT QByteArray data() const;
97
102 void setEtag(const QString &etag);
103
108 Q_REQUIRED_RESULT QString etag() const;
109
110private:
111 QSharedDataPointer<DavItemPrivate> d;
112};
113
114KDAV_EXPORT QDataStream &operator<<(QDataStream &out, const DavItem &item);
115KDAV_EXPORT QDataStream &operator>>(QDataStream &in, DavItem &item);
116}
117
118Q_DECLARE_TYPEINFO(KDAV::DavItem, Q_MOVABLE_TYPE);
119
120#endif
A helper class to store information about DAV resources.
Definition davitem.h:39
DavUrl url() const
Returns the URL that identifies the item.
QString contentType() const
Returns the content type of the item.
QVector< DavItem > List
Defines a list of DAV item objects.
Definition davitem.h:44
DavItem(const DavUrl &url, const QString &contentType, const QByteArray &data, const QString &etag)
Creates a new DAV item.
QString etag() const
Returns the ETag of the item.
QByteArray data() const
Returns the raw content data of the item.
void setContentType(const QString &type)
Sets the content type of the item.
DavItem()
Creates an empty DAV item.
void setEtag(const QString &etag)
Sets the etag of the item.
void setData(const QByteArray &data)
Sets the raw content data of the item.
void setUrl(const DavUrl &url)
Sets the url that identifies the item.
A helper class to combine URL and protocol of a DAV URL.
Definition davurl.h:27
The KDAV namespace.
Definition davjobbase.h:17