digiKam
captionvalues.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-07-13
7  * Description : caption values 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_CAPTION_VALUES_H
25 #define DIGIKAM_CAPTION_VALUES_H
26 
27 // Qt includes
28 
29 #include <QMap>
30 #include <QString>
31 #include <QDateTime>
32 #include <QDebug>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 #include "metaengine.h"
38 
39 namespace Digikam
40 {
41 
42 class DIGIKAM_EXPORT CaptionValues
43 {
44 public:
45 
46  explicit CaptionValues();
47  ~CaptionValues();
48 
49  bool operator==(const CaptionValues& val) const;
50 
51 public:
52 
53  QString caption;
54  QString author;
55  QDateTime date;
56 };
57 
59 DIGIKAM_EXPORT QDebug operator<<(QDebug dbg, const CaptionValues& val);
60 
61 // --------------------------------------------------------------------
62 
68 class DIGIKAM_EXPORT CaptionsMap : public QMap<QString, CaptionValues>
69 {
70 public:
71 
72  explicit CaptionsMap();
73  ~CaptionsMap();
74 
75  void setData(const MetaEngine::AltLangMap& comments,
76  const MetaEngine::AltLangMap& authors,
77  const QString& commonAuthor,
78  const MetaEngine::AltLangMap& dates);
79 
80  void fromAltLangMap(const MetaEngine::AltLangMap& map);
81  MetaEngine::AltLangMap toAltLangMap() const;
82 
88  void setAuthorsList(const MetaEngine::AltLangMap& map, const QString& commonAuthor = QString());
89  MetaEngine::AltLangMap authorsList() const;
90 
91  void setDatesList(const MetaEngine::AltLangMap& map);
92  MetaEngine::AltLangMap datesList() const;
93 };
94 
95 } // namespace Digikam
96 
97 Q_DECLARE_METATYPE(Digikam::CaptionValues)
98 Q_DECLARE_METATYPE(Digikam::CaptionsMap)
99 
100 #endif // DIGIKAM_CAPTION_VALUES_H
Definition: captionvalues.h:43
QString author
Definition: captionvalues.h:54
QDateTime date
Definition: captionvalues.h:55
QString caption
Definition: captionvalues.h:53
Definition: captionvalues.h:69
QMap< QString, QString > AltLangMap
Definition: metaengine.h:143
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