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 #include <QDebug>
13 
14 using namespace KCalendarCore;
15 
16 /**
17  Private class that helps to provide binary compatibility between releases.
18  @internal
19 */
20 //@cond PRIVATE
21 class Q_DECL_HIDDEN KCalendarCore::Conference::Private : public QSharedData
22 {
23 public:
24  QString label;
25  QString language;
26  QStringList features;
27  QUrl uri;
28  CustomProperties customProperties;
29 };
30 //@endcond
31 
33  : d(new Conference::Private)
34 {
35 }
36 
38  : d(new Conference::Private)
39 {
40  setUri(uri);
41  setLabel(label);
42  setFeatures(features);
43  setLanguage(language);
44 }
45 
46 Conference::Conference(const Conference &) = default;
47 
48 Conference::~Conference() = default;
49 
50 bool Conference::isNull() const
51 {
52  // isNull rather than isEmpty, as user code is actually creating empty but non-null conferences...
53  return !d->uri.isValid() && d->label.isNull();
54 }
55 
57 {
58  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);
59 }
60 
62 {
63  return !operator==(other);
64 }
65 
67 
68 QUrl Conference::uri() const
69 {
70  return d->uri;
71 }
72 
74 {
75  d->uri = uri;
76 }
77 
79 {
80  return d->label;
81 }
82 
84 {
85  d->label = label;
86 }
87 
89 {
90  return d->features;
91 }
92 
93 void Conference::addFeature(const QString &feature)
94 {
95  d->features.push_back(feature);
96 }
97 
98 void Conference::removeFeature(const QString &feature)
99 {
100  d->features.removeAll(feature);
101 }
102 
104 {
105  d->features = features;
106 }
107 
109 {
110  return d->language;
111 }
112 
114 {
115  d->language = language;
116 }
117 
118 void Conference::setCustomProperty(const QByteArray &xname, const QString &xvalue)
119 {
120  d->customProperties.setNonKDECustomProperty(xname, xvalue);
121 }
122 
124 {
125  return d->customProperties;
126 }
127 
129 {
130  return d->customProperties;
131 }
132 
134 {
135  return stream << conference.d->uri << conference.d->label << conference.d->features << conference.d->language << conference.d->customProperties;
136 }
137 
139 {
140  Conference conf;
141  stream >> conf.d->uri >> conf.d->label >> conf.d->features >> conf.d->language >> conf.d->customProperties;
142  conference = conf;
143 
144  return stream;
145 }
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
Alarm serializer.
Definition: alarm.cpp:821
void setFeatures(const QStringList &features)
Sets the list of features to features.
Definition: conference.cpp:103
A class to manage custom calendar properties.
void removeFeature(const QString &feature)
Removes feature from the list of features.
Definition: conference.cpp:98
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
Alarm deserializer.
Definition: alarm.cpp:834
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:93
void setCustomProperty(const QByteArray &xname, const QString &xvalue)
Adds a custom property.
Definition: conference.cpp:118
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:61
void setLabel(const QString &label)
Sets the URI label to label.
Definition: conference.cpp:83
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:123
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:56
void setLanguage(const QString &language)
Sets the language to language.
Definition: conference.cpp:113
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:73
Conference()
Create a null Conference.
Definition: conference.cpp:32
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 Thu Apr 22 2021 22:51:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.