KCalendarCore

conference.cpp
1 /*
2  This file is part of the kcalcore library.
3 
4  SPDX-FileCopyrightText: 2020 Daniel Vr├ítil <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #include "conference.h"
10 
11 #include <QDataStream>
12 
13 using namespace KCalendarCore;
14 
15 /**
16  Private class that helps to provide binary compatibility between releases.
17  @internal
18 */
19 //@cond PRIVATE
20 class Q_DECL_HIDDEN KCalendarCore::Conference::Private : public QSharedData
21 {
22 public:
23  QString label;
24  QString language;
25  QStringList features;
26  QUrl uri;
27  CustomProperties customProperties;
28 };
29 //@endcond
30 
32  : d(new Conference::Private)
33 {
34 }
35 
37  : d(new Conference::Private)
38 {
39  setUri(uri);
40  setLabel(label);
41  setFeatures(features);
42  setLanguage(language);
43 }
44 
45 Conference::Conference(const Conference &) = default;
46 
47 Conference::~Conference() = default;
48 
49 bool Conference::isNull() const
50 {
51  // isNull rather than isEmpty, as user code is actually creating empty but non-null conferences...
52  return !d->uri.isValid() && d->label.isNull();
53 }
54 
56 {
57  return std::tie(d->label, d->language, d->features, d->uri) == std::tie(other.d->label, other.d->language, other.d->features, other.d->uri);
58 }
59 
61 {
62  return !operator==(other);
63 }
64 
66 
67 QUrl Conference::uri() const
68 {
69  return d->uri;
70 }
71 
73 {
74  d->uri = uri;
75 }
76 
78 {
79  return d->label;
80 }
81 
83 {
84  d->label = label;
85 }
86 
88 {
89  return d->features;
90 }
91 
92 void Conference::addFeature(const QString &feature)
93 {
94  d->features.push_back(feature);
95 }
96 
97 void Conference::removeFeature(const QString &feature)
98 {
99  d->features.removeAll(feature);
100 }
101 
103 {
104  d->features = features;
105 }
106 
108 {
109  return d->language;
110 }
111 
113 {
114  d->language = language;
115 }
116 
117 void Conference::setCustomProperty(const QByteArray &xname, const QString &xvalue)
118 {
119  d->customProperties.setNonKDECustomProperty(xname, xvalue);
120 }
121 
123 {
124  return d->customProperties;
125 }
126 
128 {
129  return d->customProperties;
130 }
131 
133 {
134  return stream << conference.d->uri << conference.d->label << conference.d->features << conference.d->language << conference.d->customProperties;
135 }
136 
138 {
139  Conference conf;
140  stream >> conf.d->uri >> conf.d->label >> conf.d->features >> conf.d->language >> conf.d->customProperties;
141  conference = conf;
142 
143  return stream;
144 }
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
Alarm serializer.
Definition: alarm.cpp:820
void setFeatures(const QStringList &features)
Sets the list of features to features.
Definition: conference.cpp:102
A class to manage custom calendar properties.
void removeFeature(const QString &feature)
Removes feature from the list of features.
Definition: conference.cpp:97
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
Alarm deserializer.
Definition: alarm.cpp:833
QString label() const
Returns label with additional details regarding further use of the URI.
void addFeature(const QString &feature)
Adds feature to the list of features.
Definition: conference.cpp:92
void setCustomProperty(const QByteArray &xname, const QString &xvalue)
Adds a custom property.
Definition: conference.cpp:117
QString language() const
Returns the language of the text present in other properties of this object.
Represents information related to a conference information of an Calendar Incidence, typically a meeting or task (to-do).
Definition: conference.h:31
bool operator!=(const Conference &other) const
Compares this with conference for inequality.
Definition: conference.cpp:60
void setLabel(const QString &label)
Sets the URI label to label.
Definition: conference.cpp:82
QStringList features() const
Returns the list of features of the conferencing system at given URI.
QString label(StandardShortcut id)
Conference & operator=(const Conference &conference)
Sets this conference equal to conference.
CustomProperties & customProperties()
Returns a reference to the CustomProperties object.
Definition: conference.cpp:122
QMap< QByteArray, QString > customProperties() const
Returns all custom calendar property key/value pairs.
~Conference()
Destroys the conference.
bool operator==(const Conference &conference) const
Compares this with conference for equality.
Definition: conference.cpp:55
void setLanguage(const QString &language)
Sets the language to language.
Definition: conference.cpp:112
bool isNull() const
Returns true if this is a default-constructed Conference instance.
void setUri(const QUrl &uri)
Sets the URI to .
Definition: conference.cpp:72
Conference()
Create a null Conference.
Definition: conference.cpp:31
Namespace for all KCalendarCore types.
Definition: alarm.h:36
QUrl uri() const
Returns URI to join the conference, with access code included.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Sep 24 2021 22:51:50 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.