digiKam
Digikam::ItemTagPair Class Reference

Public Member Functions

void addProperty (const QString &key, const QString &value)
 
QStringList allValues (const QStringList &keys) const
 Returns value() concatenated for all given keys. More...
 
void assignTag ()
 
void clearProperties ()
 Removes all properties. More...
 
bool hasAnyProperty (const QStringList &keys) const
 Returns true if any of the properties is set. More...
 
bool hasProperty (const QString &key) const
 Returns true if the property is set. More...
 
bool hasValue (const QString &key, const QString &value) const
 Returns true of the given property and value is set. More...
 
qlonglong imageId () const
 
bool isAssigned () const
 
bool isNull () const
 
 ItemTagPair ()
 Creates a null pair. More...
 
 ItemTagPair (const ItemInfo &info, int tagId)
 
 ItemTagPair (const ItemTagPair &other)
 
 ItemTagPair (qlonglong imageId, int tagId)
 
ItemTagPairoperator= (const ItemTagPair &other)
 
QMultiMap< QString, QString > properties () const
 Returns a map of all key->value pairs. More...
 
QStringList propertyKeys () const
 Returns all set property keys. More...
 
void removeProperties (const QString &key)
 Remove all occurrences of the property. More...
 
void removeProperty (const QString &key, const QString &value)
 Remove all occurrences of the property. More...
 
void setProperty (const QString &key, const QString &value)
 Set the given property. Replaces all previous occurrences of this property. More...
 
int tagId () const
 
void unAssignTag ()
 
QString value (const QString &key) const
 Returns the value of the given property, or a null string if not set. More...
 
QStringList values (const QString &key) const
 Returns a list of values with the given property. More...
 
 ~ItemTagPair ()
 

Static Public Member Functions

static QList< ItemTagPairavailablePairs (const ItemInfo &info)
 
static QList< ItemTagPairavailablePairs (qlonglong imageId)
 

Constructor & Destructor Documentation

◆ ItemTagPair() [1/4]

Digikam::ItemTagPair::ItemTagPair ( )

Creates a null pair.

This class provides a wrapper over the Database methods to access the properties of tag / image association. It is meant to be a short-lived object, it does not listen to external database changes.

Referenced by availablePairs().

◆ ItemTagPair() [2/4]

Digikam::ItemTagPair::ItemTagPair ( qlonglong  imageId,
int  tagId 
)

Access the properties of the given image - tag pair

References imageId(), and tagId().

◆ ItemTagPair() [3/4]

Digikam::ItemTagPair::ItemTagPair ( const ItemInfo info,
int  tagId 
)

References tagId().

◆ ~ItemTagPair()

Digikam::ItemTagPair::~ItemTagPair ( )

◆ ItemTagPair() [4/4]

Digikam::ItemTagPair::ItemTagPair ( const ItemTagPair other)

Member Function Documentation

◆ addProperty()

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

Adds the given property. 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)

References Digikam::CoreDB::addImageTagProperty(), Digikam::CoreDbAccess::db(), and value().

Referenced by Digikam::FaceTagsEditor::addFaceAndTag(), Digikam::FaceTagsEditor::changeRegion(), Digikam::FaceTagsEditor::changeSuggestedName(), and Digikam::FaceUtils::writeUnconfirmedResults().

◆ allValues()

QStringList Digikam::ItemTagPair::allValues ( const QStringList &  keys) const

Returns value() concatenated for all given keys.

References values().

◆ assignTag()

void Digikam::ItemTagPair::assignTag ( )

Assigns the tag to the image

◆ availablePairs() [1/2]

◆ availablePairs() [2/2]

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

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

References imageId().

Referenced by Digikam::ItemInfo::availableItemTagPairs(), Digikam::FaceTagsEditor::faceItemTagPairs(), Digikam::FaceTagsEditor::getSuggestedNames(), Digikam::FaceTagsEditor::getTagRects(), and Digikam::FaceTagsEditor::numberOfFaces().

◆ clearProperties()

void Digikam::ItemTagPair::clearProperties ( )

◆ hasAnyProperty()

bool Digikam::ItemTagPair::hasAnyProperty ( const QStringList &  keys) const

Returns true if any of the properties is set.

Referenced by Digikam::FaceTagsEditor::faceItemTagPairs().

◆ hasProperty()

bool Digikam::ItemTagPair::hasProperty ( const QString &  key) const

Returns true if the property is set.

Referenced by Digikam::FaceTagsEditor::removeFaceAndTag().

◆ hasValue()

bool Digikam::ItemTagPair::hasValue ( const QString &  key,
const QString &  value 
) const

Returns true of the given property and value is set.

References value().

◆ imageId()

qlonglong Digikam::ItemTagPair::imageId ( ) const

Referenced by availablePairs(), and ItemTagPair().

◆ isAssigned()

bool Digikam::ItemTagPair::isAssigned ( ) const

◆ isNull()

bool Digikam::ItemTagPair::isNull ( ) const

◆ operator=()

ItemTagPair & Digikam::ItemTagPair::operator= ( const ItemTagPair other)

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

◆ removeProperties()

void Digikam::ItemTagPair::removeProperties ( const QString &  key)

◆ removeProperty()

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

◆ setProperty()

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

Set the given property. Replaces all previous occurrences of this property.

References Digikam::CoreDB::addImageTagProperty(), Digikam::CoreDbAccess::db(), removeProperties(), and value().

◆ tagId()

◆ unAssignTag()

void Digikam::ItemTagPair::unAssignTag ( )

Removes the tag from the image

Referenced by Digikam::TagModificationHelper::slotMultipleFaceTagDel().

◆ value()

QString Digikam::ItemTagPair::value ( const QString &  key) const

Returns the value of the given property, or a null string if not set.

Referenced by addProperty(), hasValue(), removeProperty(), and setProperty().

◆ values()


The documentation for this class was generated from the following files: