digiKam
|
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) | |
ItemTagPair & | operator= (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< ItemTagPair > | availablePairs (const ItemInfo &info) |
static QList< ItemTagPair > | availablePairs (qlonglong imageId) |
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().
Digikam::ItemTagPair::ItemTagPair | ( | qlonglong | imageId, |
int | tagId | ||
) |
Digikam::ItemTagPair::~ItemTagPair | ( | ) |
Digikam::ItemTagPair::ItemTagPair | ( | const ItemTagPair & | other | ) |
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().
QStringList Digikam::ItemTagPair::allValues | ( | const QStringList & | keys | ) | const |
void Digikam::ItemTagPair::assignTag | ( | ) |
Assigns the tag to the image
|
static |
|
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().
void Digikam::ItemTagPair::clearProperties | ( | ) |
Removes all properties.
References Digikam::CoreDbAccess::db(), and Digikam::CoreDB::removeImageTagProperties().
bool Digikam::ItemTagPair::hasAnyProperty | ( | const QStringList & | keys | ) | const |
Returns true if any of the properties is set.
Referenced by Digikam::FaceTagsEditor::faceItemTagPairs().
bool Digikam::ItemTagPair::hasProperty | ( | const QString & | key | ) | const |
Returns true if the property is set.
Referenced by Digikam::FaceTagsEditor::removeFaceAndTag().
bool Digikam::ItemTagPair::hasValue | ( | const QString & | key, |
const QString & | value | ||
) | const |
Returns true of the given property and value is set.
References value().
qlonglong Digikam::ItemTagPair::imageId | ( | ) | const |
Referenced by availablePairs(), and ItemTagPair().
bool Digikam::ItemTagPair::isAssigned | ( | ) | const |
Returns if the tag is assigned to the image
Referenced by Digikam::FaceTagsEditor::removeAllFaces(), Digikam::FaceTagsEditor::removeFace(), Digikam::FaceTagsEditor::removeFaceAndTag(), and Digikam::TagModificationHelper::slotMultipleFaceTagDel().
bool Digikam::ItemTagPair::isNull | ( | ) | const |
ItemTagPair & Digikam::ItemTagPair::operator= | ( | const ItemTagPair & | other | ) |
QMultiMap< QString, QString > Digikam::ItemTagPair::properties | ( | ) | const |
Returns a map of all key->value pairs.
QStringList Digikam::ItemTagPair::propertyKeys | ( | ) | const |
Returns all set property keys.
void Digikam::ItemTagPair::removeProperties | ( | const QString & | key | ) |
Remove all occurrences of the property.
References Digikam::CoreDbAccess::db(), and Digikam::CoreDB::removeImageTagProperties().
Referenced by Digikam::FaceTagsEditor::removeAllFaces(), setProperty(), and Digikam::TagModificationHelper::slotMultipleFaceTagDel().
void Digikam::ItemTagPair::removeProperty | ( | const QString & | key, |
const QString & | value | ||
) |
Remove all occurrences of the property.
References Digikam::CoreDbAccess::db(), Digikam::CoreDB::removeImageTagProperties(), and value().
Referenced by Digikam::FaceTagsEditor::removeFace(), and Digikam::FaceTagsEditor::removeFaceAndTag().
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().
int Digikam::ItemTagPair::tagId | ( | ) | const |
void Digikam::ItemTagPair::unAssignTag | ( | ) |
Removes the tag from the image
Referenced by Digikam::TagModificationHelper::slotMultipleFaceTagDel().
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().
QStringList Digikam::ItemTagPair::values | ( | const QString & | key | ) | const |
Returns a list of values with the given property.
Referenced by allValues(), Digikam::FaceTagsEditor::databaseFaces(), Digikam::FaceTagsEditor::faceCountForPersonInImage(), Digikam::FaceTagsEditor::getSuggestedNames(), Digikam::FaceTagsEditor::getTagRects(), Digikam::ItemLister::listFaces(), Digikam::FaceTagsEditor::numberOfFaces(), and Digikam::FaceTagsEditor::removeFace().