digiKam Developer Documentation: Digikam::DImageHistory Class Reference

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

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

## Classes
class | Entry

## Public Member Functions
| DImageHistory (const DImageHistory &other)
const FilterAction & | action (int i) const
int | actionCount () const
void | adjustCurrentUuid (const QString &uuid)
| Changes the UUID of the current (last added current) referred image.
void | adjustReferredImages ()
| Adjusts the type of a Current HistoryImageId: If it is the first entry, it becomes Original, if it is in an intermediate entry, it becomes Intermediate, if in the last entry, it stays current.
QList< FilterAction > | allActions () const
| Gets all actions which are not null.
QList< HistoryImageId > | allReferredImages () const
void | appendReferredImage (const HistoryImageId &id)
void | clearReferredImages ()
| Edit referred images.
HistoryImageId | currentReferredImage () const
QList< DImageHistory::Entry > & | entries ()
| Access entries.
const QList< DImageHistory::Entry > & | entries () const
bool | hasActions () const
| Access actions.
bool | hasCurrentReferredImage () const
bool | hasFilters () const
bool | hasOriginalReferredImage () const
bool | hasReferredImageOfType (HistoryImageId::Type type) const
bool | hasReferredImages () const
void | insertReferredImage (int entryIndex, const HistoryImageId &id)
bool | isEmpty () const
| A history is considered empty if there are no entries.
bool | isNull () const
| A history is null if it is constructed with the default constructor.
bool | isValid () const
| A history is a valid history (telling something about the past), if the history is not empty, and there is at least one referred image other than the "Current" entry, or there is a valid action.
void | moveCurrentReferredImage (const QString &newPath, const QString &newFileName)
| Change file path entries of the current referred image.
bool | operator!= (const DImageHistory &other) const
bool | operator< (const DImageHistory &other) const
DImageHistory & | operator<< (const FilterAction &action)
| Appends a new filter action to the history.
DImageHistory & | operator<< (const HistoryImageId &imageId)
| Appends a new referred image, representing the current state of the history.
DImageHistory & | operator= (const DImageHistory &other)
bool | operator== (const DImageHistory &other) const
bool | operator> (const DImageHistory &other) const
Entry & | operator[] (int i)
const Entry & | operator[] (int i) const
HistoryImageId | originalReferredImage () const
void | purgePathFromReferredImages (const QString &path, const QString &fileName)
| Remove file path entries pointing to the given absolute path from any referred images.
QList< HistoryImageId > & | referredImages (int i)
| Access referred images.
const QList< HistoryImageId > & | referredImages (int i) const
QList< HistoryImageId > | referredImagesOfType (HistoryImageId::Type type) const
void | removeLast ()
| Removes the last entry from the history.
int | size () const
QString | toXml () const
| Serialize toand from XML.

## Static Public Member Functions
static DImageHistory | fromXml (const QString &xml)

## Member Function Documentation

## ◆ actionCount()

int Digikam::DImageHistory::actionCount | ( |  | ) | const

Returns
  The number of non-null actions

## ◆ clearReferredImages()

void Digikam::DImageHistory::clearReferredImages | ( |  | ) |

Remove all referredImages, leaving the entries list untouched

## ◆ entries()

QList< DImageHistory::Entry > & Digikam::DImageHistory::entries | ( |  | ) |

There are size() entries.

## ◆ hasActions()

bool Digikam::DImageHistory::hasActions | ( |  | ) | const

There is one action per entry, but the action may be null.

Returns
  True if there is any non-null action

## ◆ operator<<()

DImageHistory & Digikam::DImageHistory::operator<< | ( | const HistoryImageId & | imageId | ) |

If you add an id of type Current, adjustReferredImages() will be called.

## ◆ purgePathFromReferredImages()

void Digikam::DImageHistory::purgePathFromReferredImages | ( | const QString & | path,
|  | const QString & | fileName
| ) |  |

This is useful when said file is about to be overwritten. All other HistoryImageId fields remain unchanged, no HistoryImageId is removed. path: directory path, without filename.

## ◆ size()

int Digikam::DImageHistory::size | ( |  | ) | const

Returns
  The number of entries

## ◆ toXml()

QString Digikam::DImageHistory::toXml | ( |  | ) | const

Note
  The "Current" entry is skipped when writing to XML, so make sure the file into the metadata of which you write the XML, is the file marked as "Current" in this history.