digiKam
Loading...
Searching...
No Matches
itemtagpair.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-05
7 * Description : Access to the properties of an Item / Tag pair, i.e., a tag associated to an item
8 *
9 * SPDX-FileCopyrightText: 2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QString>
20#include <QStringList>
21#include <QList>
22#include <QExplicitlySharedDataPointer>
23#include <QMultiMap>
24
25// Local includes
26
27#include "digikam_export.h"
28
29namespace Digikam
30{
31
32class ItemInfo;
33class ItemTagPairPriv;
34
35class DIGIKAM_DATABASE_EXPORT ItemTagPair
36{
37public:
38
49
53 ItemTagPair(qlonglong imageId, int tagId);
54 ItemTagPair(const ItemInfo& info, int tagId);
55
57
58 ItemTagPair(const ItemTagPair& other);
59 ItemTagPair& operator=(const ItemTagPair& other);
60
61 bool isNull() const;
62
67 static QList<ItemTagPair> availablePairs(qlonglong imageId);
68 static QList<ItemTagPair> availablePairs(const ItemInfo& info);
69
70 qlonglong imageId() const;
71 int tagId() const;
72
76 bool isAssigned() const;
77
81 void assignTag();
82
86 void unAssignTag();
87
89 bool hasProperty(const QString& key) const;
91 bool hasAnyProperty(const QStringList& keys) const;
93 bool hasValue(const QString& key, const QString& value) const;
95 QString value(const QString& key) const;
97 QStringList allValues(const QStringList& keys) const;
99 QStringList values(const QString& key) const;
101 QStringList propertyKeys() const;
103 QMultiMap<QString, QString> properties() const;
104
106 void setProperty(const QString& key, const QString& value);
107
113 void addProperty(const QString& key, const QString& value);
114
116 void removeProperty(const QString& key, const QString& value);
118 void removeProperties(const QString& key);
120 void clearProperties();
121
122private:
123
124 QExplicitlySharedDataPointer<ItemTagPairPriv> d;
125};
126
127} // namespace
Definition iteminfo.h:68
Definition itemtagpair.h:36
qulonglong value
Definition itemviewutilities.cpp:585
Definition datefolderview.cpp:34