digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::ItemTagPair Class Reference

Public Member Functions

 ItemTagPair ()
 This class provides a wrapper over the Database methods to access the properties of tag / image association.
 ItemTagPair (const ItemInfo &info, int tagId)
 ItemTagPair (const ItemTagPair &other)
 ItemTagPair (qlonglong imageId, int tagId)
 Access the properties of the given image - tag pair.
void addProperty (const QString &key, const QString &value)
 Adds the given property.
QStringList allValues (const QStringList &keys) const
void assignTag ()
 Assigns the tag to the image.
void clearProperties ()
 Removes all properties.
bool hasAnyProperty (const QStringList &keys) const
bool hasProperty (const QString &key) const
bool hasValue (const QString &key, const QString &value) const
qlonglong imageId () const
bool isAssigned () const
bool isNull () const
ItemTagPair & operator= (const ItemTagPair &other)
QMultiMap< QString, QString > properties () const
QStringList propertyKeys () const
void removeProperties (const QString &key)
 Remove all occurrences of the property.
void removeProperty (const QString &key, const QString &value)
 Remove all occurrences of the property.
void setProperty (const QString &key, const QString &value)
 Set the given property. Replaces all previous occurrences of this property.
int tagId () const
void unAssignTag ()
 Removes the tag from the image.
QString value (const QString &key) const
QStringList values (const QString &key) const

Static Public Member Functions

static QList< ItemTagPair > availablePairs (const ItemInfo &info)
static QList< ItemTagPair > availablePairs (qlonglong imageId)

Constructor & Destructor Documentation

◆ ItemTagPair()

Digikam::ItemTagPair::ItemTagPair ( )

It is meant to be a short-lived object, it does not listen to external database changes.

Creates a null pair.

Member Function Documentation

◆ addProperty()

void Digikam::ItemTagPair::addProperty ( const QString & key,
const QString & value )

Does not change any previous occurrences of this property, allowing multiple properties with the same key. (duplicates of same key and value are not added, though)

◆ allValues()

QStringList Digikam::ItemTagPair::allValues ( const QStringList & keys) const
Returns
value() concatenated for all given keys

◆ availablePairs()

QList< ItemTagPair > Digikam::ItemTagPair::availablePairs ( qlonglong imageId)
static
Returns
all pairs for the given image for which entries exist. This list of tags may not be identical to the tags assigned to the image.

◆ hasAnyProperty()

bool Digikam::ItemTagPair::hasAnyProperty ( const QStringList & keys) const
Returns
true if any of the properties is set

◆ hasProperty()

bool Digikam::ItemTagPair::hasProperty ( const QString & key) const
Returns
true if the property is set

◆ hasValue()

bool Digikam::ItemTagPair::hasValue ( const QString & key,
const QString & value ) const
Returns
true of the given property and value is set

◆ isAssigned()

bool Digikam::ItemTagPair::isAssigned ( ) const
Returns
if the tag is assigned to the image

◆ properties()

QMultiMap< QString, QString > Digikam::ItemTagPair::properties ( ) const
Returns
a map of all key->value pairs

◆ propertyKeys()

QStringList Digikam::ItemTagPair::propertyKeys ( ) const
Returns
all set property keys

◆ value()

QString Digikam::ItemTagPair::value ( const QString & key) const
Returns
the value of the given property, or a null string if not set

◆ values()

QStringList Digikam::ItemTagPair::values ( const QString & key) const
Returns
a list of values with the given property