KTnef::KTNEFPropertySet Class

class KTnef::KTNEFPropertySet

Interface for setting @acronym MAPI properties and @acronym TNEF attributes. More...

Header: #include <ktnefpropertyset.h>
CMake: find_package(KPim6Tnef REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::Tnef)
Inherited By:

KTnef::KTNEFAttach and KTnef::KTNEFMessage

Public Functions

KTNEFPropertySet()
~KTNEFPropertySet()
void addAttribute(int key, int type, const QVariant &value, bool overwrite = false)
void addProperty(int key, int type, const QVariant &value, const QVariant &name = QVariant(), bool overwrite = false)
QVariant attribute(int key) const
QMap<int, KTnef::KTNEFProperty *> &attributes()
const QMap<int, KTnef::KTNEFProperty *> &attributes() const
void clear(bool deleteAll = false)
QString findNamedProp(const QString &name, const QString &fallback = QString(), bool convertToUpper = false) const
QString findProp(int key, const QString &fallback = QString(), bool convertToUpper = false) const
QMap<int, KTnef::KTNEFProperty *> &properties()
const QMap<int, KTnef::KTNEFProperty *> &properties() const
QVariant property(int key) const

Detailed Description

Member Function Documentation

KTNEFPropertySet::KTNEFPropertySet()

Constructor.

[noexcept] KTNEFPropertySet::~KTNEFPropertySet()

Destructor.

void KTNEFPropertySet::addAttribute(int key, int type, const QVariant &value, bool overwrite = false)

Adds a @acronym TNEF attribute.

key is the attribute key. type is the attribute type. value is the attribute value. overwrite if true, then remove the attribute if it already exists.

void KTNEFPropertySet::addProperty(int key, int type, const QVariant &value, const QVariant &name = QVariant(), bool overwrite = false)

Adds a @acronym MAPI property.

key is the property key. type is the property type. value is the property value. name is the property name. overwrite if true, then remove the property if it already exists.

QVariant KTNEFPropertySet::attribute(int key) const

Returns the attribute associated with the specified key.

key is the @acronym TNEF key.

Returns the attribute associated with the key.

QMap<int, KTnef::KTNEFProperty *> &KTNEFPropertySet::attributes()

Returns a #QMap of all (key,@acronym TNEF) attributes.

const QMap<int, KTnef::KTNEFProperty *> &KTNEFPropertySet::attributes() const

Returns a #QMap of all (key,@acronym TNEF) attributes.

void KTNEFPropertySet::clear(bool deleteAll = false)

Clears the @acronym MAPI and @acronym TNEF maps.

deleteAll if true, delete the map memory as well.

QString KTNEFPropertySet::findNamedProp(const QString &name, const QString &fallback = QString(), bool convertToUpper = false) const

Finds a property by name, returning a formatted value.

name is the property name. fallback is the fallback formatted value to use if the name is not found. convertToUpper if true, then return the formatted value in all upper case characters.

Returns a formatted value string.

QString KTNEFPropertySet::findProp(int key, const QString &fallback = QString(), bool convertToUpper = false) const

Finds a property by key, returning a formatted value.

key is the property key. fallback is the fallback formatted value to use if the key is not found. convertToUpper if true, then return the formatted value in all upper case characters.

Returns a formatted value string.

QMap<int, KTnef::KTNEFProperty *> &KTNEFPropertySet::properties()

Returns a #QMap of all (key,@acronym MAPI) properties

const QMap<int, KTnef::KTNEFProperty *> &KTNEFPropertySet::properties() const

Returns a #QMap of all (key,@acronym MAPI) properties

QVariant KTNEFPropertySet::property(int key) const

Returns the property associated with the specified key.

key is the property key.

Returns the property.q