KCalendarCore::Attachment

KCalendarCore::Attachment Class Reference

#include <attachment.h>

Public Types

typedef QVector< AttachmentList
 

Properties

bool isBinary
 
bool isEmpty
 
bool isLocal
 
bool isUri
 
QString label
 
QString mimeType
 
bool showInline
 
int size
 
QString uri
 

Public Member Functions

 Attachment ()
 
 Attachment (const QString &uri, const QString &mime=QString())
 
 Attachment (const QByteArray &base64, const QString &mime=QString())
 
 Attachment (const Attachment &attachment)
 
 ~Attachment ()
 
QByteArray data () const
 
QByteArray decodedData () const
 
bool isBinary () const
 
bool isEmpty () const
 
bool isLocal () const
 
bool isUri () const
 
QString label () const
 
QString mimeType () const
 
bool operator!= (const Attachment &attachment) const
 
Attachmentoperator= (const Attachment &attachment)
 
bool operator== (const Attachment &attachment) const
 
void setData (const QByteArray &base64)
 
void setDecodedData (const QByteArray &data)
 
void setLabel (const QString &label)
 
void setLocal (bool local)
 
void setMimeType (const QString &mime)
 
void setShowInline (bool showinline)
 
void setUri (const QString &uri)
 
bool showInline () const
 
uint size () const
 
QString uri () const
 

Friends

KCALENDARCORE_EXPORT QDataStreamoperator<< (QDataStream &s, const KCalendarCore::Attachment &)
 
KCALENDARCORE_EXPORT QDataStreamoperator>> (QDataStream &s, KCalendarCore::Attachment &)
 

Detailed Description

Represents information related to an attachment for a Calendar Incidence.

This is not an email message attachment.

Calendar Incidence attachments consist of:

This class is used to associate files (local or remote) or other resources with a Calendar Incidence.

Definition at line 47 of file attachment.h.

Member Typedef Documentation

List of attachments.

Definition at line 64 of file attachment.h.

Constructor & Destructor Documentation

Attachment::Attachment ( )
explicit

Constructs an empty attachment.

Private class that helps to provide binary compatibility between releases.

Definition at line 55 of file attachment.cpp.

Attachment::Attachment ( const QString uri,
const QString mime = QString() 
)
explicit

Constructs an attachment consisting of a uri and a mime type.

Parameters
uriis the URI referred to by this attachment.
mimeis the (optional) MIME type of the uri

Definition at line 62 of file attachment.cpp.

Attachment::Attachment ( const QByteArray base64,
const QString mime = QString() 
)
explicit

Constructs an attachment consisting of a binary blob of data and a mime type.

Parameters
base64is the binary data in base64 format for the attachment.
mimeis the (optional) MIME type of the attachment

Definition at line 68 of file attachment.cpp.

Attachment::Attachment ( const Attachment attachment)
default

Constructs an attachment by copying another attachment.

Parameters
attachmentis the attachment to be copied.
Attachment::~Attachment ( )
default

Destroys the attachment.

Member Function Documentation

QByteArray Attachment::data ( ) const

Returns a pointer to a QByteArray containing the base64 encoded binary data of the attachment.

See also
setData(), setDecodedData()

Definition at line 106 of file attachment.cpp.

QByteArray Attachment::decodedData ( ) const

Returns a QByteArray containing the decoded base64 binary data of the attachment.

See also
setDecodedData(), setData()

Definition at line 115 of file attachment.cpp.

bool KCalendarCore::Attachment::isBinary ( ) const

Returns true if the attachment has a binary blob; false otherwise.

See also
isUri()
bool KCalendarCore::Attachment::isEmpty ( ) const

Returns whether this is an empty or default constructed object.

bool KCalendarCore::Attachment::isLocal ( ) const

Returns the attachment "local" flag.

bool KCalendarCore::Attachment::isUri ( ) const

Returns true if the attachment has a URI; false otherwise.

See also
uri(), setUri(I), isBinary()
QString KCalendarCore::Attachment::label ( ) const

Returns the attachment label string.

QString KCalendarCore::Attachment::mimeType ( ) const

Returns the MIME-type of the attachment.

See also
setMimeType()
bool Attachment::operator!= ( const Attachment attachment) const

Compare this with attachment for inequality.

Parameters
attachmentis the attachment to compare.
Returns
true if the attachments are /not/ equal; false otherwise.

Definition at line 204 of file attachment.cpp.

Attachment & Attachment::operator= ( const Attachment attachment)
default

Assignment operator.

Parameters
attachmentis the attachment to assign.
bool Attachment::operator== ( const Attachment attachment) const

Compare this with attachment for equality.

Parameters
attachmentis the attachment to compare.
Returns
true if the attachments are equal; false otherwise.

Definition at line 193 of file attachment.cpp.

void Attachment::setData ( const QByteArray base64)

Sets the base64 encoded binary blob data of the attachment.

Parameters
base64contains the base64 encoded binary data.
See also
data(), decodedData()

Definition at line 131 of file attachment.cpp.

void Attachment::setDecodedData ( const QByteArray data)

Sets the decoded attachment data.

Parameters
datais the decoded base64 binary data.
See also
decodedData(), data()

Definition at line 124 of file attachment.cpp.

void Attachment::setLabel ( const QString label)

Sets the attachment label to label, which is derived from the Calendar Incidence X-LABEL parameter.

Parameters
labelis the string to use for the attachment label.
See also
label()

Definition at line 176 of file attachment.cpp.

void Attachment::setLocal ( bool  local)

Sets the attachment "local" option, which is derived from the Calendar Incidence X-KONTACT-TYPE parameter.

Parameters
localis the flag to set (true) or unset (false) for the attachment "local" option.
See also
local()

Definition at line 186 of file attachment.cpp.

void Attachment::setMimeType ( const QString mime)

Sets the MIME-type of the attachment to mime.

Parameters
mimeis the string to use for the attachment MIME-type.
See also
mimeType()

Definition at line 156 of file attachment.cpp.

void Attachment::setShowInline ( bool  showinline)

Sets the attachment "show in-line" option, which is derived from the Calendar Incidence X-CONTENT-DISPOSITION parameter.

Parameters
showinlineis the flag to set (true) or unset (false) for the attachment "show in-line" option.
See also
showInline()

Definition at line 166 of file attachment.cpp.

void Attachment::setUri ( const QString uri)

Sets the URI for this attachment to uri.

Parameters
uriis the URI to use for the attachment.
See also
uri(), isUri()

Definition at line 95 of file attachment.cpp.

bool KCalendarCore::Attachment::showInline ( ) const

Returns the attachment "show in-line" flag.

See also
setShowInline()
uint KCalendarCore::Attachment::size ( ) const

Returns the size of the attachment, in bytes.

If the attachment is binary (i.e, there is no URI associated with the attachment) then a value of 0 is returned.

QString KCalendarCore::Attachment::uri ( ) const

Returns the URI of the attachment.

See also
setUri(), isUri()

Friends And Related Function Documentation

KCALENDARCORE_EXPORT QDataStream& operator<< ( QDataStream s,
const KCalendarCore::Attachment  
)
friend

Attachment serializer.

Since
4.12
KCALENDARCORE_EXPORT QDataStream& operator>> ( QDataStream s,
KCalendarCore::Attachment  
)
friend

Attachment deserializer.

Since
4.12

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Oct 26 2020 22:54:52 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.