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
 Returns value() concatenated for all given keys.
 
void assignTag ()
 Assigns the tag to the image.
 
void clearProperties ()
 Removes all properties.
 
bool hasAnyProperty (const QStringList &keys) const
 Returns true if any of the properties is set.
 
bool hasProperty (const QString &key) const
 Returns true if the property is set.
 
bool hasValue (const QString &key, const QString &value) const
 Returns true of the given property and value is set.
 
qlonglong imageId () const
 
bool isAssigned () const
 Returns if the tag is assigned to the image.
 
bool isNull () const
 
ItemTagPairoperator= (const ItemTagPair &other)
 
QMultiMap< QString, QString > properties () const
 Returns a map of all key->value pairs.
 
QStringList propertyKeys () const
 Returns all set property keys.
 
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
 Returns the value of the given property, or a null string if not set.
 
QStringList values (const QString &key) const
 Returns a list of values with the given property.
 

Static Public Member Functions

static QList< ItemTagPairavailablePairs (const ItemInfo &info)
 
static QList< ItemTagPairavailablePairs (qlonglong imageId)
 Return all pairs for the given image for which entries exist.
 

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)

◆ availablePairs()

QList< ItemTagPair > Digikam::ItemTagPair::availablePairs ( qlonglong  imageId)
static

This list of tags may not be identical to the tags assigned to the image.