digiKam
template.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-06-20
7  * Description : Template information container.
8  *
9  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles 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_TEMPLATE_H
25 #define DIGIKAM_TEMPLATE_H
26 
27 // Qt includes
28 
29 #include <QMetaType>
30 #include <QString>
31 #include <QStringList>
32 #include <QDebug>
33 
34 // Local includes
35 
36 #include "metadatainfo.h"
37 #include "digikam_export.h"
38 #include "metaengine.h"
39 
40 namespace Digikam
41 {
42 
43 class TemplatePrivate;
44 
45 class DIGIKAM_EXPORT Template
46 {
47 public:
48 
49  explicit Template();
50  ~Template();
51 
55  bool isNull() const;
56 
60  bool isEmpty() const;
61 
65  bool operator==(const Template& t) const;
66 
67  void setTemplateTitle(const QString& title);
68  QString templateTitle() const;
69 
70  void setAuthors(const QStringList& authors);
71  void setAuthorsPosition(const QString& authorPosition);
72  void setCredit(const QString& credit);
73  void setCopyright(const MetaEngine::AltLangMap& copyright);
74  void setRightUsageTerms(const MetaEngine::AltLangMap& rightUsageTerms);
75  void setSource(const QString& source);
76  void setInstructions(const QString& instructions);
77  void setLocationInfo(const IptcCoreLocationInfo& inf);
78  void setContactInfo(const IptcCoreContactInfo& inf);
79  void setIptcSubjects(const QStringList& subjects);
80 
81  QStringList authors() const;
82  QString authorsPosition() const;
83  QString credit() const;
84  MetaEngine::AltLangMap copyright() const;
85  MetaEngine::AltLangMap rightUsageTerms() const;
86  QString source() const;
87  QString instructions() const;
88  IptcCoreLocationInfo locationInfo() const;
89  IptcCoreContactInfo contactInfo() const;
90  QStringList IptcSubjects() const;
91 
92  static QString removeTemplateTitle()
93  {
94  return QLatin1String("_REMOVE_TEMPLATE_");
95  };
96 
97 protected:
98 
103 
107  QStringList m_authors;
108 
113 
117  QString m_credit;
118 
123 
128 
132  QString m_source;
133 
137  QString m_instructions;
138 
143 
148 
152  QStringList m_subjects;
153 };
154 
156 DIGIKAM_EXPORT QDebug operator<<(QDebug dbg, const Template& t);
157 
158 } // namespace Digikam
159 
160 Q_DECLARE_METATYPE(Digikam::Template)
161 
162 #endif // DIGIKAM_TEMPLATE_H
Definition: metadatainfo.h:63
Definition: metadatainfo.h:41
QMap< QString, QString > AltLangMap
Definition: metaengine.h:143
Definition: template.h:46
IptcCoreLocationInfo m_locationInfo
Definition: template.h:142
IptcCoreContactInfo m_contactInfo
Definition: template.h:147
QString m_instructions
Definition: template.h:137
MetaEngine::AltLangMap m_rightUsageTerms
Definition: template.h:127
QString m_credit
Definition: template.h:117
MetaEngine::AltLangMap m_copyright
Definition: template.h:122
static QString removeTemplateTitle()
Definition: template.h:92
QString m_authorsPosition
Definition: template.h:112
QString m_templateTitle
Definition: template.h:95
QStringList m_authors
Definition: template.h:107
QString m_source
Definition: template.h:132
QStringList m_subjects
Definition: template.h:152
Definition: datefolderview.cpp:43
QDebug operator<<(QDebug dbg, const DbEngineParameters &p)
Definition: dbengineparameters.cpp:863
bool operator==(const SearchTextSettings &a, const SearchTextSettings &b)
Definition: searchtextbar.cpp:49