digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::FilterAction Class Reference
+ Inheritance diagram for Digikam::FilterAction:

Public Types

enum  Category {
  ReproducibleFilter = 0 , ComplexFilter = 1 , DocumentedHistory = 2 , CategoryFirst = ReproducibleFilter ,
  CategoryLast = DocumentedHistory
}
 
enum  Flag { ExplicitBranch = 1 << 0 }
 
typedef QFlags< FlagFlags
 

Public Member Functions

 FilterAction (const QString &identifier, int version, Category category=ReproducibleFilter)
 
void addFlag (Flags flags)
 
void addParameter (const QString &key, const QVariant &value)
 Sets parameter, removing all other values for the same key.
 
Category category () const
 
void clearParameters ()
 Clear all parameters.
 
QString description () const
 
QString displayableName () const
 
Flags flags () const
 
bool hasParameter (const QString &key) const
 
bool hasParameters () const
 Access parameters.
 
QString identifier () const
 
bool isNull () const
 
bool operator== (const FilterAction &other) const
 
QVariant & parameter (const QString &key)
 
const QVariant parameter (const QString &key) const
 
template<typename T >
parameter (const QString &key) const
 
template<typename T >
parameter (const QString &key, const T &defaultValue) const
 Read parameter with a default value: If there is a parameter for the given key, return it converted from QVariant to the template type.
 
QHash< QString, QVariant > & parameters ()
 
const QHash< QString, QVariant > & parameters () const
 
void removeFlag (Flags flags)
 
void removeParameters (const QString &key)
 Removes all parameters for key.
 
void setDescription (const QString &description)
 
void setDisplayableName (const QString &displayableName)
 
void setFlags (Flags flags)
 
void setParameters (const QHash< QString, QVariant > &params)
 Replaces parameters.
 
int version () const
 

Protected Attributes

Category m_category = ReproducibleFilter
 
QString m_description
 
QString m_displayableName
 
Flags m_flags
 
QString m_identifier
 
QHash< QString, QVariant > m_params
 
int m_version = 0
 

Member Enumeration Documentation

◆ Category

Enumerator
ReproducibleFilter 

When given the set of stored parameters and the original data, an identical result will be produced.

Note
Do not change existing values, they are written to XML in files!
ComplexFilter 

The operation is documented and a number of parameters may be known, but the identical result cannot be reproduced.

It may be possible to produce a sufficiently similar result.

DocumentedHistory 

The source images are known, a textual description may be added, but there is no way to automatically replay.

◆ Flag

Enumerator
ExplicitBranch 

The editing step of this filter action explicitly branches from the parent.

This is an optional hint that the result is meant as a new version.

Member Function Documentation

◆ description()

QString Digikam::FilterAction::description ( ) const
Returns
A description / comment for this action. In the case of DocumentedHistory, this may be the most useful value.

◆ hasParameters()

bool Digikam::FilterAction::hasParameters ( ) const

A parameters is a key -> value pair. Keys need to be unique.

◆ identifier()

QString Digikam::FilterAction::identifier ( ) const
Returns
A technical identifier for the filter used to produce this action. Can include a namespace. Example: digikam:charcoal

◆ parameter() [1/2]

template<typename T >
T Digikam::FilterAction::parameter ( const QString &  key) const
inline
Returns
Parameter converted from QVariant to given type

◆ parameter() [2/2]

template<typename T >
T Digikam::FilterAction::parameter ( const QString &  key,
const T &  defaultValue 
) const
inline

If there is no parameter, return the given default value.

◆ version()

int Digikam::FilterAction::version ( ) const
Returns
The version (>= 1) of the filter used to produce this action. When a filter / tool is found by the identifier, it can decide by the version if it supports this action and which parameters it expects.

Member Data Documentation

◆ m_category

Category Digikam::FilterAction::m_category = ReproducibleFilter
protected
Note
Value class, do not create a d-pointer