digiKam
metadataoption.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-08-08
7  * Description : an option to provide metadata information to the parser
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_METADATA_OPTION_H
25 #define DIGIKAM_METADATA_OPTION_H
26 
27 // Qt includes
28 
29 #include <QString>
30 
31 // Local includes
32 
33 #include "option.h"
34 #include "ruledialog.h"
35 
36 class QLineEdit;
37 
38 namespace Digikam
39 {
40 
41 class MetadataPanel;
42 
44 {
45  Q_OBJECT
46 
47 public:
48 
49  explicit MetadataOptionDialog(Rule* const parent);
50  ~MetadataOptionDialog() override;
51 
52 public:
53 
55  QLineEdit* separatorLineEdit;
56 
57 private:
58 
59  // Disable
60  explicit MetadataOptionDialog(QWidget*) = delete;
62  MetadataOptionDialog& operator=(const MetadataOptionDialog&) = delete;
63 };
64 
65 // --------------------------------------------------------
66 
67 class MetadataOption : public Option
68 {
69  Q_OBJECT
70 
71 public:
72 
73  explicit MetadataOption();
74  ~MetadataOption() override = default;
75 
76 protected:
77 
78  QString parseOperation(ParseSettings& settings, const QRegularExpressionMatch &match) override;
79 
80 private Q_SLOTS:
81 
82  void slotTokenTriggered(const QString& token) override;
83 
84 private:
85 
86  QString parseMetadata(const QString& token, ParseSettings& settings);
87 
88 private:
89 
90  // Disable
91  explicit MetadataOption(QObject*) = delete;
92  MetadataOption(const MetadataOption&) = delete;
93  MetadataOption& operator=(const MetadataOption&) = delete;
94 };
95 
96 } // namespace Digikam
97 
98 #endif // DIGIKAM_METADATA_OPTION_H
Definition: metadataoption.h:44
MetadataPanel * metadataPanel
Definition: metadataoption.h:54
QLineEdit * separatorLineEdit
Definition: metadataoption.h:55
MetadataOptionDialog(Rule *const parent)
Definition: metadataoption.cpp:50
~MetadataOptionDialog() override
Definition: metadataoption.cpp:99
Definition: metadataoption.h:68
QString parseOperation(ParseSettings &settings, const QRegularExpressionMatch &match) override
Definition: metadataoption.cpp:149
MetadataOption()
Definition: metadataoption.cpp:105
~MetadataOption() override=default
Definition: metadatapanel.h:44
Definition: option.h:35
Definition: parsesettings.h:43
Definition: ruledialog.h:38
Definition: rule.h:42
Definition: datefolderview.cpp:43