KDAV

davcollection.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Grégory Oestreicher <greg@kamago.net>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "davcollection.h"
8
9#include "davurl.h"
10
11#include <QColor>
12
13using namespace KDAV;
14
15class DavCollectionPrivate : public QSharedData
16{
17public:
18 DavCollection::ContentTypes mContentTypes;
19 QString mCTag;
20 DavUrl mUrl;
21 QString mDisplayName;
22 QColor mColor;
23 Privileges mPrivileges;
24};
25
27 : d(new DavCollectionPrivate)
28{
29}
30
31DavCollection::DavCollection(const DavUrl &url, const QString &displayName, ContentTypes contentTypes)
32 : d(new DavCollectionPrivate)
33{
34 d->mUrl = url;
35 d->mDisplayName = displayName;
36 d->mContentTypes = contentTypes;
37 d->mPrivileges = KDAV::All;
38}
39
40DavCollection::DavCollection(const DavCollection &other) = default;
42DavCollection &DavCollection::operator=(const DavCollection &other) = default;
43DavCollection &DavCollection::operator=(DavCollection &&) = default;
44DavCollection::~DavCollection() = default;
45
47{
48 d->mCTag = ctag;
49}
50
52{
53 return d->mCTag;
54}
55
57{
58 d->mUrl = url;
59}
60
62{
63 return d->mUrl;
64}
65
66void DavCollection::setDisplayName(const QString &displayName)
67{
68 d->mDisplayName = displayName;
69}
70
72{
73 return d->mDisplayName;
74}
75
77{
78 d->mColor = color;
79}
80
82{
83 return d->mColor;
84}
85
87{
88 d->mContentTypes = contentTypes;
89}
90
92{
93 return d->mContentTypes;
94}
95
97{
98 d->mPrivileges = privs;
99}
100
102{
103 return d->mPrivileges;
104}
A helper class to store information about DAV collection.
Privileges privileges() const
Returns the privileges on this collection.
QString displayName() const
Returns the display name of the collection.
void setPrivileges(Privileges privs)
Sets the privileges on this collection.
void setDisplayName(const QString &name)
Sets the display name of the collection.
ContentTypes contentTypes() const
Returns the possible content types of the collection.
void setUrl(const DavUrl &url)
Sets the url that identifies the collection.
DavUrl url() const
Returns the URL that identifies the collection.
DavCollection()
Creates an empty DAV collection.
QString CTag() const
Returns this collection CTag.
QColor color() const
Return the color of the collection, or an empty string if none was provided by the backend.
void setCTag(const QString &ctag)
Sets this collection CTag.
void setColor(const QColor &color)
Sets the color for this collection.
void setContentTypes(ContentTypes types)
Sets the possible content types of the collection.
A helper class to combine URL and protocol of a DAV URL.
Definition davurl.h:27
The KDAV namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:16:34 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.