27 #ifndef DIGIKAM_CORE_DB_H
28 #define DIGIKAM_CORE_DB_H
32 #include <QStringList>
67 void setSetting(
const QString& keyword,
const QString&
value);
76 QString getSetting(
const QString& keyword)
const;
84 void getFilterSettings(QStringList* imageFilter, QStringList* videoFilter, QStringList* audioFilter);
90 void getUserFilterSettings(QString* imageFilterString, QString* videoFilterString, QString* audioFilterString);
95 void setFilterSettings(
const QStringList& imageFilter,
const QStringList& videoFilter,
const QStringList& audioFilter);
102 void setUserFilterSettings(
const QStringList& imageFilter,
const QStringList& videoFilter,
const QStringList& audioFilter);
104 void setIgnoreDirectoryFilterSettings(
const QStringList& ignoreDirectoryFilter);
106 void setUserIgnoreDirectoryFilterSettings(
const QStringList& ignoreDirectoryFilters);
108 void getUserIgnoreDirectoryFilterSettings(QString* ignoreDirectoryFilterString);
110 void getIgnoreDirectoryFilterSettings(QStringList* ignoreDirectoryFilter);
116 QUuid databaseUuid();
122 int getUniqueHashVersion()
const;
124 void setUniqueHashVersion(
int version);
126 bool isUniqueHashV2()
const;
144 const QString& specificPath,
const QString& label)
const;
150 void deleteAlbumRoot(
int rootId);
157 void migrateAlbumRoot(
int rootId,
const QString& identifier);
164 void setAlbumRootLabel(
int rootId,
const QString& newLabel);
171 void setAlbumRootPath(
int rootId,
const QString& newPath);
190 TagInfo getTagInfo(
int tagId)
const;
221 int addAlbum(
int albumRootId,
const QString& relativePath,
222 const QString& caption,
223 const QDate& date,
const QString& collection)
const;
234 int getAlbumForPath(
int albumRootId,
const QString& relativePath,
bool create =
true)
const;
242 QList<int> getAlbumAndSubalbumsForPath(
int albumRootId,
const QString& relativePath)
const;
248 QList<int> getAlbumsOnAlbumRoot(
int albumRootId)
const;
255 void deleteAlbum(
int albumID);
260 void makeStaleAlbum(
int albumID);
266 void deleteStaleAlbums();
273 bool copyAlbumProperties(
int srcAlbumID,
int dstAlbumID)
const;
278 void renameAlbum(
int albumID,
int newAlbumRootId,
const QString& newRelativePath);
285 void setAlbumCaption(
int albumID,
const QString& caption);
292 void setAlbumCategory(
int albumID,
const QString& category);
299 void setAlbumDate(
int albumID,
const QDate& date);
306 void setAlbumModificationDate(
int albumID,
const QDateTime& modificationDate);
313 void setAlbumIcon(
int albumID, qlonglong iconID);
320 int getAlbumRootId(
int albumID)
const;
328 QString getAlbumRelativePath(
int albumID)
const;
335 QDate getAlbumLowestDate(
int albumID)
const;
342 QDate getAlbumHighestDate(
int albumID)
const;
349 QDate getAlbumAverageDate(
int albumID)
const;
356 QPair<int, int> getNumberOfAllItemsAndAlbums(
int albumID)
const;
362 int getNumberOfItemsInAlbum(
int albumID)
const;
368 QDateTime getAlbumModificationDate(
int albumID)
const;
374 QMap<QString, QDateTime> getAlbumModificationMap(
int albumRootId)
const;
380 QMap<int, int> getNumberOfImagesInAlbums()
const;
394 int addTag(
int parentTagID,
const QString& name,
395 const QString& iconKDE, qlonglong iconID)
const;
409 void deleteTag(
int tagID);
416 void setTagName(
int tagID,
const QString& name);
426 void setTagIcon(
int tagID,
const QString& iconKDE, qlonglong iconID);
434 void setTagParentID(
int tagID,
int newParentTagID);
456 void addTagProperty(
int tagId,
const QString& property,
const QString&
value);
465 void removeTagProperties(
int tagId,
const QString& property = QString(),
const QString&
value = QString());
471 QList<int> getTagsWithProperty(
const QString& property)
const;
491 const QString& name,
const QString& query);
497 void deleteSearch(
int searchID);
512 QString getSearchQuery(
int searchId)
const;
519 qlonglong addItem(
int albumID,
const QString& name,
522 const QDateTime& modificationDate,
524 const QString& uniqueHash)
const;
531 void deleteItem(
int albumID,
const QString& file);
538 void deleteItem(qlonglong imageId);
544 void deleteObsoleteItem(qlonglong imageId);
582 void deleteRemovedItems();
592 qlonglong getImageId(
int albumID,
const QString& name)
const;
630 qlonglong findImageId(
int albumID,
const QString& name,
634 const QString& uniqueHash)
const;
653 QStringList getItemNamesInAlbum(
int albumID,
bool recursive =
false)
const;
665 QHash<qlonglong, QPair<int, int> > getAllItemsWithAlbum()
const;
674 qlonglong getItemFromAlbum(
int albumID,
const QString& fileName)
const;
690 QStringList getItemURLsInAlbum(
int albumID, ItemSortOrder order = NoItemSorting)
const;
706 QMap<qlonglong, QString> getItemIDsAndURLsInAlbum(
int albumID)
const;
716 QStringList getItemURLsInTag(
int tagID,
bool recursive =
false)
const;
729 QVariantList getAllCreationDates()
const;
743 int getItemAlbum(qlonglong imageID)
const;
750 QString getItemName(qlonglong imageID)
const;
760 ItemShortInfo getItemShortInfo(
int albumRootId,
const QString& relativePath,
761 const QString& name)
const;
773 void updateItem(qlonglong imageID,
775 const QDateTime& modificationDate,
777 const QString& uniqueHash);
790 void setItemAlbum(qlonglong imageID, qlonglong albumId);
795 void setItemManualOrder(qlonglong imageID, qlonglong
value);
800 void setItemModificationDate(qlonglong imageID,
const QDateTime& modificationDate);
806 void renameItem(qlonglong imageID,
const QString& newName);
820 QVariantList getImagesFields(qlonglong imageID,
821 DatabaseFields::Images imagesFields)
const;
840 void addItemInformation(qlonglong imageID,
const QVariantList& infos,
849 void changeItemInformation(qlonglong imageID,
const QVariantList& infos,
855 QVariantList getItemInformation(qlonglong imageID,
856 DatabaseFields::ItemInformation infoFields
883 void addImageMetadata(qlonglong imageID,
const QVariantList& infos,
891 void changeImageMetadata(qlonglong imageID,
const QVariantList& infos,
897 QVariantList getImageMetadata(qlonglong imageID,
914 void addVideoMetadata(qlonglong imageID,
const QVariantList& infos,
922 void changeVideoMetadata(qlonglong imageID,
const QVariantList& infos,
928 QVariantList getVideoMetadata(qlonglong imageID,
948 void addItemPosition(qlonglong imageID,
const QVariantList& infos,
956 void changeItemPosition(qlonglong imageID,
const QVariantList& infos,
962 QVariantList getItemPosition(qlonglong imageID,
965 QVariantList getItemPositions(
QList<qlonglong> imageIDs, DatabaseFields::ItemPositions fields)
const;
970 void removeItemPosition(qlonglong imageid);
975 void removeItemPositionAltitude(qlonglong imageid);
998 const QString& language = QString(),
const QString& author = QString(),
999 const QDateTime& date = QDateTime())
const;
1010 void changeImageComment(
int commentId, qlonglong imageID,
const QVariantList& infos,
1016 void removeImageComment(
int commentId, qlonglong imageid);
1021 QString getImageProperty(qlonglong imageID,
const QString& property)
const;
1026 void setImageProperty(qlonglong imageID,
const QString& property,
const QString&
value);
1027 void removeImageProperty(qlonglong imageID,
const QString& property);
1028 void removeImagePropertyByName(
const QString& property);
1034 QList<CopyrightInfo> getItemCopyright(qlonglong imageID,
const QString& property = QString())
const;
1040 PropertyNoConstraint
1046 void setItemCopyrightProperty(qlonglong imageID,
const QString& property,
1047 const QString&
value,
const QString& extraValue = QString(),
1048 CopyrightPropertyUnique uniqueness = PropertyUnique);
1056 void removeItemCopyrightProperties(qlonglong imageID,
const QString& property = QString(),
1057 const QString& extraValue = QString(),
1058 const QString&
value = QString() );
1063 QList<qlonglong> findByNameAndCreationDate(
const QString& fileName,
const QDateTime& creationDate)
const;
1073 QString getImageUuid(qlonglong imageId)
const;
1083 void setItemHistory(qlonglong imageId,
const QString& history);
1084 void setImageUuid(qlonglong imageId,
const QString& uuid);
1090 bool hasImageHistory(qlonglong imageId)
const;
1121 bool hasImagesRelatedFrom(qlonglong subjectId,
1123 QVector<QList<qlonglong> > getImagesRelatedFrom(
const QList<qlonglong>& subjectIds,
1132 bool hasImagesRelatingTo(qlonglong objectId,
1134 QVector<QList<qlonglong> > getImagesRelatingTo(
const QList<qlonglong>& objectIds,
1165 QStringList getDirtyOrMissingFaceImageUrls()
const;
1176 QList<ItemScanInfo> getIdenticalFiles(
const QString& uniqueHash, qlonglong fileSize, qlonglong sourceId = -1)
const;
1182 QStringList getItemsURLsWithTag(
int tagId)
const;
1192 void addItemTag(qlonglong imageID,
int tagID,
bool newTag =
false);
1200 void addItemTag(
int albumID,
const QString& name,
int tagID);
1213 void removeItemTag(qlonglong imageID,
int tagID);
1220 void removeItemAllTags(qlonglong imageID,
const QList<int>& currentTagIds);
1233 QStringList getItemTagNames(qlonglong imageID)
const;
1240 QList<int> getItemTagIDs(qlonglong imageID)
const;
1246 QVector<QList<int> > getItemsTagIDs(
const QList<qlonglong>& imageIds)
const;
1257 QList<int> getTagIdsWithProperties(qlonglong imageId)
const;
1264 void addImageTagProperty(qlonglong imageId,
int tagId,
const QString& property,
const QString&
value);
1275 void removeImageTagProperties(qlonglong imageId,
int tagId = -1,
const QString& property = QString(),
1276 const QString&
value = QString());
1298 QMap<int, int> getNumberOfImagesInTags()
const;
1304 QMap<int, int> getNumberOfImagesInTagProperties(
const QString& property)
const;
1309 int getNumberOfImagesInTagProperties(
int tagId,
const QString& property)
const;
1314 QList<qlonglong> getImagesWithImageTagProperty(
int tagId,
const QString& property)
const;
1325 QMap<QString, int> getFormatStatistics()
const;
1331 QStringList getListFromImageMetadata(DatabaseFields::ImageMetadata field)
const;
1343 void moveItem(
int srcAlbumID,
const QString& srcName,
1344 int dstAlbumID,
const QString& dstName);
1356 int copyItem(
int srcAlbumID,
const QString& srcName,
1357 int dstAlbumID,
const QString& dstName);
1362 void copyImageAttributes(qlonglong srcId, qlonglong destId);
1367 void copyImageProperties(qlonglong srcId, qlonglong dstId);
1372 void copyImageTags(qlonglong srcId, qlonglong dstId);
1380 void clearMetadataFromImage(qlonglong imageID);
1388 int findInDownloadHistory(
const QString& identifier,
const QString& name,
1389 qlonglong fileSize,
const QDateTime& date)
const;
1395 int addToDownloadHistory(
const QString& identifier,
const QString& name,
1396 qlonglong fileSize,
const QDateTime& date)
const;
1398 QList<QVariant> getImageIdsFromArea(qreal lat1, qreal lat2, qreal lng1, qreal lng2,
1399 int sortMode,
const QString& sortBy)
const;
1406 bool integrityCheck()
const;
1415 static QStringList imagesFieldList(DatabaseFields::Images fields);
1416 static QStringList imageInformationFieldList(DatabaseFields::ItemInformation fields);
1417 static QStringList videoMetadataFieldList(DatabaseFields::VideoMetadata fields);
1418 static QStringList imageMetadataFieldList(DatabaseFields::ImageMetadata fields);
1419 static QStringList imagePositionsFieldList(DatabaseFields::ItemPositions fields);
1420 static QStringList imageCommentsFieldList(DatabaseFields::ItemComments fields);
1421 static void addBoundValuePlaceholders(QString& query,
int count);
1441 QVector<QList<qlonglong> > getRelatedImages(
QList<qlonglong> ids,
bool fromOrTo,
1450 void readSettings();
1451 void writeSettings();
CopyrightPropertyUnique
Definition: coredb.h:1037
@ PropertyUnique
Definition: coredb.h:1038
@ PropertyExtraValueUnique
Definition: coredb.h:1039
ItemSortOrder
Definition: coredb.h:637
@ ByItemPath
Definition: coredb.h:640
@ ByItemDate
Definition: coredb.h:641
@ NoItemSorting
Definition: coredb.h:638
@ ByItemName
Definition: coredb.h:639
Definition: coredbaccess.h:56
CoreDbBackend * backend() const
Definition: coredbaccess.cpp:164
Definition: coredbbackend.h:42
Definition: coredbalbuminfo.h:362
Definition: coredbalbuminfo.h:385
Definition: coredbalbuminfo.h:428
Definition: coredbalbuminfo.h:277
Definition: coredbalbuminfo.h:250
Definition: coredbalbuminfo.h:165
Definition: coredbalbuminfo.h:124
Definition: coredbalbuminfo.h:405
Definition: piwigotalker.h:48
qulonglong value
Definition: itemviewutilities.cpp:592
Type
Definition: coredbconstants.h:44
@ ItemInformationAll
Definition: coredbfields.h:94
@ ItemCommentsAll
Definition: coredbfields.h:189
@ VideoMetadataAll
Definition: coredbfields.h:225
@ ItemPositionsAll
Definition: coredbfields.h:165
@ ImageMetadataAll
Definition: coredbfields.h:130
Category
Definition: coredbconstants.h:95
Status
Definition: coredbconstants.h:85
Type
Definition: coredbconstants.h:112
@ UndefinedType
Definition: coredbconstants.h:113
Type
Definition: coredbconstants.h:60
Definition: datefolderview.cpp:43