KCalendarCore

conference.cpp
1/*
2 This file is part of the kcalcore library.
3
4 SPDX-FileCopyrightText: 2020 Daniel Vrátil <dvratil@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#include "conference.h"
10
11#include <QDataStream>
12
13using namespace KCalendarCore;
14
15/**
16 Private class that helps to provide binary compatibility between releases.
17 @internal
18*/
19//@cond PRIVATE
20class Q_DECL_HIDDEN KCalendarCore::Conference::Private : public QSharedData
21{
22public:
24 QString language;
26 QUrl uri;
27 CustomProperties customProperties;
28};
29//@endcond
30
32 : d(new Conference::Private)
33{
34}
35
36Conference::Conference(const QUrl &uri, const QString &label, const QStringList &features, const QString &language)
37 : d(new Conference::Private)
38{
39 setUri(uri);
40 setLabel(label);
41 setFeatures(features);
42 setLanguage(language);
43}
44
45Conference::Conference(const Conference &) = default;
46
47Conference::~Conference() = default;
48
49bool 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
67QUrl Conference::uri() const
68{
69 return d->uri;
70}
71
72void Conference::setUri(const QUrl &uri)
73{
74 d->uri = uri;
75}
76
77QString Conference::label() const
78{
79 return d->label;
80}
81
82void Conference::setLabel(const QString &label)
83{
84 d->label = label;
85}
86
87QStringList Conference::features() const
88{
89 return d->features;
90}
91
92void Conference::addFeature(const QString &feature)
93{
94 d->features.push_back(feature);
95}
96
98{
99 d->features.removeAll(feature);
100}
101
103{
104 d->features = features;
105}
106
107QString Conference::language() const
108{
109 return d->language;
110}
111
112void Conference::setLanguage(const QString &language)
113{
114 d->language = language;
115}
116
117void Conference::setCustomProperty(const QByteArray &xname, const QString &xvalue)
118{
119 d->customProperties.setNonKDECustomProperty(xname, xvalue);
120}
121
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}
145
146#include "moc_conference.cpp"
Represents information related to a conference information of an Calendar Incidence,...
Definition conference.h:32
void setFeatures(const QStringList &features)
Sets the list of features to features.
Conference()
Create a null Conference.
void setCustomProperty(const QByteArray &xname, const QString &xvalue)
Adds a custom property.
void setLanguage(const QString &language)
Sets the language to language.
void setLabel(const QString &label)
Sets the URI label to label.
void setUri(const QUrl &uri)
Sets the URI to @uri.
~Conference()
Destroys the conference.
void removeFeature(const QString &feature)
Removes feature from the list of features.
bool operator==(const Conference &conference) const
Compares this with conference for equality.
CustomProperties & customProperties()
Returns a reference to the CustomProperties object.
Conference & operator=(const Conference &conference)
Sets this conference equal to conference.
bool operator!=(const Conference &other) const
Compares this with conference for inequality.
void addFeature(const QString &feature)
Adds feature to the list of features.
A class to manage custom calendar properties.
QMap< QByteArray, QString > customProperties() const
Returns all custom calendar property key/value pairs.
Namespace for all KCalendarCore types.
Definition alarm.h:37
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
Alarm deserializer.
Definition alarm.cpp:833
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
Alarm serializer.
Definition alarm.cpp:820
std::vector< Feature > features(QStringView coachNumber, QStringView coachClassification)
QString label(StandardShortcut id)
void push_back(parameter_type value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.