KCalendarCore::Attachment Class

class KCalendarCore::Attachment

Represents information related to an attachment for a Calendar Incidence. More...

Header: #include <KCalendarCore/Attachment>
CMake: find_package(KF6 REQUIRED COMPONENTS CalendarCore)
target_link_libraries(mytarget PRIVATE KF6::CalendarCore)
In QML: attachment

Public Types

Properties

Public Functions

Attachment()
Attachment(const QByteArray &base64, const QString &mime = QString())
Attachment(const QString &uri, const QString &mime = QString())
Attachment(const KCalendarCore::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
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
bool operator!=(const KCalendarCore::Attachment &attachment) const
KCalendarCore::Attachment &operator=(const KCalendarCore::Attachment &attachment)
bool operator==(const KCalendarCore::Attachment &attachment) const

Detailed Description

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.

Member Type Documentation

Attachment::List

List of attachments.

Property Documentation

[read-only] isBinary : const bool

Access functions:

bool isBinary() const

[read-only] isEmpty : const bool

Access functions:

bool isEmpty() const

isLocal : bool

Access functions:

bool isLocal() const
void setLocal(bool local)

[read-only] isUri : const bool

Access functions:

bool isUri() const

label : QString

Access functions:

QString label() const
void setLabel(const QString &label)

mimeType : QString

Access functions:

QString mimeType() const
void setMimeType(const QString &mime)

showInline : bool

Access functions:

bool showInline() const
void setShowInline(bool showinline)

[read-only] size : const int

Access functions:

uint size() const

uri : QString

Access functions:

QString uri() const
void setUri(const QString &uri)

Member Function Documentation

[explicit] Attachment::Attachment()

Constructs an empty attachment.

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

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

base64 is the binary data in base64 format for the attachment.

mime is the (optional) MIME type of the attachment

[explicit] Attachment::Attachment(const QString &uri, const QString &mime = QString())

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

uri is the URI referred to by this attachment.

mime is the (optional) MIME type of the uri

Attachment::Attachment(const KCalendarCore::Attachment &attachment)

Constructs an attachment by copying another attachment.

attachment is the attachment to be copied.

[noexcept] Attachment::~Attachment()

Destroys the attachment.

QByteArray Attachment::data() const

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

See also setData() and setDecodedData().

QByteArray Attachment::decodedData() const

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

See also setDecodedData() and setData().

bool Attachment::isBinary() const

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

Note: Getter function for property isBinary.

See also isUri().

bool Attachment::isEmpty() const

Returns whether this is an empty or default constructed object.

Note: Getter function for property isEmpty.

bool Attachment::isLocal() const

Returns the attachment "local" flag.

Note: Getter function for property isLocal.

bool Attachment::isUri() const

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

Note: Getter function for property isUri.

See also uri(), setUri(), and isBinary().

QString Attachment::label() const

Returns the attachment label string.

Note: Getter function for property label.

See also setLabel().

QString Attachment::mimeType() const

Returns the MIME-type of the attachment.

Note: Getter function for property mimeType.

See also setMimeType().

void Attachment::setData(const QByteArray &base64)

Sets the base64 encoded binary blob data of the attachment.

base64 contains the base64 encoded binary data.

See also data() and decodedData().

void Attachment::setDecodedData(const QByteArray &data)

Sets the decoded attachment data.

data is the decoded base64 binary data.

See also decodedData() and data().

void Attachment::setLabel(const QString &label)

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

label is the string to use for the attachment label.

Note: Setter function for property label.

See also label().

void Attachment::setLocal(bool local)

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

local is the flag to set (true) or unset (false) for the attachment "local" option.

Note: Setter function for property isLocal.

See also isLocal().

void Attachment::setMimeType(const QString &mime)

Sets the MIME-type of the attachment to mime.

mime is the string to use for the attachment MIME-type.

Note: Setter function for property mimeType.

See also mimeType().

void Attachment::setShowInline(bool showinline)

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

showinline is the flag to set (true) or unset (false) for the attachment "show in-line" option.

Note: Setter function for property showInline.

See also showInline().

void Attachment::setUri(const QString &uri)

Sets the URI for this attachment to uri.

uri is the URI to use for the attachment.

Note: Setter function for property uri.

See also uri() and isUri().

bool Attachment::showInline() const

Returns the attachment "show in-line" flag.

Note: Getter function for property showInline.

See also setShowInline().

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.

Note: Getter function for property size.

QString Attachment::uri() const

Returns the URI of the attachment.

Note: Getter function for property uri.

See also setUri() and isUri().

bool Attachment::operator!=(const KCalendarCore::Attachment &attachment) const

Compare this with attachment for inequality.

attachment is the attachment to compare.

Returns true if the attachments are /not/ equal; false otherwise.

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

Assignment operator.

attachment is the attachment to assign.

bool Attachment::operator==(const KCalendarCore::Attachment &attachment) const

Compare this with attachment for equality.

attachment is the attachment to compare.

Returns true if the attachments are equal; false otherwise.