digiKam
|
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) |
virtual void | reset () |
TokenList & | tokens () const |
TrimmedModifier () | |
bool | useTokenMenu () const |
Static Public Member Functions | |
static QString | escapeToken (const QString &token) |
Protected Slots | |
virtual void | slotTokenTriggered (const QString &) |
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 ®Exp) |
void | setUseTokenMenu (bool value) |
|
inherited |
|
explicit |
|
protectedinherited |
add a token to the parser, every parser should at least assign one token object
id | the token id string (used for parsing) |
description | the description of the token (used for example in the tooltip) |
actionName | [optional] the name of the token action (only used when the token menu is displayed) |
References Digikam::Token::action(), Digikam::Rule::description(), Digikam::Rule::signalTokenTriggered(), and Digikam::Rule::slotTokenTriggered().
Referenced by Digikam::CameraNameOption::CameraNameOption(), Digikam::CaseModifier::CaseModifier(), Digikam::DatabaseOption::DatabaseOption(), Digikam::DateOption::DateOption(), Digikam::DefaultValueModifier::DefaultValueModifier(), Digikam::DirectoryNameOption::DirectoryNameOption(), Digikam::FilePropertiesOption::FilePropertiesOption(), Digikam::MetadataOption::MetadataOption(), Digikam::RangeModifier::RangeModifier(), Digikam::RemoveDoublesModifier::RemoveDoublesModifier(), Digikam::ReplaceModifier::ReplaceModifier(), Digikam::SequenceNumberOption::SequenceNumberOption(), TrimmedModifier(), and Digikam::UniqueModifier::UniqueModifier().
|
inherited |
Referenced by Digikam::Rule::addToken(), Digikam::DefaultValueModifier::DefaultValueModifier(), Digikam::MetadataOption::MetadataOption(), Digikam::Modifier::Modifier(), Digikam::Option::Option(), Digikam::RemoveDoublesModifier::RemoveDoublesModifier(), Digikam::RuleDialog::RuleDialog(), TrimmedModifier(), and Digikam::UniqueModifier::UniqueModifier().
|
staticinherited |
Escape the token characters to make them work in regular expressions
token | the token to be escaped |
Referenced by Digikam::CameraNameOption::CameraNameOption(), Digikam::FilePropertiesOption::FilePropertiesOption(), and TrimmedModifier().
|
inherited |
|
inherited |
Checks the validity of the parse object
Referenced by Digikam::Parser::registerModifier(), and Digikam::Parser::registerOption().
|
inherited |
References Digikam::ParseResults::addEntry(), Digikam::Rule::parseOperation(), Digikam::ParseSettings::parseString, and Digikam::Rule::regExp().
Referenced by Digikam::Parser::parse().
|
overridevirtual |
TODO: describe me
settings | contains settings |
match | result of the regular expression match done in Option::parse() |
Implements Digikam::Modifier.
References Digikam::ParseSettings::str2Modify.
|
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);
Referenced by Digikam::Parser::parse(), Digikam::Rule::parse(), and Digikam::Rule::setRegExp().
|
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.
parent | the parent object the button will be registered for |
References Digikam::Token::action(), and Digikam::Rule::icon().
|
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.
parent | the parent object the action will be registered for |
References Digikam::Token::action(), and Digikam::Rule::icon().
|
virtualinherited |
Resets the parser to its initial state
Reimplemented in Digikam::UniqueModifier.
Referenced by Digikam::Parser::reset().
|
protectedinherited |
Referenced by Digikam::Modifier::Modifier(), and Digikam::Option::Option().
|
protectedinherited |
Referenced by Digikam::MetadataOption::MetadataOption(), and Digikam::Rule::Rule().
|
protectedinherited |
References Digikam::Rule::regExp().
Referenced by Digikam::CameraNameOption::CameraNameOption(), Digikam::CaseModifier::CaseModifier(), Digikam::DatabaseOption::DatabaseOption(), Digikam::DateOption::DateOption(), Digikam::DefaultValueModifier::DefaultValueModifier(), Digikam::DirectoryNameOption::DirectoryNameOption(), Digikam::FilePropertiesOption::FilePropertiesOption(), Digikam::MetadataOption::MetadataOption(), Digikam::RangeModifier::RangeModifier(), Digikam::RemoveDoublesModifier::RemoveDoublesModifier(), Digikam::ReplaceModifier::ReplaceModifier(), Digikam::SequenceNumberOption::SequenceNumberOption(), TrimmedModifier(), and Digikam::UniqueModifier::UniqueModifier().
|
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
value | boolean parameter to set token menu usage |
References value.
Referenced by Digikam::CaseModifier::CaseModifier(), and Digikam::FilePropertiesOption::FilePropertiesOption().
|
signalinherited |
Referenced by Digikam::Rule::addToken(), and Digikam::Rule::slotTokenTriggered().
|
protectedvirtualslotinherited |
References Digikam::Rule::signalTokenTriggered().
Referenced by Digikam::Rule::addToken().
|
inherited |
|
inherited |
Returns true if a token menu is used.