KCalendarCore

attachment.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
3 
4  SPDX-FileCopyrightText: 2002 Michael Brade <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
16 #ifndef KCALCORE_ATTACHMENT_H
17 #define KCALCORE_ATTACHMENT_H
18 
19 #include "kcalendarcore_export.h"
20 
21 #include <QHash>
22 #include <QString>
23 #include <QSharedDataPointer>
24 #include <QMetaType>
25 
26 namespace KCalendarCore
27 {
28 
47 class KCALENDARCORE_EXPORT Attachment
48 {
49  Q_GADGET
50  Q_PROPERTY(bool isEmpty READ isEmpty)
51  Q_PROPERTY(QString uri READ uri WRITE setUri)
52  Q_PROPERTY(bool isUri READ isUri)
53  Q_PROPERTY(bool isBinary READ isBinary)
54  Q_PROPERTY(int size READ size)
55  Q_PROPERTY(QString mimeType READ mimeType WRITE setMimeType)
56  Q_PROPERTY(bool showInline READ showInline WRITE setShowInline)
57  Q_PROPERTY(QString label READ label WRITE setLabel)
58  Q_PROPERTY(bool isLocal READ isLocal WRITE setLocal)
59 
60 public:
65 
69  explicit Attachment();
70 
77  explicit Attachment(const QString &uri, const QString &mime = QString());
78 
86  explicit Attachment(const QByteArray &base64,
87  const QString &mime = QString());
88 
94  Attachment(const Attachment &attachment);
95 
99  ~Attachment();
100 
104  bool isEmpty() const;
105 
113  void setUri(const QString &uri);
114 
120  Q_REQUIRED_RESULT QString uri() const;
121 
127  Q_REQUIRED_RESULT bool isUri() const;
128 
134  Q_REQUIRED_RESULT bool isBinary() const;
135 
143  void setData(const QByteArray &base64);
144 
151  Q_REQUIRED_RESULT QByteArray data() const;
152 
160  void setDecodedData(const QByteArray &data);
161 
168  Q_REQUIRED_RESULT QByteArray decodedData() const;
169 
175  uint size() const;
176 
184  void setMimeType(const QString &mime);
185 
191  Q_REQUIRED_RESULT QString mimeType() const;
192 
202  void setShowInline(bool showinline);
203 
209  Q_REQUIRED_RESULT bool showInline() const;
210 
219  void setLabel(const QString &label);
220 
224  Q_REQUIRED_RESULT QString label() const;
225 
235  void setLocal(bool local);
236 
240  Q_REQUIRED_RESULT bool isLocal() const;
241 
246  Attachment &operator=(const Attachment &attachment);
247 
253  bool operator==(const Attachment &attachment) const;
254 
260  bool operator!=(const Attachment &attachment) const;
261 
262 private:
263  //@cond PRIVATE
264  class Private;
266  //@endcond
267 
268  friend KCALENDARCORE_EXPORT QDataStream &operator<<(QDataStream &s, const KCalendarCore::Attachment&);
269  friend KCALENDARCORE_EXPORT QDataStream &operator>>(QDataStream &s, KCalendarCore::Attachment&);
270 };
271 
277 KCALENDARCORE_EXPORT QDataStream &operator<<(QDataStream &out, const KCalendarCore::Attachment&);
278 
284 KCALENDARCORE_EXPORT QDataStream &operator>>(QDataStream &in, KCalendarCore::Attachment&);
285 
286 }
287 
288 //@cond PRIVATE
289 Q_DECLARE_TYPEINFO(KCalendarCore::Attachment, Q_MOVABLE_TYPE);
290 Q_DECLARE_METATYPE(KCalendarCore::Attachment)
291 //@endcond
292 
293 #endif
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
Alarm serializer.
Definition: alarm.cpp:825
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
Alarm deserializer.
Definition: alarm.cpp:849
QVector< Attachment > List
List of attachments.
Definition: attachment.h:64
Represents information related to an attachment for a Calendar Incidence.
Definition: attachment.h:47
Namespace for all KCalendarCore types.
Definition: alarm.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 2 2020 22:49:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.