![]() |
digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
|
Public Types | |
| enum | Status { MetadataInvalid , MetadataAvailable } |
| The status enum describes the result of joining several metadata sets. More... | |
| typedef QFlags< WriteComponents > | WriteComponent |
| enum | WriteComponents { WRITE_DATETIME = 1 , WRITE_TITLE = 2 , WRITE_COMMENTS = 4 , WRITE_PICKLABEL = 8 , WRITE_COLORLABEL = 16 , WRITE_RATING = 32 , WRITE_TEMPLATE = 64 , WRITE_TAGS = 128 , WRITE_POSITION = 256 , WRITE_ALL = 511 } |
| enum | WriteMode { FullWrite , FullWriteIfChanged , PartialWrite } |
Public Member Functions | |
| MetadataHub () | |
| Constructs a MetadataHub. | |
| QStringList | cleanupTags (const QStringList &toClean) |
| cleanupTags remove duplicates and obsolete tags before setting metadata | |
| void | load (const ItemInfo &info) |
| Add metadata information contained in the ItemInfo object. | |
| void | reset () |
| bool | willWriteMetadata (Digikam::MetadataHub::WriteComponent writeMode=WRITE_ALL, const MetaEngineSettingsContainer &settings=MetaEngineSettings::instance() ->settings()) const |
| With the currently applied changes, the given writeMode and settings,. | |
| bool | write (const DImg &image, WriteComponent writeMode=WRITE_ALL, bool ignoreLazySync=false, const MetaEngineSettingsContainer &settings=MetaEngineSettings::instance() ->settings()) |
| Constructs a meta engine object from the metadata stored in the given DImg object, calls the above method, and changes the stored metadata in the DImg object. | |
| bool | write (const QString &filePath, WriteComponent writeMode=WRITE_ALL, bool ignoreLazySync=false, const MetaEngineSettingsContainer &settings=MetaEngineSettings::instance() ->settings()) |
| Constructs a meta engine object for given filePath, calls the above method, writes the changes out to the file, and notifies the ItemAttributesWatch. | |
| bool | writeTags (const DMetadata &metadata, bool saveTags) |
| Used to deduplicate code from writeTags and usual write, all write to tags operations must be done here. | |
| bool | writeTags (const QString &filePath, WriteComponent writeMode=WRITE_ALL, const MetaEngineSettingsContainer &settings=MetaEngineSettings::instance() ->settings()) |
| Will write only Tags to image. | |
| void | writeToBaloo (const QString &filePath, const MetaEngineSettingsContainer &settings=MetaEngineSettings::instance() ->settings()) |
| write tags, comments and rating to KDE Nepomuk replacement: Baloo | |
| bool | writeToMetadata (const ItemInfo &info, WriteComponent writeMode=WRITE_ALL, bool ignoreLazySync=false, const MetaEngineSettingsContainer &settings=MetaEngineSettings::instance() ->settings()) |
| writeToMetadata write to metadata using image info to retrieve tags and filepath use this method when multiple image infos are loaded in hub | |
Protected Member Functions | |
| void | applyChangeNotifications () |
| void | load (const QDateTime &dateTime, const CaptionsMap &titles, const CaptionsMap &comment, int colorLabel, int pickLabel, int rating, const Template &t) |
| private common code to load dateTime, comment, color label, pick label, rating | |
| void | loadFaceTags (const ItemInfo &info) |
| void | loadTags (const QList< int > &loadedTagIds) |
| private common code to merge tags | |
| void | notifyTagDeleted (int id) |
| bool | write (DMetadata &metadata, WriteComponent writeMode=WRITE_ALL, const MetaEngineSettingsContainer &settings=MetaEngineSettings::instance() ->settings()) |
| Applies the set of metadata contained in this MetadataHub to the given meta engine object. | |
| Enumerator | |
|---|---|
| FullWrite | Write all available information. |
| FullWriteIfChanged | Do a full write if and only if.
|
| PartialWrite | Write only the changed parts. Metadata fields which cannot be changed from MetadataHub (photographer ID etc.) will never be written |
| QStringList Digikam::MetadataHub::cleanupTags | ( | const QStringList & | toClean | ) |
| toClean | tag list to be cleared and de-duplicated |
| void Digikam::MetadataHub::load | ( | const ItemInfo & | info | ) |
This method (or in combination with the other load methods) can be called multiple times on the same MetadataHub object. In this case, the metadata will be combined.
| bool Digikam::MetadataHub::willWriteMetadata | ( | Digikam::MetadataHub::WriteComponent | writeMode = WRITE_ALL, |
| const MetaEngineSettingsContainer & | settings = MetaEngineSettings::instance()->settings() |
||
| ) | const |
| writeMode | The mode to write metadata |
| settings | The metadata settings to be set |
| bool Digikam::MetadataHub::write | ( | const DImg & | image, |
| WriteComponent | writeMode = WRITE_ALL, |
||
| bool | ignoreLazySync = false, |
||
| const MetaEngineSettingsContainer & | settings = MetaEngineSettings::instance()->settings() |
||
| ) |
| bool Digikam::MetadataHub::write | ( | const QString & | filePath, |
| WriteComponent | writeMode = WRITE_ALL, |
||
| bool | ignoreLazySync = false, |
||
| const MetaEngineSettingsContainer & | settings = MetaEngineSettings::instance()->settings() |
||
| ) |
| filePath | The file path to retrieve current tags |
| writeMode | The mode to write metadata |
| ignoreLazySync | The flag to ignore the lazy sync metadata stage |
| settings | The metadata settings to be set |
|
protected |
| metadata | The metadata backend instance. |
| writeMode | The mode to write metadata. |
| settings | The MetaEngineSettingsContainer determine whether data is actually set or not. The following metadata fields may be set (depending on settings):
|
| bool Digikam::MetadataHub::writeTags | ( | const DMetadata & | metadata, |
| bool | saveTags | ||
| ) |
| metadata | meta engine object that apply changes |
| saveTags | save switch |
| bool Digikam::MetadataHub::writeTags | ( | const QString & | filePath, |
| WriteComponent | writeMode = WRITE_ALL, |
||
| const MetaEngineSettingsContainer & | settings = MetaEngineSettings::instance()->settings() |
||
| ) |
Used by TagsManager to write tags to image Other metadata are not updated.
| filePath | The file path to update current tags |
| writeMode | The mode to write metadata |
| settings | The metadata settings to be set |
| void Digikam::MetadataHub::writeToBaloo | ( | const QString & | filePath, |
| const MetaEngineSettingsContainer & | settings = MetaEngineSettings::instance()->settings() |
||
| ) |
| filePath | path to file to add comments, tags and rating |
| settings | metadata settings to be set |
| bool Digikam::MetadataHub::writeToMetadata | ( | const ItemInfo & | info, |
| WriteComponent | writeMode = WRITE_ALL, |
||
| bool | ignoreLazySync = false, |
||
| const MetaEngineSettingsContainer & | settings = MetaEngineSettings::instance()->settings() |
||
| ) |
safe method
| info | The image info to retrieve current tags |
| writeMode | The mode to write metadata |
| ignoreLazySync | The flag to ignore the lazy sync metadata stage |
| settings | The metadata settings to be set |