1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : caption values container
9
* Copyright (C) 2009-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
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)
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.
22
* ============================================================ */
24
#ifndef CAPTION_VALUES_H
25
#define CAPTION_VALUES_H
36
#include <libkexiv2/kexiv2.h>
40
#include "digikam_export.h"
42
using namespace KExiv2Iface;
47
class DIGIKAM_EXPORT CaptionValues
54
bool operator==(const CaptionValues& val) const;
61
//! kDebug() stream operator. Writes values @a val to the debug output in a nicely formatted way.
62
DIGIKAM_EXPORT QDebug operator<<(QDebug dbg, const CaptionValues& val);
64
// --------------------------------------------------------------------
66
/** A map used to store a list of Alternative Language values + author and date properties
67
The map key is the language code following RFC3066 notation
68
(like "fr-FR" for French), and the CaptionsMap value all caption properties.
70
class DIGIKAM_EXPORT CaptionsMap : public QMap<QString, CaptionValues>
77
void setData(const KExiv2::AltLangMap& comments,
78
const KExiv2::AltLangMap& authors,
79
const QString& commonAuthor,
80
const KExiv2::AltLangMap& dates);
82
void fromAltLangMap(const KExiv2::AltLangMap& map);
83
KExiv2::AltLangMap toAltLangMap() const;
85
/** Sets the author for the comments in the specified languages.
86
* If commonAuthor is not null, it will be used to set the author of all comments
87
* for which the author is not specified in the map. */
88
void setAuthorsList(const KExiv2::AltLangMap& map, const QString& commonAuthor = QString());
89
KExiv2::AltLangMap authorsList() const;
91
void setDatesList(const KExiv2::AltLangMap& map);
92
KExiv2::AltLangMap datesList() const;
95
} // namespace Digikam
97
Q_DECLARE_METATYPE(Digikam::CaptionValues)
98
Q_DECLARE_METATYPE(Digikam::CaptionsMap)
100
#endif // CAPTION_VALUES_H