libquentier
0.8.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
headers
quentier
utility
FileCopier.h
1
/*
2
* Copyright 2018-2024 Dmitry Ivanov
3
*
4
* This file is part of libquentier
5
*
6
* libquentier is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation, version 3 of the License.
9
*
10
* libquentier is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public License
16
* along with libquentier. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#pragma once
20
21
#include <quentier/types/ErrorString.h>
22
#include <quentier/utility/Linkage.h>
23
24
#include <QObject>
25
#include <QString>
26
27
class
QDebug;
28
class
QTextStream;
29
30
namespace
quentier {
31
32
class
FileCopierPrivate;
33
34
class
QUENTIER_EXPORT
FileCopier
:
public
QObject
35
{
36
Q_OBJECT
37
public
:
38
explicit
FileCopier
(QObject *
parent
=
nullptr
);
39
40
enum class
State
41
{
42
Idle = 0,
43
Copying,
44
Cancelling
45
};
46
47
friend
QDebug
&
operator<<
(
QDebug
&
dbg
, State state);
48
friend
QTextStream
&
operator<<
(
QTextStream
&
strm
, State state);
49
50
[[
nodiscard
]] State state()
const
;
51
52
[[
nodiscard
]]
QString
sourceFilePath()
const
;
53
[[
nodiscard
]]
QString
destinationFilePath()
const
;
54
55
[[
nodiscard
]]
double
currentProgress()
const
;
56
57
Q_SIGNALS
:
58
void
progressUpdate(
double
progress
);
59
void
finished(
QString
sourcePath
,
QString
destPath
);
60
void
cancelled(
QString
sourcePath
,
QString
destPath
);
61
void
notifyError(
ErrorString
error);
62
63
public
Q_SLOTS
:
64
void
copyFile(
QString
sourcePath
,
QString
destPath
);
65
void
cancel();
66
67
private
:
68
Q_DISABLE_COPY
(
FileCopier
)
69
70
private
:
71
FileCopierPrivate
* d_ptr;
72
Q_DECLARE_PRIVATE(
FileCopier
)
73
};
74
75
}
// namespace quentier
quentier::ErrorString
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition
ErrorString.h:43
quentier::FileCopier
Definition
FileCopier.h:35
quentier::Result
The Result template class represents the bare bones result monad implementation which either contains...
Definition
Result.h:38
Generated on Sun Jan 26 2025 16:05:44 for libquentier by
1.9.8