• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KCalCore Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kcalcore
attachment.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
3 
4  Copyright (c) 2002 Michael Brade <brade@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
29 #ifndef KCALCORE_ATTACHMENT_H
30 #define KCALCORE_ATTACHMENT_H
31 
32 #include "kcalcore_export.h"
33 
34 #include <QtCore/QHash>
35 #include <QtCore/QString>
36 #include <QtCore/QSharedPointer>
37 #include <QMetaType>
38 
39 namespace KCalCore {
40 
59 class KCALCORE_EXPORT Attachment
60 {
61 public:
65  typedef QSharedPointer<Attachment> Ptr;
66 
70  typedef QVector<Ptr> List;
71 
78  explicit Attachment(const QString &uri, const QString &mime = QString());
79 
87  explicit Attachment(const QByteArray &base64,
88  const QString &mime = QString());
89 
95  Attachment(const Attachment &attachment);
96 
100  ~Attachment();
101 
109  void setUri(const QString &uri);
110 
116  QString uri() const;
117 
123  bool isUri() const;
124 
130  bool isBinary() const;
131 
139  void setData(const QByteArray &base64);
140 
147  QByteArray data() const;
148 
156  void setDecodedData(const QByteArray &data);
157 
164  QByteArray decodedData() const;
165 
171  uint size() const;
172 
180  void setMimeType(const QString &mime);
181 
187  QString mimeType() const;
188 
198  void setShowInline(bool showinline);
199 
205  bool showInline() const;
206 
215  void setLabel(const QString &label);
216 
220  QString label() const;
221 
231  void setLocal(bool local);
232 
236  bool isLocal() const;
237 
242  Attachment &operator=(const Attachment &attachment);
243 
249  bool operator==(const Attachment &attachment) const;
250 
256  bool operator!=(const Attachment &attachment) const;
257 
258 private:
259  //@cond PRIVATE
260  class Private;
261  Private *const d;
262  //@endcond
263 
264  friend KCALCORE_EXPORT QDataStream &operator<<(QDataStream &s, const KCalCore::Attachment::Ptr &);
265  friend KCALCORE_EXPORT QDataStream &operator>>(QDataStream &s, const KCalCore::Attachment::Ptr &);
266 };
267 
273 KCALCORE_EXPORT QDataStream &operator<<(QDataStream &out, const KCalCore::Attachment::Ptr &);
274 
280 KCALCORE_EXPORT QDataStream &operator>>(QDataStream &in, const KCalCore::Attachment::Ptr &);
281 
282 }
283 
284 //@cond PRIVATE
285 Q_DECLARE_TYPEINFO(KCalCore::Attachment::Ptr, Q_MOVABLE_TYPE);
286 Q_DECLARE_METATYPE(KCalCore::Attachment::Ptr)
287 //@endcond
288 
289 //@cond PRIVATE
290 inline uint qHash(const QSharedPointer<KCalCore::Attachment> &key)
291 {
292  return qHash<KCalCore::Attachment>(key.data());
293 }
294 //@endcond
295 
296 #endif
KCalCore::Attachment::Ptr
QSharedPointer< Attachment > Ptr
A shared pointer to an Attachment object.
Definition: attachment.h:65
qHash
static uint qHash(const KDateTime &dt)
Private class that helps to provide binary compatibility between releases.
Definition: occurrenceiterator.cpp:157
KCalCore::Attachment::List
QVector< Ptr > List
List of attachments.
Definition: attachment.h:70
KCalCore::operator>>
KCALCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalCore::Alarm::Ptr &)
Alarm deserializer.
Definition: alarm.cpp:863
KCalCore::Attachment
Represents information related to an attachment for a Calendar Incidence.
Definition: attachment.h:59
KCalCore::operator<<
KCALCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalCore::Alarm::Ptr &)
Alarm serializer.
Definition: alarm.cpp:853
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

Skip menu "KCalCore Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal