digiKam
iteminfo_p.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 : 2005-04-21
7  * Description : Handling access to one item and associated data - private
8  *
9  * Copyright (C) 2005 by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2007-2013 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  * Copyright (C) 2013 by Michael G. Hansen <mike at mghansen dot de>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option)
18  * any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * ============================================================ */
26 
27 #ifndef DIGIKAM_ITEM_INFO_P_H
28 #define DIGIKAM_ITEM_INFO_P_H
29 
30 #include "iteminfo.h"
31 
32 // Qt includes
33 
34 #include <QFile>
35 #include <QFileInfo>
36 #include <QHash>
37 
38 // Local includes
39 
40 #include "digikam_debug.h"
41 #include "digikam_globals.h"
42 #include "coredb.h"
43 #include "coredbaccess.h"
44 #include "coredbinfocontainers.h"
45 #include "coredboperationgroup.h"
46 #include "dimagehistory.h"
47 #include "collectionmanager.h"
48 #include "collectionlocation.h"
49 #include "iteminfodata.h"
50 #include "iteminfocache.h"
51 #include "itemlister.h"
52 #include "itemlisterrecord.h"
53 #include "iteminfolist.h"
54 #include "itemcomments.h"
55 #include "itemcopyright.h"
56 #include "itemextendedproperties.h"
57 #include "itemposition.h"
58 #include "itemscanner.h"
59 #include "itemtagpair.h"
60 #include "facetagseditor.h"
61 #include "tagscache.h"
62 #include "template.h"
63 #include "thumbnailinfo.h"
64 #include "photoinfocontainer.h"
65 #include "videoinfocontainer.h"
66 
67 namespace Digikam
68 {
69 
70 MetadataInfo::Field DatabaseVideoMetadataFieldsToMetadataInfoField(const DatabaseFields::VideoMetadata videoMetadataField);
71 MetadataInfo::Field DatabaseImageMetadataFieldsToMetadataInfoField(const DatabaseFields::ImageMetadata imageMetadataField);
72 
73 #define RETURN_IF_CACHED(x) \
74  \
75  { \
76  ItemInfoReadLocker lock; \
77  \
78  if (m_data->x##Cached) \
79  { \
80  return m_data->x; \
81  } \
82  }
83 
84 #define RETURN_ASPECTRATIO_IF_IMAGESIZE_CACHED() \
85  \
86  { \
87  ItemInfoReadLocker lock; \
88  \
89  if (m_data->imageSizeCached) \
90  { \
91  return (double)m_data->imageSize.width() / \
92  m_data->imageSize.height(); \
93  } \
94  }
95 
96 #define STORE_IN_CACHE_AND_RETURN(x, retrieveMethod) \
97  \
98  { \
99  ItemInfoWriteLocker lock; \
100  \
101  if (!values.isEmpty()) \
102  { \
103  m_data.data()->x##Cached = true; \
104  m_data.data()->x = retrieveMethod; \
105  } \
106  \
107  return m_data->x; \
108  }
109 
110 } // namespace Digikam
111 
112 #endif // DIGIKAM_ITEM_INFO_P_H
Field
Definition: metadatainfo.h:91
Definition: datefolderview.cpp:43
MetadataInfo::Field DatabaseImageMetadataFieldsToMetadataInfoField(const DatabaseFields::ImageMetadata imageMetadataField)
Definition: iteminfo_p.cpp:65
MetadataInfo::Field DatabaseVideoMetadataFieldsToMetadataInfoField(const DatabaseFields::VideoMetadata videoMetadataField)
Definition: iteminfo_p.cpp:32