digiKam
Digikam::ReplaceModifier Class Reference
+ Inheritance diagram for Digikam::ReplaceModifier:

Public Types

enum  IconType { Action = 0 , Dialog }
 

Signals

void signalTokenTriggered (const QString &)
 

Public Member Functions

QString description () const
 
QPixmap icon (Rule::IconType type=Rule::Action) const
 
bool isValid () const
 
ParseResults parse (ParseSettings &settings)
 
QString parseOperation (ParseSettings &settings, const QRegularExpressionMatch &match) override
 
QRegularExpression & regExp () const
 
QPushButton * registerButton (QWidget *parent)
 
QAction * registerMenu (QMenu *parent)
 
 ReplaceModifier ()
 
virtual void reset ()
 
TokenListtokens () const
 
bool useTokenMenu () const
 

Static Public Member Functions

static QString escapeToken (const QString &token)
 

Protected Member Functions

bool addToken (const QString &id, const QString &description, const QString &actionName=QString())
 
void setDescription (const QString &desc)
 
void setIcon (const QString &pixmap)
 
void setRegExp (const QRegularExpression &regExp)
 
void setUseTokenMenu (bool value)
 

Member Enumeration Documentation

◆ IconType

enum Digikam::Rule::IconType
inherited
Enumerator
Action 
Dialog 

Constructor & Destructor Documentation

◆ ReplaceModifier()

Digikam::ReplaceModifier::ReplaceModifier ( )
explicit

Member Function Documentation

◆ addToken()

bool Digikam::Rule::addToken ( const QString &  id,
const QString &  description,
const QString &  actionName = QString() 
)
protectedinherited

◆ description()

◆ escapeToken()

QString Digikam::Rule::escapeToken ( const QString &  token)
staticinherited

Escape the token characters to make them work in regular expressions

Parameters
tokenthe token to be escaped
Returns
A token with escaped characters. This token can then be used in a regular expression

Referenced by Digikam::CameraNameOption::CameraNameOption(), Digikam::FilePropertiesOption::FilePropertiesOption(), and Digikam::TrimmedModifier::TrimmedModifier().

◆ icon()

◆ isValid()

bool Digikam::Rule::isValid ( ) const
inherited

Checks the validity of the parse object

Returns
true if valid

Referenced by Digikam::Parser::registerModifier(), and Digikam::Parser::registerOption().

◆ parse()

◆ parseOperation()

QString Digikam::ReplaceModifier::parseOperation ( ParseSettings settings,
const QRegularExpressionMatch &  match 
)
overridevirtual

TODO: describe me

Parameters
settingscontains settings
matchresult of the regular expression match done in Option::parse()
Returns

Implements Digikam::Modifier.

References Digikam::ParseSettings::str2Modify.

◆ regExp()

QRegularExpression & Digikam::Rule::regExp ( ) const
inherited

TODO: This is probably not needed anymore. Find out. returns the currently assigned regExp object. Note that it is returned as a const ref, meaning that if you use it in your custom parse operation, the main parse method has already searched for the pattern and filled in the results of this search, so that you can use QRegularExpressionMatch::captured() immediately, you don't have to search on your own.

For example when implementing the Option::parseOperation() method, get the regExp object with

 const QRegularExpression& reg = regExp();

and immediately fetch possible matches with

 const QString& param1 = reg.captured(1);
See also
Option
Modifier
Returns
a const ref to the assigned regexp object

Referenced by Digikam::Parser::parse(), Digikam::Rule::parse(), and Digikam::Rule::setRegExp().

◆ registerButton()

QPushButton * Digikam::Rule::registerButton ( QWidget *  parent)
inherited

Register a button in the parent object. By calling this method, a new button for the parser object will be created and all necessary connections will be setup.

Parameters
parentthe parent object the button will be registered for
Returns
a pointer to the newly created button

References Digikam::Token::action(), and Digikam::Rule::icon().

◆ registerMenu()

QAction * Digikam::Rule::registerMenu ( QMenu *  parent)
inherited

Register a menu action in the parent object. By calling this method, a new action for the parser object will be created and all necessary connections will be setup.

Parameters
parentthe parent object the action will be registered for
Returns
a pointer to the newly created action

References Digikam::Token::action(), and Digikam::Rule::icon().

◆ reset()

void Digikam::Rule::reset ( )
virtualinherited

Resets the parser to its initial state

Reimplemented in Digikam::UniqueModifier.

Referenced by Digikam::Parser::reset().

◆ setDescription()

void Digikam::Rule::setDescription ( const QString &  desc)
protectedinherited

◆ setIcon()

void Digikam::Rule::setIcon ( const QString &  pixmap)
protectedinherited

◆ setRegExp()

◆ setUseTokenMenu()

void Digikam::Rule::setUseTokenMenu ( bool  value)
protectedinherited

If multiple tokens have been assigned to a rule, a menu will be created. If you want to display a menu for every defined token, set this method to 'true' and re-implement the

See also
slotTokenTriggered method.
Parameters
valueboolean parameter to set token menu usage

References value.

Referenced by Digikam::CaseModifier::CaseModifier(), and Digikam::FilePropertiesOption::FilePropertiesOption().

◆ signalTokenTriggered

void Digikam::Rule::signalTokenTriggered ( const QString &  )
signalinherited

◆ tokens()

TokenList & Digikam::Rule::tokens ( ) const
inherited
Returns
a list of all registered tokens

◆ useTokenMenu()

bool Digikam::Rule::useTokenMenu ( ) const
inherited

Returns true if a token menu is used.


The documentation for this class was generated from the following files: