digiKam
tagproperties.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 a tag in the database
8  *
9  * Copyright (C) 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
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_TAG_PROPERTIES_H
25 #define DIGIKAM_TAG_PROPERTIES_H
26 
27 // Qt includes
28 
29 #include <QString>
30 #include <QStringList>
31 #include <QList>
32 #include <QExplicitlySharedDataPointer>
33 #include <QMultiMap>
34 
35 // Local includes
36 
37 #include "digikam_export.h"
38 
39 namespace Digikam
40 {
41 
42 class DIGIKAM_DATABASE_EXPORT TagProperties
43 {
44 public:
45 
51  TagProperties();
52 
56  explicit TagProperties(int tagId);
57 
58  ~TagProperties();
59  TagProperties(const TagProperties& other);
60  TagProperties& operator=(const TagProperties& other);
61 
62  bool isNull() const;
63 
64  int tagId() const;
65 
70  static TagProperties getOrCreate(const QString& tagPath);
71 
75  bool hasProperty(const QString& key) const;
76 
80  bool hasProperty(const QString& key, const QString& value) const;
81 
88  QString value(const QString& key) const;
89 
91  QStringList propertyKeys() const;
92 
94  QMultiMap<QString, QString> properties() const;
95 
97  void setProperty(const QString& key, const QString& value);
98 
103  void addProperty(const QString& key, const QString& value);
104 
106  void removeProperty(const QString& key, const QString& value);
107 
109  void removeProperties(const QString& key);
110 
111 public:
112 
114  class TagPropertiesPriv;
115 
116 private:
117 
118  QExplicitlySharedDataPointer<TagPropertiesPriv> d;
119 };
120 
121 } // namespace Digikam
122 
123 #endif // DIGIKAM_TAG_PROPERTIES_H
Definition: tagproperties.h:43
qulonglong value
Definition: itemviewutilities.cpp:592
Definition: datefolderview.cpp:43