• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

digikam

Digikam::AlbumDB

Digikam::AlbumDB Class Reference

#include <albumdb.h>

List of all members.


Detailed Description

Definition at line 58 of file albumdb.h.


Public Types

enum  CopyrightPropertyUnique { PropertyUnique, PropertyExtraValueUnique, PropertyNoConstraint }
enum  ItemSortOrder {
  NoItemSorting, ByItemName, ByItemPath, ByItemDate,
  ByItemRating
}

Public Member Functions

int addAlbum (int albumRootId, const QString &relativePath, const QString &caption, const QDate &date, const QString &collection)
int addAlbumRoot (AlbumRoot::Type type, const QString &identifier, const QString &specificPath, const QString &label)
void addImageInformation (qlonglong imageID, const QVariantList &infos, DatabaseFields::ImageInformation fields=DatabaseFields::ImageInformationAll)
void addImageMetadata (qlonglong imageID, const QVariantList &infos, DatabaseFields::ImageMetadata fields=DatabaseFields::ImageMetadataAll)
void addImagePosition (qlonglong imageID, const QVariantList &infos, DatabaseFields::ImagePositions fields=DatabaseFields::ImagePositionsAll)
qlonglong addItem (int albumID, const QString &name, DatabaseItem::Status status, DatabaseItem::Category category, const QDateTime &modificationDate, int fileSize, const QString &uniqueHash)
void addItemTag (int albumID, const QString &name, int tagID)
void addItemTag (qlonglong imageID, int tagID)
int addSearch (DatabaseSearch::Type type, const QString &name, const QString &query)
int addTag (int parentTagID, const QString &name, const QString &iconKDE, qlonglong iconID)
void addTagsToItems (QList< qlonglong > imageIDs, QList< int > tagIDs)
int addToDownloadHistory (const QString &identifier, const QString &name, int fileSize, const QDateTime &date)
void addToUserImageFilterSettings (const QString &filterString)
void changeAlbumRootType (int rootId, AlbumRoot::Type newType)
void changeImageComment (int commentId, qlonglong imageID, const QVariantList &infos, DatabaseFields::ImageComments fields=DatabaseFields::ImageCommentsAll)
void changeImageInformation (qlonglong imageID, const QVariantList &infos, DatabaseFields::ImageInformation fields=DatabaseFields::ImageInformationAll)
void changeImageMetadata (qlonglong imageID, const QVariantList &infos, DatabaseFields::ImageMetadata fields=DatabaseFields::ImageMetadataAll)
void changeImagePosition (qlonglong imageID, const QVariantList &infos, DatabaseFields::ImagePositions fields=DatabaseFields::ImagePositionsAll)
bool copyAlbumProperties (int srcAlbumID, int dstAlbumID)
void copyImageAttributes (qlonglong srcId, qlonglong destId)
int copyItem (int srcAlbumID, const QString &srcName, int dstAlbumID, const QString &dstName)
QUuid databaseUuid ()
void deleteAlbum (int albumID)
void deleteAlbumRoot (int rootId)
void deleteItem (int albumID, const QString &file)
void deleteRemovedItems (QList< int > albumIDs)
void deleteRemovedItems ()
void deleteSearch (int searchID)
void deleteSearches (DatabaseSearch::Type type)
void deleteStaleAlbums ()
void deleteTag (int tagID)
int findInDownloadHistory (const QString &identifier, const QString &name, int fileSize, const QDateTime &date)
QList< int > getAlbumAndSubalbumsForPath (int albumRootId, const QString &relativePath)
QDate getAlbumAverageDate (int albumID)
int getAlbumForPath (int albumRootId, const QString &relativePath, bool create=true)
QDate getAlbumHighestDate (int albumID)
bool getAlbumIcon (int albumID, int *iconAlbumRootId, QString *iconAlbumRelativePath)
QDate getAlbumLowestDate (int albumID)
QString getAlbumRelativePath (int albumID)
int getAlbumRootId (int albumID)
QList< AlbumRootInfo > getAlbumRoots ()
QList< AlbumShortInfo > getAlbumShortInfos ()
QList< QDateTime > getAllCreationDates ()
QMap< QDateTime, int > getAllCreationDatesAndNumberOfImages ()
QList< qlonglong > getDirtyOrMissingFingerprints ()
QStringList getDirtyOrMissingFingerprintURLs ()
void getFilterSettings (QStringList *imageFilter, QStringList *videoFilter, QStringList *audioFilter)
QList< ItemScanInfo > getIdenticalFiles (int fileSize, const QString &uniqueHash, qlonglong sourceId=-1)
QList< ItemScanInfo > getIdenticalFiles (qlonglong id)
QList< CommentInfo > getImageComments (qlonglong imageID)
QList< CopyrightInfo > getImageCopyright (qlonglong imageID, const QString &property=QString())
qlonglong getImageId (int albumID, const QString &name)
QVariantList getImageInformation (qlonglong imageID, DatabaseFields::ImageInformation infoFields=DatabaseFields::ImageInformationAll)
QVariantList getImageMetadata (qlonglong imageID, DatabaseFields::ImageMetadata metadataFields=DatabaseFields::ImageMetadataAll)
QVariantList getImagePosition (qlonglong imageID, DatabaseFields::ImagePositions positionFields=DatabaseFields::ImagePositionsAll)
QString getImageProperty (qlonglong imageID, const QString &property)
QVariantList getImagesFields (qlonglong imageID, DatabaseFields::Images imagesFields)
int getItemAlbum (qlonglong imageID)
QList< int > getItemCommonTagIDs (const QList< qlonglong > &imageIDList)
QMap< qlonglong, QString > getItemIDsAndURLsInAlbum (int albumID)
QList< qlonglong > getItemIDsInAlbum (int albumID)
QList< qlonglong > getItemIDsInTag (int tagID, bool recursive=false)
QString getItemName (qlonglong imageID)
QStringList getItemNamesInAlbum (int albumID, bool recurssive=false)
ItemScanInfo getItemScanInfo (qlonglong imageID)
QList< ItemScanInfo > getItemScanInfos (int albumID)
ItemShortInfo getItemShortInfo (qlonglong imageID)
QList< int > getItemTagIDs (qlonglong imageID)
QStringList getItemTagNames (qlonglong imageID)
QStringList getItemURLsInAlbum (int albumID, ItemSortOrder order=NoItemSorting)
QStringList getItemURLsInTag (int tagID, bool recursive=false)
QMap< int, int > getNumberOfImagesInAlbums ()
QMap< int, int > getNumberOfImagesInTags ()
QList< int > getRecentlyAssignedTags () const
SearchInfo getSearchInfo (int searchId)
QString getSearchQuery (int searchId)
QString getSetting (const QString &keyword)
bool getTagIcon (int tagID, int *iconAlbumRootId, QString *iconAlbumRelativePath, QString *icon)
QList< int > getTagsFromTagPaths (const QStringList &tagPaths, bool create)
void getUserFilterSettings (QString *imageFilterString, QString *videoFilterString, QString *audioFilterString)
bool hasHaarFingerprints ()
bool hasTags (const QList< qlonglong > &imageIDList)
void makeStaleAlbum (int albumID)
void moveItem (int srcAlbumID, const QString &srcName, int dstAlbumID, const QString &dstName)
void removeImageComment (int commentId, qlonglong imageid)
void removeImagePosition (qlonglong imageid)
void removeItemAllTags (qlonglong imageID)
void removeItems (QList< qlonglong > itemIDs, QList< int > albumIDs=QList< int >())
void removeItemsFromAlbum (int albumID)
void removeItemTag (qlonglong imageID, int tagID)
void removeTagsFromItems (QList< qlonglong > imageIDs, QList< int > tagIDs)
void renameAlbum (int albumID, int newAlbumRootId, const QString &newRelativePath)
AlbumInfo::List scanAlbums ()
SearchInfo::List scanSearches ()
TagInfo::List scanTags ()
void setAlbumCaption (int albumID, const QString &caption)
void setAlbumCollection (int albumID, const QString &collection)
void setAlbumDate (int albumID, const QDate &date)
void setAlbumIcon (int albumID, qlonglong iconID)
void setAlbumRootLabel (int rootId, const QString &newLabel)
void setFilterSettings (const QStringList &imageFilter, const QStringList &videoFilter, const QStringList &audioFilter)
int setImageComment (qlonglong imageID, const QString &comment, DatabaseComment::Type type, const QString &language=QString(), const QString &author=QString(), const QDateTime &date=QDateTime())
void setImageCopyrightProperty (qlonglong imageID, const QString &property, const QString &value, const QString &extraValue=QString(), CopyrightPropertyUnique uniqueness=PropertyUnique)
void setImageProperty (qlonglong imageID, const QString &property, const QString &value)
void setSetting (const QString &keyword, const QString &value)
void setTagIcon (int tagID, const QString &iconKDE, qlonglong iconID)
void setTagName (int tagID, const QString &name)
void setTagParentID (int tagID, int newParentTagID)
void setUserFilterSettings (const QString &imageFilterString, const QString &videoFilterString, const QString &audioFilterString)
void setUserFilterSettings (const QStringList &imageFilter, const QStringList &videoFilter, const QStringList &audioFilter)
void updateItem (qlonglong imageID, DatabaseItem::Category category, const QDateTime &modificationDate, int fileSize, const QString &uniqueHash)
void updateSearch (int searchID, DatabaseSearch::Type type, const QString &name, const QString &query)

Static Public Member Functions

static void addBoundValuePlaceholders (QString &query, int count)
static QStringList imageCommentsFieldList (DatabaseFields::ImageComments fields)
static QStringList imageInformationFieldList (DatabaseFields::ImageInformation fields)
static QStringList imageMetadataFieldList (DatabaseFields::ImageMetadata fields)
static QStringList imagePositionsFieldList (DatabaseFields::ImagePositions fields)
static QStringList imagesFieldList (DatabaseFields::Images fields)

Member Enumeration Documentation

enum Digikam::AlbumDB::CopyrightPropertyUnique

Sets the property with the given name for the given image to the specified value and extraValue.

Enumerator:
PropertyUnique 
PropertyExtraValueUnique 
PropertyNoConstraint 

Definition at line 830 of file albumdb.h.

enum Digikam::AlbumDB::ItemSortOrder

Enumerator:
NoItemSorting 
ByItemName 
ByItemPath 
ByItemDate 
ByItemRating 

Definition at line 524 of file albumdb.h.


Member Function Documentation

int Digikam::AlbumDB::addAlbum ( int  albumRootId,
const QString &  relativePath,
const QString &  caption,
const QDate &  date,
const QString &  collection 
)

Add a new album to the database with the given attributes.

Parameters:
albumRootId id of the album root of the new album
relativePath url of the album
caption the album caption
date the date for the album
collection the album collection
Returns:
the id of the album added or -1 if it failed

Definition at line 348 of file albumdb.cpp.

int Digikam::AlbumDB::addAlbumRoot ( AlbumRoot::Type  type,
const QString &  identifier,
const QString &  specificPath,
const QString &  label 
)

Add a new album to the database with the given attributes.

Parameters:
type The type of the album root
absolutePath The last absolute path in the file system. The usage of this parameter is up to the CollectionManager
uuid The volume UUID of the volume this album root is contained on.
specificPath The path specific to volume
label An (optional) user-visible label
Returns:
the album root id of the newly created root

Definition at line 116 of file albumdb.cpp.

void Digikam::AlbumDB::addBoundValuePlaceholders ( QString &  query,
int  count 
) [static]

Definition at line 1662 of file albumdb.cpp.

void Digikam::AlbumDB::addImageInformation ( qlonglong  imageID,
const QVariantList &  infos,
DatabaseFields::ImageInformation  fields = DatabaseFields::ImageInformationAll 
)

Add (or replace) the ImageInformation of the specified item.

If there is already an entry, it will be discarded. The QVariantList shall have 9 entries, of types in this order: 0) Int rating 1) DateTime* creationDate 2) DateTime* digitizationDate 3) Int orientation 4) Int width 5) Int height 6) String format 7) Int colorDepth 8) Int colorModel ( (*) You can provide the date also as a string in the format Qt::IsoDate) You can leave out entries from this list, which will then be filled with null values. Indicate the values that you have passed in the ImageInformation flag in the third parameters.

Definition at line 1074 of file albumdb.cpp.

void Digikam::AlbumDB::addImageMetadata ( qlonglong  imageID,
const QVariantList &  infos,
DatabaseFields::ImageMetadata  fields = DatabaseFields::ImageMetadataAll 
)

Add (or replace) the ImageMetadata of the specified item.

If there is already an entry, it will be discarded. The QVariantList shall have at most 16 entries, of types as defined in the DBSCHEMA and in metadatainfo.h, in this order: 0) String make 1) String model 2) String lens 3) Double aperture 4) Double focalLength 5) Double focalLength35 6) Double exposureTime 7) Int exposureProgram 8) Int exposureMode 9) Int sensitivity 10) Int flash 11) Int WhiteBalance 12) Int WhiteBalanceColorTemperature 13) Int meteringMode 14) Double subjectDistance 15) Double subjectDistanceCategory You can leave out entries from this list. Indicate the values that you have passed in the ImageMetadata flag in the third parameters.

Definition at line 1143 of file albumdb.cpp.

void Digikam::AlbumDB::addImagePosition ( qlonglong  imageID,
const QVariantList &  infos,
DatabaseFields::ImagePositions  fields = DatabaseFields::ImagePositionsAll 
)

Add (or replace) the ImagePosition of the specified item.

If there is already an entry, it will be discarded. The QVariantList shall have at most 10 entries, of types in this order: 0) String Latitude 1) Double LatitudeNumber 2) String Longitude 3) Double LongitudeNumber 4) Double Altitude 5) Double Orientation 6) Double Tilt 7) Double Roll 8) Double Accuracy 9) String Description You can leave out entries from this list. Indicate the values that you have passed in the ImageInfo flag in the third parameters.

Definition at line 1186 of file albumdb.cpp.

qlonglong Digikam::AlbumDB::addItem ( int  albumID,
const QString &  name,
DatabaseItem::Status  status,
DatabaseItem::Category  category,
const QDateTime &  modificationDate,
int  fileSize,
const QString &  uniqueHash 
)

Put a new item in the database or replace an existing one.

Returns:
the id of item added or -1 if it fails

Definition at line 2043 of file albumdb.cpp.

void Digikam::AlbumDB::addItemTag ( int  albumID,
const QString &  name,
int  tagID 
)

Add a tag for the item.

Parameters:
albumID the albumID of the item
name the name of the item
tagID the tagID for the tag

Definition at line 1751 of file albumdb.cpp.

void Digikam::AlbumDB::addItemTag ( qlonglong  imageID,
int  tagID 
)

Get the datetime for the item.

Parameters:
imageID the ID of the item
Returns:
the datetime for the item Get the item rating
Parameters:
imageID the ID of the item
Returns:
the rating for the item Update the date of a item to supplied date
Parameters:
imageID The ID of the item
datetime The datetime to be stored. Should try to let that be the exif-datetime, but if not available the modification date.
Returns:
It will always return true. Maybe that will change. Update the rating of a item to supplied value
Parameters:
imageID The ID of the item
rating The rating value to be stored. Get the datetime for the item
albumID the albumID of the item
name the name of the item
Returns:
the datetime for the item Update the date of a item to supplied date
Parameters:
albumID The albumID where the file is located.
name The filename
datetime The datetime to be stored. Should try to let that be the exif-datetime, but if not available the modification date.
Returns:
It will always return true. Maybe that will change. Get the caption for the item
Parameters:
imageID the id of the item
Returns:
the caption for the item Get the caption for the item
Parameters:
albumID the albumID of the item
name the name of the item
Returns:
the caption for the item Set the caption for the item
Parameters:
imageID the id of the item
caption the caption for the item Set the caption for the item
albumID the albumID of the item
name the name of the item
caption the caption for the item Add a tag for the item
imageID the ID of the item
tagID the tagID for the tag

Definition at line 1734 of file albumdb.cpp.

int Digikam::AlbumDB::addSearch ( DatabaseSearch::Type  type,
const QString &  name,
const QString &  query 
)

Add a new search to the database with the given attributes.

Parameters:
name name of the search
url url of the search
Returns:
the id of the album added or -1 if it failed

Definition at line 559 of file albumdb.cpp.

int Digikam::AlbumDB::addTag ( int  parentTagID,
const QString &  name,
const QString &  iconKDE,
qlonglong  iconID 
)

Adds a new tag to the database with given name, icon and parent id.

Parameters:
parentTagID the id of the tag which will become the new tags parent
name the name of the tag
iconKDE the name of the icon file (this is filename which kde iconloader can load up)
iconID the id of the icon file Note: if the iconKDE parameter is empty, then the iconID parameter is used
Returns:
the id of the tag added or -1 if it failed

Definition at line 459 of file albumdb.cpp.

void Digikam::AlbumDB::addTagsToItems ( QList< qlonglong >  imageIDs,
QList< int >  tagIDs 
)

Add each tag of a list of tags to each member of a list of items.

Definition at line 1766 of file albumdb.cpp.

int Digikam::AlbumDB::addToDownloadHistory ( const QString &  identifier,
const QString &  name,
int  fileSize,
const QDateTime &  date 
)

Add the specified fingerprint to the download history table.

Returns the id of the entry.

Definition at line 1689 of file albumdb.cpp.

void Digikam::AlbumDB::addToUserImageFilterSettings ( const QString &  filterString  ) 

Adds the given filters to the user image filter settings.

Definition at line 757 of file albumdb.cpp.

void Digikam::AlbumDB::changeAlbumRootType ( int  rootId,
AlbumRoot::Type  newType 
)

Sets the type of the specified album root to a new value.

Definition at line 141 of file albumdb.cpp.

void Digikam::AlbumDB::changeImageComment ( int  commentId,
qlonglong  imageID,
const QVariantList &  infos,
DatabaseFields::ImageComments  fields = DatabaseFields::ImageCommentsAll 
)

Changes the properties of a comment.

The QVariantList shall have at most 5 entries, of types in this order: 0) Int Type 1) String Language 2) String Author 3) DateTime Date 4) String Comment

Definition at line 1286 of file albumdb.cpp.

void Digikam::AlbumDB::changeImageInformation ( qlonglong  imageID,
const QVariantList &  infos,
DatabaseFields::ImageInformation  fields = DatabaseFields::ImageInformationAll 
)

Change the indicated fields of the image information for the specified item.

Fields not indicated by the fields parameter will not be touched. This method does nothing if the item does not yet have an entry in the ImageInformation table. The parameters are as for the method above.

Definition at line 1109 of file albumdb.cpp.

void Digikam::AlbumDB::changeImageMetadata ( qlonglong  imageID,
const QVariantList &  infos,
DatabaseFields::ImageMetadata  fields = DatabaseFields::ImageMetadataAll 
)

Change the indicated fields of the image information for the specified item.

This method does nothing if the item does not yet have an entry in the ImageInformation table. The parameters are as for the method above.

Definition at line 1165 of file albumdb.cpp.

void Digikam::AlbumDB::changeImagePosition ( qlonglong  imageID,
const QVariantList &  infos,
DatabaseFields::ImagePositions  fields = DatabaseFields::ImagePositionsAll 
)

Change the indicated fields of the image information for the specified item.

This method does nothing if the item does not yet have an entry in the ImageInformation table. The parameters are as for the method above.

Definition at line 1208 of file albumdb.cpp.

bool Digikam::AlbumDB::copyAlbumProperties ( int  srcAlbumID,
int  dstAlbumID 
)

Copy the properties of the given srcAlbum to the dstAlbum.

Both albums must exist.

Returns:
true if the operations succeeds

Definition at line 2952 of file albumdb.cpp.

void Digikam::AlbumDB::copyImageAttributes ( qlonglong  srcId,
qlonglong  destId 
)

Copies all image-specific information, in all tables, from image srcId to destId.

Definition at line 2881 of file albumdb.cpp.

int Digikam::AlbumDB::copyItem ( int  srcAlbumID,
const QString &  srcName,
int  dstAlbumID,
const QString &  dstName 
)

Copy the attributes of an item to a different item.

Useful when say a file is copied. The operation fails (returns -1) of src and dest are identical.

Parameters:
srcAlbumID the id of the source album
dstAlbumID the id of the destination album
srcName the name of the source file
dstName the name of the destination file
Returns:
the id of item added or -1 if it fails

Definition at line 2843 of file albumdb.cpp.

QUuid Digikam::AlbumDB::databaseUuid (  ) 

Returns a UUID for the database file.

This UUID is kept stable over schema updates.

Definition at line 773 of file albumdb.cpp.

void Digikam::AlbumDB::deleteAlbum ( int  albumID  ) 

Deletes an album from the database.

This will not delete the subalbums of the album.

Parameters:
albumID the id of the album

Definition at line 418 of file albumdb.cpp.

void Digikam::AlbumDB::deleteAlbumRoot ( int  rootId  ) 

Deletes an album root from the database.

Parameters:
rootId the id of the album root

Definition at line 127 of file albumdb.cpp.

void Digikam::AlbumDB::deleteItem ( int  albumID,
const QString &  file 
)

Deletes an item from the database.

Parameters:
albumID The id of the album.
file The filename of the file to delete.

Definition at line 2710 of file albumdb.cpp.

void Digikam::AlbumDB::deleteRemovedItems ( QList< int >  albumIDs  ) 

Delete from the database all items in the specified albums that are marked as removed.

Definition at line 2755 of file albumdb.cpp.

void Digikam::AlbumDB::deleteRemovedItems (  ) 

Delete all items from the database that are marked as removed.

Use with care!

Definition at line 2747 of file albumdb.cpp.

void Digikam::AlbumDB::deleteSearch ( int  searchID  ) 

Delete a search from the database.

Parameters:
searchID the id of the search

Definition at line 580 of file albumdb.cpp.

void Digikam::AlbumDB::deleteSearches ( DatabaseSearch::Type  type  ) 

Delete all search with the given type.

Definition at line 587 of file albumdb.cpp.

void Digikam::AlbumDB::deleteStaleAlbums (  ) 

Deletes albums from the database that were previously removed with makeStaleAlbum().

Definition at line 453 of file albumdb.cpp.

void Digikam::AlbumDB::deleteTag ( int  tagID  ) 

Deletes a tag from the database.

This will not delete the subtags of the tag.

Parameters:
tagID the id of the tag

Definition at line 489 of file albumdb.cpp.

int Digikam::AlbumDB::findInDownloadHistory ( const QString &  identifier,
const QString &  name,
int  fileSize,
const QDateTime &  date 
)

Search for the specified fingerprint in the download history table.

Returns the id of the entry, or -1 if not found.

Definition at line 1677 of file albumdb.cpp.

QList< int > Digikam::AlbumDB::getAlbumAndSubalbumsForPath ( int  albumRootId,
const QString &  relativePath 
)

Find out the album ids for a given relative path, including the subalbums.

Parameters:
albumRootId id of the album root of the album
relativePath The path for which you want the albumIDs relative to the album root
Returns:
a list of album ids. The list is empty if no albums are found.

Definition at line 2029 of file albumdb.cpp.

QDate Digikam::AlbumDB::getAlbumAverageDate ( int  albumID  ) 

Returns the average date of all images for that album.

Parameters:
albumID the id of the album to calculate
Returns:
the date.

Definition at line 2675 of file albumdb.cpp.

int Digikam::AlbumDB::getAlbumForPath ( int  albumRootId,
const QString &  relativePath,
bool  create = true 
)

Find out the album for a given folder.

Parameters:
albumRootId id of the album root of the album
relativePath The relative path for which you want the albumID relative to the album root
create If true, an album is newly created if it does not yet exist. If false, -1 is returned if no album exists.
Returns:
The albumID for that folder, or -1 if it does not exist and create is false.

Definition at line 2009 of file albumdb.cpp.

QDate Digikam::AlbumDB::getAlbumHighestDate ( int  albumID  ) 

Returns the highest/newest date of all images for that album.

Parameters:
albumID the id of the album to calculate
Returns:
the date.

Definition at line 2663 of file albumdb.cpp.

bool Digikam::AlbumDB::getAlbumIcon ( int  albumID,
int *  iconAlbumRootId,
QString *  iconAlbumRelativePath 
)

Get the image that is set as album icon.

Parameters:
albumID the id of the album
iconAlbumRootId Returns the album root id of the image
iconAlbumRelativePath Returns the path below the album root of the image
Returns:
true if there is an icon set.

Definition at line 394 of file albumdb.cpp.

QDate Digikam::AlbumDB::getAlbumLowestDate ( int  albumID  ) 

Returns the lowest/oldest date of all images for that album.

Parameters:
albumID the id of the album to calculate
Returns:
the date.

Definition at line 2651 of file albumdb.cpp.