digiKam
|
Public Types | |
enum | IconType { Action = 0 , Dialog } |
Signals | |
void | signalTokenTriggered (const QString &) |
Public Member Functions | |
DateOption () | |
QString | description () const |
QPixmap | icon (Rule::IconType type=Rule::Action) const |
bool | isValid () const |
ParseResults | parse (ParseSettings &settings) |
QRegularExpression & | regExp () const |
QPushButton * | registerButton (QWidget *parent) |
QAction * | registerMenu (QMenu *parent) |
virtual void | reset () |
TokenList & | tokens () const |
bool | useTokenMenu () const |
~DateOption () override=default | |
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()) |
QString | parseOperation (ParseSettings &settings, const QRegularExpressionMatch &match) override |
void | setDescription (const QString &desc) |
void | setIcon (const QString &pixmap) |
void | setRegExp (const QRegularExpression ®Exp) |
void | setUseTokenMenu (bool value) |
|
inherited |
|
explicit |
References Digikam::Rule::addToken(), and Digikam::Rule::setRegExp().
|
overridedefault |
|
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(), 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(), Digikam::TrimmedModifier::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(), Digikam::TrimmedModifier::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 Digikam::TrimmedModifier::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().
|
overrideprotectedvirtual |
TODO: describe me
settings | contains settings |
match | result of the regular expression match done in Option::parse() |
Implements Digikam::Option.
References Digikam::ParseSettings::creationTime, Digikam::ItemInfo::dateTime(), Digikam::ParseSettings::fileUrl, Digikam::DateFormat::format(), Digikam::ItemInfo::fromUrl(), Digikam::ItemInfo::isNull(), Digikam::DateFormat::type(), and Digikam::DateFormat::UnixTimeStamp.
|
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(), 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(), Digikam::TrimmedModifier::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().
|
inherited |
|
inherited |
Returns true if a token menu is used.