File indexing completed on 2024-05-05 16:07:03
0001 /* 0002 SPDX-FileCopyrightText: 2009 Grégory Oestreicher <greg@kamago.net> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "davcollection.h" 0008 0009 #include "davurl.h" 0010 0011 #include <QColor> 0012 0013 using namespace KDAV; 0014 0015 class DavCollectionPrivate : public QSharedData 0016 { 0017 public: 0018 DavCollection::ContentTypes mContentTypes; 0019 QString mCTag; 0020 DavUrl mUrl; 0021 QString mDisplayName; 0022 QColor mColor; 0023 Privileges mPrivileges; 0024 }; 0025 0026 DavCollection::DavCollection() 0027 : d(new DavCollectionPrivate) 0028 { 0029 } 0030 0031 DavCollection::DavCollection(const DavUrl &url, const QString &displayName, ContentTypes contentTypes) 0032 : d(new DavCollectionPrivate) 0033 { 0034 d->mUrl = url; 0035 d->mDisplayName = displayName; 0036 d->mContentTypes = contentTypes; 0037 d->mPrivileges = KDAV::All; 0038 } 0039 0040 DavCollection::DavCollection(const DavCollection &other) = default; 0041 DavCollection::DavCollection(DavCollection &&) = default; 0042 DavCollection &DavCollection::operator=(const DavCollection &other) = default; 0043 DavCollection &DavCollection::operator=(DavCollection &&) = default; 0044 DavCollection::~DavCollection() = default; 0045 0046 void DavCollection::setCTag(const QString &ctag) 0047 { 0048 d->mCTag = ctag; 0049 } 0050 0051 QString DavCollection::CTag() const 0052 { 0053 return d->mCTag; 0054 } 0055 0056 void DavCollection::setUrl(const DavUrl &url) 0057 { 0058 d->mUrl = url; 0059 } 0060 0061 DavUrl DavCollection::url() const 0062 { 0063 return d->mUrl; 0064 } 0065 0066 void DavCollection::setDisplayName(const QString &displayName) 0067 { 0068 d->mDisplayName = displayName; 0069 } 0070 0071 QString DavCollection::displayName() const 0072 { 0073 return d->mDisplayName; 0074 } 0075 0076 void DavCollection::setColor(const QColor &color) 0077 { 0078 d->mColor = color; 0079 } 0080 0081 QColor DavCollection::color() const 0082 { 0083 return d->mColor; 0084 } 0085 0086 void DavCollection::setContentTypes(ContentTypes contentTypes) 0087 { 0088 d->mContentTypes = contentTypes; 0089 } 0090 0091 DavCollection::ContentTypes DavCollection::contentTypes() const 0092 { 0093 return d->mContentTypes; 0094 } 0095 0096 void DavCollection::setPrivileges(Privileges privs) 0097 { 0098 d->mPrivileges = privs; 0099 } 0100 0101 Privileges DavCollection::privileges() const 0102 { 0103 return d->mPrivileges; 0104 }