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 | |
13 | using namespace KDAV; |
14 | |
15 | class DavCollectionPrivate : public QSharedData |
16 | { |
17 | public: |
18 | DavCollection::ContentTypes mContentTypes; |
19 | QString mCTag; |
20 | DavUrl mUrl; |
21 | QString mDisplayName; |
22 | QColor mColor; |
23 | Privileges mPrivileges; |
24 | }; |
25 | |
26 | DavCollection::DavCollection() |
27 | : d(new DavCollectionPrivate) |
28 | { |
29 | } |
30 | |
31 | DavCollection::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 | |
40 | DavCollection::DavCollection(const DavCollection &other) = default; |
41 | DavCollection::DavCollection(DavCollection &&) = default; |
42 | DavCollection &DavCollection::operator=(const DavCollection &other) = default; |
43 | DavCollection &DavCollection::operator=(DavCollection &&) = default; |
44 | DavCollection::~DavCollection() = default; |
45 | |
46 | void DavCollection::setCTag(const QString &ctag) |
47 | { |
48 | d->mCTag = ctag; |
49 | } |
50 | |
51 | QString DavCollection::CTag() const |
52 | { |
53 | return d->mCTag; |
54 | } |
55 | |
56 | void DavCollection::setUrl(const DavUrl &url) |
57 | { |
58 | d->mUrl = url; |
59 | } |
60 | |
61 | DavUrl DavCollection::url() const |
62 | { |
63 | return d->mUrl; |
64 | } |
65 | |
66 | void DavCollection::setDisplayName(const QString &displayName) |
67 | { |
68 | d->mDisplayName = displayName; |
69 | } |
70 | |
71 | QString DavCollection::displayName() const |
72 | { |
73 | return d->mDisplayName; |
74 | } |
75 | |
76 | void DavCollection::setColor(const QColor &color) |
77 | { |
78 | d->mColor = color; |
79 | } |
80 | |
81 | QColor DavCollection::color() const |
82 | { |
83 | return d->mColor; |
84 | } |
85 | |
86 | void DavCollection::setContentTypes(ContentTypes contentTypes) |
87 | { |
88 | d->mContentTypes = contentTypes; |
89 | } |
90 | |
91 | DavCollection::ContentTypes DavCollection::contentTypes() const |
92 | { |
93 | return d->mContentTypes; |
94 | } |
95 | |
96 | void DavCollection::setPrivileges(Privileges privs) |
97 | { |
98 | d->mPrivileges = privs; |
99 | } |
100 | |
101 | Privileges DavCollection::privileges() const |
102 | { |
103 | return d->mPrivileges; |
104 | } |
105 |