KContacts

calendarurl.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2015-2019 Laurent Montel <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef CALENDARURL_H
9 #define CALENDARURL_H
10 #include "kcontacts_export.h"
11 
12 #include <QMap>
13 #include <QSharedDataPointer>
14 #include <QString>
15 class QUrl;
16 
17 namespace KContacts
18 {
19 /** @short Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
20  * @since 4.14.6
21  */
22 class KCONTACTS_EXPORT CalendarUrl
23 {
24  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const CalendarUrl &);
25  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, CalendarUrl &);
26 
27 public:
28  enum CalendarType {
29  Unknown = 0,
30  FBUrl,
31  CALUri,
32  CALADRUri,
33  EndCalendarType,
34  };
35 
36  CalendarUrl();
37  CalendarUrl(CalendarUrl::CalendarType type);
38  CalendarUrl(const CalendarUrl &other);
39 
40  ~CalendarUrl();
41 
42  typedef QVector<CalendarUrl> List;
43 
44  Q_REQUIRED_RESULT bool isValid() const;
45 
46  void setType(CalendarUrl::CalendarType type);
47  Q_REQUIRED_RESULT CalendarUrl::CalendarType type() const;
48 
49  void setUrl(const QUrl &url);
50  QUrl url() const;
51 
52  void setParameters(const QMap<QString, QStringList> &params);
53  Q_REQUIRED_RESULT QMap<QString, QStringList> parameters() const;
54 
55  Q_REQUIRED_RESULT bool operator==(const CalendarUrl &other) const;
56  Q_REQUIRED_RESULT bool operator!=(const CalendarUrl &other) const;
57 
58  CalendarUrl &operator=(const CalendarUrl &other);
59 
60  Q_REQUIRED_RESULT QString toString() const;
61 
62 private:
63  class Private;
65 };
66 
67 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const CalendarUrl &object);
68 
69 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, CalendarUrl &object);
70 }
71 Q_DECLARE_TYPEINFO(KContacts::CalendarUrl, Q_MOVABLE_TYPE);
72 #endif // CALENDARURL_H
QDataStream & operator>>(QDataStream &in, KDateTime::Spec &spec)
Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
Definition: calendarurl.h:22
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Sep 26 2021 22:55:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.