digiKam
Loading...
Searching...
No Matches
historyimageid.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 : 2010-06-02
7 * Description : class holding properties of referenced files used in non-dest. editing
8 *
9 * SPDX-FileCopyrightText: 2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10 * SPDX-FileCopyrightText: 2010 by Martin Klapetek <martin dot klapetek at gmail dot com>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
18// Qt includes
19
20#include <QDateTime>
21#include <QMetaType>
22#include <QString>
23
24// Local includes
25
26#include "digikam_export.h"
27
28namespace Digikam
29{
30
31class DIGIKAM_EXPORT HistoryImageId
32{
33public:
34
35 enum Type
36 {
37 InvalidType = 0,
38
42 Original = 1 << 0,
43
48 Intermediate = 1 << 1,
49
56 Source = 1 << 2,
57
65 Current = 1 << 3
66 };
67
72 Q_DECLARE_FLAGS(Types, Type)
73
74public:
75
77 HistoryImageId() = default;
78
80 explicit HistoryImageId(const QString& uuid, Type type = Current);
81
83 bool isValid() const;
84
85 Type type() const;
86
87 bool isOriginalFile() const
88 {
89 return (type() == Original);
90 }
91
92 bool isSourceFile() const
93 {
94 return (type() == Source);
95 }
96
97 bool isIntermediateFile() const
98 {
99 return (type() == Intermediate);
100 }
101
102 bool isCurrentFile() const
103 {
104 return (type() == Current);
105 }
106
107 bool operator==(const HistoryImageId& other) const;
108
109 void setType(HistoryImageId::Type type);
110 void setUuid(const QString& uuid);
111 void setFileName(const QString& fileName);
112 void setCreationDate(const QDateTime& creationDate);
113 void setPathOnDisk(const QString& filePath);
114 void setPath(const QString& path);
115 void setUniqueHash(const QString& uniqueHash, qlonglong fileSize);
116
117 bool hasFileOnDisk() const;
118
120 QString path() const;
121
123 QString filePath() const;
124
125 bool hasFileName() const;
126
128 QString fileName() const;
129
130 bool hasUuid() const;
131 QString uuid() const;
132 bool hasCreationDate() const;
133 QDateTime creationDate() const;
134 bool hasUniqueHashIdentifier() const;
135 QString uniqueHash() const;
136 qlonglong fileSize() const;
137 QString originalUuid() const;
138
139public:
140
142 Type m_type = InvalidType;
143
148 QString m_uuid;
149
151 QString m_fileName;
152
154 QDateTime m_creationDate;
155
157 QString m_filePath;
158
161
163 qlonglong m_fileSize = 0;
164
171};
172
173} // namespace Digikam
174
175Q_DECLARE_METATYPE(Digikam::HistoryImageId)
176Q_DECLARE_OPERATORS_FOR_FLAGS(Digikam::HistoryImageId::Types)
Definition historyimageid.h:32
QString m_filePath
The path of the referred file (NOTE: without file name!, including trailing slash)
Definition historyimageid.h:157
bool isSourceFile() const
Definition historyimageid.h:92
HistoryImageId()=default
Creates an invalid HistoryImageId.
Type
Definition historyimageid.h:36
QString m_uniqueHash
The uniqueHash of the referred file.
Definition historyimageid.h:160
QString m_uuid
Definition historyimageid.h:148
QString m_fileName
The filename of the referred file.
Definition historyimageid.h:151
bool isCurrentFile() const
Definition historyimageid.h:102
bool isIntermediateFile() const
Definition historyimageid.h:97
QDateTime m_creationDate
The creationDate of the original image.
Definition historyimageid.h:154
bool isOriginalFile() const
Definition historyimageid.h:87
QString m_originalUUID
Definition historyimageid.h:170
Definition datefolderview.cpp:34
bool operator==(const SearchTextSettings &a, const SearchTextSettings &b)
Definition searchtextbar.cpp:40
Type
Definition gpsitemcontainer.h:36