KCalCore Library
attachment.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00029 #ifndef KCALCORE_ATTACHMENT_H
00030 #define KCALCORE_ATTACHMENT_H
00031
00032 #include "kcalcore_export.h"
00033
00034 #include <QtCore/QHash>
00035 #include <QtCore/QString>
00036 #include <QtCore/QSharedPointer>
00037
00038 namespace KCalCore {
00039
00058 class KCALCORE_EXPORT Attachment
00059 {
00060 public:
00064 typedef QSharedPointer<Attachment> Ptr;
00065
00069 typedef QVector<Ptr> List;
00070
00077 explicit Attachment( const QString &uri, const QString &mime = QString() );
00078
00086 explicit Attachment( const QByteArray &base64,
00087 const QString &mime = QString() );
00088
00094 Attachment( const Attachment &attachment );
00095
00099 ~Attachment();
00100
00108 void setUri( const QString &uri );
00109
00115 QString uri() const;
00116
00122 bool isUri() const;
00123
00129 bool isBinary() const;
00130
00138 void setData( const QByteArray &base64 );
00139
00146 QByteArray data() const;
00147
00155 void setDecodedData( const QByteArray &data );
00156
00163 QByteArray decodedData() const;
00164
00170 uint size() const;
00171
00179 void setMimeType( const QString &mime );
00180
00186 QString mimeType() const;
00187
00197 void setShowInline( bool showinline );
00198
00204 bool showInline() const;
00205
00214 void setLabel( const QString &label );
00215
00219 QString label() const;
00220
00230 void setLocal( bool local );
00231
00235 bool isLocal() const;
00236
00240 Attachment &operator=( const Attachment &attachment );
00241
00247 bool operator==( const Attachment &attachment ) const;
00248
00254 bool operator!=( const Attachment &attachment ) const;
00255
00256 private:
00257
00258 class Private;
00259 Private *const d;
00260
00261 };
00262
00263 }
00264
00265 Q_DECLARE_TYPEINFO( KCalCore::Attachment::Ptr, Q_MOVABLE_TYPE );
00266
00267
00268 inline uint qHash( const QSharedPointer<KCalCore::Attachment> &key )
00269 {
00270 return qHash<KCalCore::Attachment>( key.data() );
00271 }
00272
00273
00274 #endif