digiKam
Loading...
Searching...
No Matches
timeadjustcontainer.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 : 2012-04-19
7 * Description : time adjust settings container.
8 *
9 * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QUrl>
20#include <QMap>
21#include <QDateTime>
22
23// Local includes
24
25#include "digikam_export.h"
26
27namespace Digikam
28{
29
33class DIGIKAM_EXPORT TimeAdjustContainer
34{
35
36public:
37
39 {
40 APPDATE = 0,
44 CUSTOMDATE
45 };
46
59
61 {
62 FILELASTMOD = 0,
63 FILECREATED
64 };
65
67 {
68 COPYVALUE = 0,
71 INTERVAL
72 };
73
74public:
75
78
82 bool atLeastOneUpdateToProcess() const;
83
84 QDateTime calculateAdjustedDate(const QDateTime& originalTime, int index = 0);
85 QDateTime getDateTimeFromString(const QString& dateStr) const;
86 QMap<QString, bool> getDateTimeTagsMap() const;
87
88public:
89
90 QDateTime customDate = QDateTime::currentDateTime();
91 QDateTime customTime = QDateTime::currentDateTime();
92 QDateTime adjustmentTime = QDateTime();
93
94 bool updUseExifTool = false;
95 bool updIfAvailable = true;
96 bool updEXIFModDate = false;
97 bool updEXIFOriDate = false;
98 bool updEXIFDigDate = false;
99 bool updEXIFThmDate = false;
100 bool updIPTCDate = false;
101 bool updXMPVideo = false;
102 bool updXMPDate = false;
103 bool updFileModDate = false;
104
108 bool enableExifTool = false;
109
110 int dateSource = APPDATE;
111 int metadataSource = EXIFIPTCXMP;
112 int fileDateSource = FILELASTMOD;
113 int adjustmentType = COPYVALUE;
114 int adjustmentDays = 0;
115};
116
117// -------------------------------------------------------------------
118
123{
124
125public:
126
127 DeltaTime() = default;
128 ~DeltaTime() = default;
129
133 bool isNull() const
134 {
135 return (
136 (deltaDays == 0) &&
137 (deltaHours == 0) &&
138 (deltaMinutes == 0) &&
139 (deltaSeconds == 0)
140 );
141 }
142
143public:
144
145 bool deltaNegative = false;
146
147 int deltaDays = 0;
148 int deltaHours = 0;
151};
152
153} // namespace Digikam
Definition timeadjustcontainer.h:123
int deltaHours
Definition timeadjustcontainer.h:148
bool isNull() const
Definition timeadjustcontainer.h:133
int deltaMinutes
Definition timeadjustcontainer.h:149
int deltaSeconds
Definition timeadjustcontainer.h:150
bool deltaNegative
Definition timeadjustcontainer.h:145
~DeltaTime()=default
int deltaDays
Definition timeadjustcontainer.h:147
Definition timeadjustcontainer.h:34
UseFileDateType
Definition timeadjustcontainer.h:61
UseMetaDateType
Definition timeadjustcontainer.h:48
@ FUZZYORIGINAL
Definition timeadjustcontainer.h:56
@ XMPCREATED
Definition timeadjustcontainer.h:54
@ FUZZYCREATED
Definition timeadjustcontainer.h:55
@ EXIFORIGINAL
Definition timeadjustcontainer.h:51
@ IPTCCREATED
Definition timeadjustcontainer.h:53
@ EXIFDIGITIZED
Definition timeadjustcontainer.h:52
@ EXIFCREATED
Definition timeadjustcontainer.h:50
UseDateSource
Definition timeadjustcontainer.h:39
@ FILEDATE
Definition timeadjustcontainer.h:42
@ FILENAME
Definition timeadjustcontainer.h:41
@ METADATADATE
Definition timeadjustcontainer.h:43
AdjType
Definition timeadjustcontainer.h:67
@ ADDVALUE
Definition timeadjustcontainer.h:69
@ SUBVALUE
Definition timeadjustcontainer.h:70
Definition datefolderview.cpp:34