File indexing completed on 2024-04-28 03:53:56
0001 /* 0002 SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KDAV_DAVURL_H 0008 #define KDAV_DAVURL_H 0009 0010 #include "kdav_export.h" 0011 0012 #include "enums.h" 0013 0014 #include <QList> 0015 #include <QSharedDataPointer> 0016 #include <QUrl> 0017 0018 namespace KDAV 0019 { 0020 class DavUrlPrivate; 0021 /** 0022 * @class DavUrl davurl.h <KDAV/DavUrl> 0023 * 0024 * @short A helper class to combine URL and protocol of a DAV URL. 0025 */ 0026 class KDAV_EXPORT DavUrl 0027 { 0028 public: 0029 /** 0030 * Defines a list of DAV URL objects. 0031 */ 0032 typedef QList<DavUrl> List; 0033 0034 /** 0035 * Creates an empty DAV URL. 0036 */ 0037 DavUrl(); 0038 DavUrl(const DavUrl &); 0039 DavUrl(DavUrl &&); 0040 ~DavUrl(); 0041 DavUrl &operator=(const DavUrl &); 0042 DavUrl &operator=(DavUrl &&); 0043 0044 /** 0045 * Creates a new DAV URL. 0046 * 0047 * @param url The URL that identifies the DAV object. 0048 * @param protocol The DAV protocol dialect that is used to retrieve the DAV object. 0049 */ 0050 DavUrl(const QUrl &url, Protocol protocol); 0051 0052 /** 0053 * Sets the @p url that identifies the DAV object. 0054 */ 0055 void setUrl(const QUrl &url); 0056 0057 /** 0058 * Returns the URL that identifies the DAV object. 0059 */ 0060 Q_REQUIRED_RESULT QUrl url() const; 0061 0062 /** 0063 * Returns the URL in a user-friendly way without login information. 0064 */ 0065 Q_REQUIRED_RESULT QString toDisplayString() const; 0066 0067 /** 0068 * Sets the DAV @p protocol dialect that is used to retrieve the DAV object. 0069 */ 0070 void setProtocol(Protocol protocol); 0071 0072 /** 0073 * Returns the DAV protocol dialect that is used to retrieve the DAV object. 0074 */ 0075 Q_REQUIRED_RESULT Protocol protocol() const; 0076 0077 private: 0078 QSharedDataPointer<DavUrlPrivate> d; 0079 }; 0080 0081 KDAV_EXPORT QDataStream &operator<<(QDataStream &out, const DavUrl &url); 0082 KDAV_EXPORT QDataStream &operator>>(QDataStream &in, DavUrl &url); 0083 } 0084 0085 Q_DECLARE_TYPEINFO(KDAV::DavUrl, Q_RELOCATABLE_TYPE); 0086 0087 #endif