digiKam Developer Documentation: Digikam::DItemInfo Class Reference

| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Digikam::DItemInfo Class Reference

DItemInfo is a class to get item information from host application (Showfoto or digiKam) The interface is re-implemented in host and depend how item information must be retrieved (from a database or by file metadata). More...

## Public Member Functions
| DItemInfo (const DInfoInterface::DInfoMap &)
int | albumId () const
double | altitude () const
QString | aperture () const
CaptionsMap | captions () const
int | colorLabel () const
QString | comment () const
MetaEngine::AltLangMap | copyrightNotices () const
MetaEngine::AltLangMap | copyrights () const
QStringList | creators () const
QString | credit () const
QDateTime | dateTime () const
QSize | dimensions () const
QString | exposureTime () const
qlonglong | fileSize () const
QString | focalLength () const
QString | focalLength35mm () const
bool | hasGeolocationInfo () const
DInfoInterface::DInfoMap | infoMap () const
QStringList | keywords () const
double | latitude () const
QString | lens () const
double | longitude () const
QString | make () const
QString | model () const
QString | name () const
int | orientation () const
int | pickLabel () const
int | rating () const
QString | rights () const
QString | sensitivity () const
void | setCaptions (const CaptionsMap &)
void | setColorLabel (int)
void | setCopyrightNotices (const MetaEngine::AltLangMap &map)
void | setCopyrights (const MetaEngine::AltLangMap &map)
void | setOrientation (int)
void | setPickLabel (int)
void | setRating (int)
void | setTitles (const CaptionsMap &)
QString | source () const
QStringList | tagsPath () const
QString | title () const
CaptionsMap | titles () const
QString | videoCodec () const

## Detailed Description

The easy way to use this container is given below:

// READ INFO FROM HOST ------------------------------------------—

QUrl itemUrl; // The item url that you want to retrieve information. DInfoInterface* hostIface; // The host application interface instance.

DInfoInterface::DInfoMap info = hostIface->itemInfo(itemUrl); // First stage is to get the information map from host application. DItemInfo item(info); // Second stage, is to create the DIntenInfo instance for this item by url. QString title = item.name(); // Now you can retrieve the title, QString description = item.comment(); // The comment, QDateTime time = item.dateTime(); // The time stamp, etc.

// WRITE INFO TO HOST -------------------------------------------—

QUrl itemUrl; // The item url that you want to retrieve information. DInfoInterface* hostIface; // The host application interface instance.

DItemInfo item; // Create the DIntenInfo instance for this item with an empty internal info map. item.setRating(3); // Store rating to internal info map. item.setColorLabel(1); // Store color label to internal info map. hostIface->setItemInfo(url, item.infoMap()); // Update item information to host using internal info map.