KCalendarCore::Attachment

Search for usage in LXR

KCalendarCore::Attachment Class Reference

#include <attachment.h>

Public Types

typedef QList< 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 Attachment &attachment)
 
 Attachment (const QByteArray &base64, const QString &mime=QString())
 
 Attachment (const QString &uri, const QString &mime=QString())
 
 ~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
 

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 46 of file attachment.h.

Member Typedef Documentation

◆ List

List of attachments.

Definition at line 63 of file attachment.h.

Property Documentation

◆ isBinary

bool KCalendarCore::Attachment::isBinary
read

Definition at line 52 of file attachment.h.

◆ isEmpty

bool KCalendarCore::Attachment::isEmpty
read

Definition at line 49 of file attachment.h.

◆ isLocal

bool KCalendarCore::Attachment::isLocal
readwrite

Definition at line 57 of file attachment.h.

◆ isUri

bool KCalendarCore::Attachment::isUri
read

Definition at line 51 of file attachment.h.

◆ label

QString KCalendarCore::Attachment::label
readwrite

Definition at line 56 of file attachment.h.

◆ mimeType

QString KCalendarCore::Attachment::mimeType
readwrite

Definition at line 54 of file attachment.h.

◆ showInline

bool KCalendarCore::Attachment::showInline
readwrite

Definition at line 55 of file attachment.h.

◆ size

int KCalendarCore::Attachment::size
read

Definition at line 53 of file attachment.h.

◆ uri

QString KCalendarCore::Attachment::uri
readwrite

Definition at line 50 of file attachment.h.

Constructor & Destructor Documentation

◆ Attachment() [1/4]

Attachment::Attachment ( )
explicit

Constructs an empty attachment.

Private class that helps to provide binary compatibility between releases.

Definition at line 56 of file attachment.cpp.

◆ Attachment() [2/4]

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 63 of file attachment.cpp.

◆ Attachment() [3/4]

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 69 of file attachment.cpp.

◆ Attachment() [4/4]

Attachment::Attachment ( const Attachment & attachment)
default

Constructs an attachment by copying another attachment.

Parameters
attachmentis the attachment to be copied.

◆ ~Attachment()

Attachment::~Attachment ( )
default

Destroys the attachment.

Member Function Documentation

◆ data()

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 107 of file attachment.cpp.

◆ decodedData()

QByteArray Attachment::decodedData ( ) const

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

See also
setDecodedData(), setData()

Definition at line 116 of file attachment.cpp.

◆ isBinary()

bool Attachment::isBinary ( ) const

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

See also
isUri()

Definition at line 102 of file attachment.cpp.

◆ isEmpty()

bool Attachment::isEmpty ( ) const

Returns whether this is an empty or default constructed object.

Definition at line 77 of file attachment.cpp.

◆ isLocal()

bool Attachment::isLocal ( ) const

Returns the attachment "local" flag.

Definition at line 182 of file attachment.cpp.

◆ isUri()

bool Attachment::isUri ( ) const

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

See also
uri(), setUri(I), isBinary()

Definition at line 82 of file attachment.cpp.

◆ label()

QString Attachment::label ( ) const

Returns the attachment label string.

Definition at line 172 of file attachment.cpp.

◆ mimeType()

QString Attachment::mimeType ( ) const

Returns the MIME-type of the attachment.

See also
setMimeType()

Definition at line 152 of file attachment.cpp.

◆ operator!=()

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 205 of file attachment.cpp.

◆ operator=()

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

Assignment operator.

Parameters
attachmentis the attachment to assign.

◆ operator==()

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 194 of file attachment.cpp.

◆ setData()

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 132 of file attachment.cpp.

◆ setDecodedData()

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 125 of file attachment.cpp.

◆ setLabel()

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 177 of file attachment.cpp.

◆ setLocal()

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 187 of file attachment.cpp.

◆ setMimeType()

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 157 of file attachment.cpp.

◆ setShowInline()

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 167 of file attachment.cpp.

◆ setUri()

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 96 of file attachment.cpp.

◆ showInline()

bool Attachment::showInline ( ) const

Returns the attachment "show in-line" flag.

See also
setShowInline()

Definition at line 162 of file attachment.cpp.

◆ size()

uint 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.

Definition at line 140 of file attachment.cpp.

◆ uri()

QString Attachment::uri ( ) const

Returns the URI of the attachment.

See also
setUri(), isUri()

Definition at line 87 of file attachment.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.