digiKam
Loading...
Searching...
No Matches
versionfileoperation.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-12-20
7 * Description : description of actions when saving a file with versioning
8 *
9 * SPDX-FileCopyrightText: 2010-2011 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 <QFlags>
21#include <QMap>
22#include <QString>
23
24// Local includes
25
26#include "digikam_export.h"
27#include "dimagehistory.h"
28
29class QUrl;
30
31namespace Digikam
32{
33
34class DIGIKAM_EXPORT VersionFileInfo
35{
36public:
37
38 explicit VersionFileInfo() = default;
39
40 VersionFileInfo(const QString& path, const QString& fileName, const QString& format)
41 : path (path),
42 fileName(fileName),
43 format (format)
44 {
45 }
46
47 bool isNull() const;
48
49 QString filePath() const;
50 QUrl fileUrl() const;
51
52 QString path;
53 QString fileName;
54 QString format;
55};
56
57// -------------------------------------------------------------------------------------------
58
59class DIGIKAM_EXPORT VersionFileOperation
60{
61public:
62
63 enum Task
64 {
66 NewFile = 1 << 0,
67
69 Replace = 1 << 1,
70
72 SaveAndDelete = 1 << 2,
73
75 MoveToIntermediate = 1 << 3,
76
78 StoreIntermediates = 1 << 4
79 };
80 Q_DECLARE_FLAGS(Tasks, Task)
81
82public:
83
95 explicit VersionFileOperation() = default;
96
100 QStringList allFilePaths() const;
101
102public:
103
104 Tasks tasks;
105
107
109
111
112 QMap<int, VersionFileInfo> intermediates;
113};
114
115} // namespace Digikam
116
117Q_DECLARE_OPERATORS_FOR_FLAGS(Digikam::VersionFileOperation::Tasks)
Definition versionfileoperation.h:35
QString path
Definition versionfileoperation.h:52
QString format
Definition versionfileoperation.h:54
VersionFileInfo(const QString &path, const QString &fileName, const QString &format)
Definition versionfileoperation.h:40
QString fileName
Definition versionfileoperation.h:53
Definition versionfileoperation.h:60
VersionFileInfo saveFile
Definition versionfileoperation.h:108
QMap< int, VersionFileInfo > intermediates
Definition versionfileoperation.h:112
VersionFileInfo intermediateForLoadedFile
Definition versionfileoperation.h:110
VersionFileInfo loadedFile
Definition versionfileoperation.h:106
Task
Definition versionfileoperation.h:64
Tasks tasks
Definition versionfileoperation.h:104
Definition datefolderview.cpp:34