digiKam
Loading...
Searching...
No Matches
Digikam::ItemTagPair Class Reference

#include <itemtagpair.h>

Public Member Functions

void addProperty (const QString &key, const QString &value)
 
QStringList allValues (const QStringList &keys) const
 Returns value() concatenated for all given keys.
 
void assignTag ()
 
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
 
bool isNull () const
 
 ItemTagPair ()
 
 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.
 
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 ()
 
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.
 
 ~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 ( )

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. Creates a null pair.

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 availablePairs(), and imageId().

Referenced by Digikam::ItemInfo::availableItemTagPairs(), availablePairs(), 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.

◆ 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

Returns if the tag is assigned to the image

Referenced by Digikam::FaceTagsEditor::removeFaceAndTag(), and Digikam::TagModificationHelper::slotMultipleFaceTagDel().

◆ 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()

int Digikam::ItemTagPair::tagId ( ) const

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

◆ values()

QStringList Digikam::ItemTagPair::values ( const QString &  key) const

Returns a list of values with the given property.

Referenced by allValues(), and Digikam::FaceTagsEditor::faceCountForPersonInImage().


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