Libkdav2

davurl.h
1 /*
2  Copyright (c) 2010 Tobias Koenig <[email protected]>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef KDAV2_DAVURL_H
20 #define KDAV2_DAVURL_H
21 
22 #include "kpimkdav2_export.h"
23 
24 #include "enums.h"
25 
26 #include <QtCore/QUrl>
27 #include <QtCore/QVector>
28 
29 namespace KDAV2
30 {
31 
32 /**
33  * @short A helper class to combine url and protocol of a DAV url.
34  */
35 class KPIMKDAV2_EXPORT DavUrl
36 {
37 public:
38  /**
39  * Defines a list of DAV url objects.
40  */
42 
43  /**
44  * Creates an empty DAV url.
45  */
46  DavUrl();
47 
48  /**
49  * Creates a new DAV url.
50  *
51  * @param url The url that identifies the DAV object.
52  * @param protocol The DAV protocol dialect that is used to retrieve the DAV object.
53  */
54  DavUrl(const QUrl &url, Protocol protocol);
55 
56  /**
57  * Sets the @p url that identifies the DAV object.
58  */
59  void setUrl(const QUrl &url);
60 
61  /**
62  * Returns the url that identifies the DAV object.
63  */
64  QUrl url() const;
65 
66  /**
67  * Returns the url in a userfriendly way without login informations.
68  */
69  QString toDisplayString() const;
70 
71  /**
72  * Sets the DAV @p protocol dialect that is used to retrieve the DAV object.
73  */
74  void setProtocol(Protocol protocol);
75 
76  /**
77  * Returns the DAV protocol dialect that is used to retrieve the DAV object.
78  */
79  Protocol protocol() const;
80 
81 private:
82  QUrl mUrl;
83  Protocol mProtocol;
84 };
85 
86 KPIMKDAV2_EXPORT QDataStream &operator<<(QDataStream &out, const DavUrl &url);
87 KPIMKDAV2_EXPORT QDataStream &operator>>(QDataStream &in, DavUrl &url);
88 KPIMKDAV2_EXPORT QDebug &operator<<(QDebug &out, const DavUrl &url);
89 
90 }
91 
92 Q_DECLARE_TYPEINFO(KDAV2::DavUrl, Q_MOVABLE_TYPE);
93 
94 #endif
A helper class to combine url and protocol of a DAV url.
Definition: davurl.h:35
QDataStream & operator<<(QDataStream &out, const KDateTime &dateTime)
QVector< DavUrl > List
Defines a list of DAV url objects.
Definition: davurl.h:41
QDataStream & operator>>(QDataStream &in, KDateTime &dateTime)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Aug 15 2022 04:07:29 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.