1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : a generic list view item widget to
8
* display metadata key like a title
10
* Copyright (C) 2006-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
12
* This program is free software; you can redistribute it
13
* and/or modify it under the terms of the GNU General
14
* Public License as published by the Free Software Foundation;
15
* either version 2, or (at your option)
18
* This program is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* ============================================================ */
25
#include "mdkeylistviewitem.moc"
35
#include <kapplication.h>
40
#include "thememanager.h"
45
MdKeyListViewItem::MdKeyListViewItem(QTreeWidget* parent, const QString& key)
46
: QObject(parent), QTreeWidgetItem(parent)
51
// Standard Exif key descriptions.
54
m_decryptedKey = i18n("Interoperability");
56
else if (key == "Image")
58
m_decryptedKey = i18n("Image Information");
60
else if (key == "Photo")
62
m_decryptedKey = i18n("Photograph Information");
64
else if (key == "GPSInfo")
66
m_decryptedKey = i18n("Global Positioning System");
68
else if (key == "Thumbnail")
70
m_decryptedKey = i18n("Embedded Thumbnail");
73
// Standard IPTC key descriptions.
74
else if (key == "Envelope")
76
m_decryptedKey = i18n("IIM Envelope");
78
else if (key == "Application2")
80
m_decryptedKey = i18n("IIM Application 2");
83
// Standard XMP key descriptions.
84
else if (key == "aux")
86
m_decryptedKey = i18n("Additional Exif Properties");
88
else if (key == "crs")
90
m_decryptedKey = i18n("Camera Raw");
94
m_decryptedKey = i18n("Dublin Core");
96
else if (key == "digiKam")
98
m_decryptedKey = i18n("digiKam schema");
100
else if (key == "exif")
102
m_decryptedKey = i18n("Exif-specific Properties");
104
else if (key == "iptc")
106
m_decryptedKey = i18n("IPTC Core");
108
else if (key == "iptcExt")
110
m_decryptedKey = i18n("IPTC Extension schema");
112
else if (key == "MicrosoftPhoto")
114
m_decryptedKey = i18n("Microsoft Photo");
116
else if (key == "pdf")
118
m_decryptedKey = i18n("Adobe PDF");
120
else if (key == "photoshop")
122
m_decryptedKey = i18n("Adobe Photoshop");
124
else if (key == "plus")
126
m_decryptedKey = i18n("PLUS License Data Format Schema");
128
else if (key == "tiff")
130
m_decryptedKey = i18n("TIFF Properties");
132
else if (key == "xmp")
134
m_decryptedKey = i18n("Basic Schema");
136
else if (key == "xmpBJ")
138
m_decryptedKey = i18n("Basic Job Ticket");
140
else if (key == "xmpDM")
142
m_decryptedKey = i18n("Dynamic Media");
144
else if (key == "xmpMM")
146
m_decryptedKey = i18n("Media Management ");
148
else if (key == "xmpRights")
150
m_decryptedKey = i18n("Rights Management");
152
else if (key == "xmpTPg")
154
m_decryptedKey = i18n("Paged-Text");
157
// Reset all item flags: item is not selectable.
158
setFlags(Qt::ItemIsEnabled);
163
setFirstColumnSpanned(true);
164
setTextAlignment(0, Qt::AlignCenter);
167
fn0.setItalic(false);
171
fn1.setItalic(false);
173
setText(0, m_decryptedKey);
176
connect(ThemeManager::instance(), SIGNAL(signalThemeChanged()),
177
this, SLOT(slotThemeChanged()));
180
MdKeyListViewItem::~MdKeyListViewItem()
184
QString MdKeyListViewItem::getKey() const
189
QString MdKeyListViewItem::getDecryptedKey() const
191
return m_decryptedKey;
194
void MdKeyListViewItem::slotThemeChanged()
196
setBackground(0, QBrush(kapp->palette().color(QPalette::Highlight)));
197
setBackground(1, QBrush(kapp->palette().color(QPalette::Highlight)));
198
setForeground(0, QBrush(kapp->palette().color(QPalette::HighlightedText)));
199
setForeground(1, QBrush(kapp->palette().color(QPalette::HighlightedText)));
202
} // namespace Digikam