digiKam
replacemodifier.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2009-09-18
7  * Description : a modifier for replacing text in a token result
8  *
9  * Copyright (C) 2009-2012 by Andi Clemens <andi dot clemens at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_REPLACE_MODIFIER_H
25 #define DIGIKAM_REPLACE_MODIFIER_H
26 
27 // Local includes
28 
29 #include "modifier.h"
30 #include "ruledialog.h"
31 
32 class QCheckBox;
33 
34 namespace Ui
35 {
36 class ReplaceModifierDialogWidget;
37 }
38 
39 namespace Digikam
40 {
41 
42 class ReplaceDialog : public RuleDialog
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit ReplaceDialog(Rule* const parent);
49  ~ReplaceDialog() override;
50 
51  Ui::ReplaceModifierDialogWidget* const ui;
52 
53 private:
54 
55  // Disable
56  explicit ReplaceDialog(QWidget*) = delete;
57  ReplaceDialog(const ReplaceDialog&) = delete;
58  ReplaceDialog& operator=(const ReplaceDialog&) = delete;
59 };
60 
61 // --------------------------------------------------------
62 
63 class ReplaceModifier : public Modifier
64 {
65  Q_OBJECT
66 
67 public:
68 
69  explicit ReplaceModifier();
70  QString parseOperation(ParseSettings& settings, const QRegularExpressionMatch& match) override;
71 
72 private Q_SLOTS:
73 
74  void slotTokenTriggered(const QString& token) override;
75 
76 private:
77 
78  // Disable
79  explicit ReplaceModifier(QObject*) = delete;
80  ReplaceModifier(const ReplaceModifier&) = delete;
81  ReplaceModifier& operator=(const ReplaceModifier&) = delete;
82 };
83 
84 } // namespace Digikam
85 
86 #endif // DIGIKAM_REPLACE_MODIFIER_H
Definition: modifier.h:35
Definition: parsesettings.h:43
Definition: replacemodifier.h:43
~ReplaceDialog() override
Definition: replacemodifier.cpp:54
ReplaceDialog(Rule *const parent)
Definition: replacemodifier.cpp:44
Ui::ReplaceModifierDialogWidget *const ui
Definition: replacemodifier.h:51
Definition: replacemodifier.h:64
ReplaceModifier()
Definition: replacemodifier.cpp:61
QString parseOperation(ParseSettings &settings, const QRegularExpressionMatch &match) override
Definition: replacemodifier.cpp:114
Definition: ruledialog.h:38
Definition: rule.h:42
Definition: datefolderview.cpp:43