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 class CalendarUrlTest;
18 
19 namespace KContacts
20 {
21 class ParameterMap;
22 
23 /** @short Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
24  * @since 4.14.6
25  */
26 class KCONTACTS_EXPORT CalendarUrl
27 {
28  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const CalendarUrl &);
29  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, CalendarUrl &);
30  friend class VCardTool;
31  friend class ::CalendarUrlTest;
32 
33 public:
34  enum CalendarType {
35  Unknown = 0,
36  FBUrl,
37  CALUri,
38  CALADRUri,
39  EndCalendarType,
40  };
41 
42  CalendarUrl();
43  CalendarUrl(CalendarUrl::CalendarType type);
44  CalendarUrl(const CalendarUrl &other);
45 
46  ~CalendarUrl();
47 
48  typedef QVector<CalendarUrl> List;
49 
50  Q_REQUIRED_RESULT bool isValid() const;
51 
52  void setType(CalendarUrl::CalendarType type);
53  Q_REQUIRED_RESULT CalendarUrl::CalendarType type() const;
54 
55  void setUrl(const QUrl &url);
56  QUrl url() const;
57 
58 #if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 88)
59  /**
60  * @deprecated Since 5.88 for lack of usage
61  */
62  KCONTACTS_DEPRECATED_VERSION(5, 88, "For lack of usage.")
63  void setParameters(const QMap<QString, QStringList> &params);
64 #endif
65 
66 #if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 88)
67  /**
68  * @deprecated Since 5.88 for lack of usage
69  */
70  Q_REQUIRED_RESULT
71  KCONTACTS_DEPRECATED_VERSION(5, 88, "For lack of usage.")
72  QMap<QString, QStringList> parameters() const;
73 #endif
74 
75  Q_REQUIRED_RESULT bool operator==(const CalendarUrl &other) const;
76  Q_REQUIRED_RESULT bool operator!=(const CalendarUrl &other) const;
77 
78  CalendarUrl &operator=(const CalendarUrl &other);
79 
80  Q_REQUIRED_RESULT QString toString() const;
81 
82 private:
83  // exported for CalendarUrlTest
84  void setParams(const ParameterMap &params);
85  Q_REQUIRED_RESULT ParameterMap params() const;
86 
87  class Private;
89 };
90 
91 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const CalendarUrl &object);
92 
93 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, CalendarUrl &object);
94 }
95 Q_DECLARE_TYPEINFO(KContacts::CalendarUrl, Q_MOVABLE_TYPE);
96 #endif // CALENDARURL_H
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
Definition: calendarurl.h:26
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 10 2023 03:49:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.