digiKam
iteminfodata.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 : 2007-05-01
7  * Description : ItemInfo common data
8  *
9  * Copyright (C) 2007-2013 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2013-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2013 by Michael G. Hansen <mike at mghansen dot de>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_ITEM_INFO_DATA_H
27 #define DIGIKAM_ITEM_INFO_DATA_H
28 
29 // Qt includes
30 
31 #include <QList>
32 #include <QSize>
33 #include <QDateTime>
34 #include <QSharedData>
35 #include <QReadWriteLock>
36 #include <QWriteLocker>
37 #include <QReadLocker>
38 
39 // Local includes
40 
41 #include "coredburl.h"
42 #include "coredbalbuminfo.h"
43 #include "iteminfocache.h"
44 
45 namespace Digikam
46 {
47 
49 {
50 public:
51 
52  static void create();
53  static void destroy();
54 
55  static ItemInfoCache* cache();
56 
57 public:
58 
60  QReadWriteLock m_lock;
61 
63 };
64 
65 // -----------------------------------------------------------------------------------
66 
67 class ItemInfoReadLocker : public QReadLocker
68 {
69 public:
70 
71  explicit ItemInfoReadLocker()
72  : QReadLocker(&ItemInfoStatic::m_instance->m_lock)
73  {
74  }
75 };
76 
77 // -----------------------------------------------------------------------------------
78 
79 class ItemInfoWriteLocker : public QWriteLocker
80 {
81 public:
82 
84  : QWriteLocker(&ItemInfoStatic::m_instance->m_lock)
85  {
86  }
87 };
88 
89 // -----------------------------------------------------------------------------------
90 
91 class ItemInfoData : public QSharedData
92 {
93 public:
94 
95  explicit ItemInfoData();
96  ~ItemInfoData();
97 
98 public:
99 
100  qlonglong id;
102  int albumId;
104  QString name;
105 
106  QString defaultComment;
107  QString defaultTitle;
108  quint8 pickLabel;
109  quint8 colorLabel;
110  qint8 rating;
112  QString format;
113  QDateTime creationDate;
114  QDateTime modificationDate;
116  qlonglong fileSize;
117  qlonglong manualOrder;
118  QString uniqueHash;
119  QSize imageSize;
123  QMap<QString, QString> faceSuggestions;
124 
125  double longitude;
126  double latitude;
127  double altitude;
129 
131  qlonglong groupImage;
132 
133  bool hasCoordinates : 1;
134  bool hasAltitude : 1;
135 
138  bool pickLabelCached : 1;
140  bool ratingCached : 1;
141  bool categoryCached : 1;
142  bool formatCached : 1;
146  bool fileSizeCached : 1;
149  bool imageSizeCached : 1;
150  bool tagIdsCached : 1;
151  bool positionsCached : 1;
155  bool faceCountCached : 1;
156 
157  bool invalid : 1;
158 
159  // These two are initially true because we assume the data is there.
160  // Once we query the data and find out it is missing, we set them to false.
163 
164 
167 
170 };
171 
172 } // namespace Digikam
173 
174 #endif // DIGIKAM_ITEM_INFO_DATA_H
Definition: iteminfocache.h:47
Definition: iteminfodata.h:92
bool positionsCached
Definition: iteminfodata.h:151
QString defaultComment
Definition: iteminfodata.h:106
bool formatCached
Definition: iteminfodata.h:142
QDateTime creationDate
Definition: iteminfodata.h:113
qlonglong manualOrder
Definition: iteminfodata.h:117
QString format
Definition: iteminfodata.h:112
qlonglong id
Definition: iteminfodata.h:100
double longitude
Definition: iteminfodata.h:125
int faceCount
Definition: iteminfodata.h:121
bool hasAltitude
Definition: iteminfodata.h:134
bool orientationCached
Definition: iteminfodata.h:145
QList< int > tagIds
Definition: iteminfodata.h:120
bool faceSuggestionsCached
Definition: iteminfodata.h:154
qlonglong fileSize
Definition: iteminfodata.h:116
bool defaultCommentCached
Definition: iteminfodata.h:137
QString defaultTitle
Definition: iteminfodata.h:107
int albumId
Definition: iteminfodata.h:102
double latitude
Definition: iteminfodata.h:126
QMap< QString, QString > faceSuggestions
Definition: iteminfodata.h:123
bool tagIdsCached
Definition: iteminfodata.h:150
bool ratingCached
Definition: iteminfodata.h:140
bool fileSizeCached
Definition: iteminfodata.h:146
QString uniqueHash
Definition: iteminfodata.h:118
bool faceCountCached
Definition: iteminfodata.h:155
bool unconfirmedFaceCountCached
Definition: iteminfodata.h:153
bool pickLabelCached
Definition: iteminfodata.h:138
double altitude
Definition: iteminfodata.h:127
bool defaultTitleCached
Definition: iteminfodata.h:136
~ItemInfoData()
Definition: iteminfodata.cpp:118
int unconfirmedFaceCount
Definition: iteminfodata.h:122
bool hasCoordinates
Definition: iteminfodata.h:133
QSize imageSize
Definition: iteminfodata.h:119
DatabaseFields::Hash< QVariant > DatabaseFieldsHashRaw
Definition: iteminfodata.h:168
QDateTime modificationDate
Definition: iteminfodata.h:114
bool uniqueHashCached
Definition: iteminfodata.h:148
bool creationDateCached
Definition: iteminfodata.h:143
bool groupImageCached
Definition: iteminfodata.h:152
ItemInfoData()
Definition: iteminfodata.cpp:62
bool hasImageMetadata
Definition: iteminfodata.h:162
quint8 pickLabel
Definition: iteminfodata.h:108
qint8 rating
Definition: iteminfodata.h:110
int albumRootId
Definition: iteminfodata.h:103
DatabaseItem::Category category
Definition: iteminfodata.h:111
DatabaseFieldsHashRaw databaseFieldsHashRaw
Definition: iteminfodata.h:169
quint8 colorLabel
Definition: iteminfodata.h:109
DatabaseFields::VideoMetadataMinSizeType videoMetadataCached
Definition: iteminfodata.h:165
bool imageSizeCached
Definition: iteminfodata.h:149
bool colorLabelCached
Definition: iteminfodata.h:139
bool categoryCached
Definition: iteminfodata.h:141
bool invalid
Definition: iteminfodata.h:157
bool hasVideoMetadata
Definition: iteminfodata.h:161
QString name
Definition: iteminfodata.h:104
bool modificationDateCached
Definition: iteminfodata.h:144
DatabaseFields::ImageMetadataMinSizeType imageMetadataCached
Definition: iteminfodata.h:166
bool manualOrderCached
Definition: iteminfodata.h:147
qlonglong groupImage
group leader, if the image is grouped
Definition: iteminfodata.h:131
int orientation
Definition: iteminfodata.h:115
double currentSimilarity
Definition: iteminfodata.h:128
qlonglong currentReferenceImage
Definition: iteminfodata.h:101
Definition: iteminfodata.h:68
ItemInfoReadLocker()
Definition: iteminfodata.h:71
Definition: iteminfodata.h:49
static ItemInfoCache * cache()
Definition: iteminfodata.cpp:55
static void create()
Definition: iteminfodata.cpp:41
QReadWriteLock m_lock
Definition: iteminfodata.h:60
static ItemInfoStatic * m_instance
Definition: iteminfodata.h:62
ItemInfoCache m_cache
Definition: iteminfodata.h:59
static void destroy()
Definition: iteminfodata.cpp:49
Definition: iteminfodata.h:80
ItemInfoWriteLocker()
Definition: iteminfodata.h:83
uint8_t VideoMetadataMinSizeType
Definition: coredbfields.h:236
uint16_t ImageMetadataMinSizeType
Definition: coredbfields.h:150
Category
Definition: coredbconstants.h:95
Definition: datefolderview.cpp:43