Sayonara Player
Loading...
Searching...
No Matches
CopyProcessor.h
1/* CopyThread.h */
2
3/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef IMPORT_COPY_THREAD_H
22#define IMPORT_COPY_THREAD_H
23
24#include <QThread>
25
26#include <memory>
27
28namespace Util
29{
30 class FileSystem;
31}
32
33class MetaDataList;
34namespace Library
35{
36 class ImportCache;
38 public QObject
39 {
40 Q_OBJECT
41
42 signals:
43 void sigProgress(int progress);
44 void sigFinished();
45
46 public:
47 static CopyProcessor* create(const QString& targetDirectory,
48 const std::shared_ptr<ImportCache>& cache,
49 const std::shared_ptr<Util::FileSystem>& fileSystem);
50
51 virtual void copy() = 0;
52 virtual void cancel() = 0;
53 virtual void rollback() = 0;
54 [[nodiscard]] virtual bool wasCancelled() const = 0;
55 [[nodiscard]] virtual MetaDataList copiedMetadata() const = 0;
56 [[nodiscard]] virtual int copiedFileCount() const = 0;
57
58 protected:
59 void emitProgress(int progress);
60 };
61}
62
63#endif
Definition: CopyProcessor.h:39
Definition: MetaDataList.h:34
Helper functions.
Definition: MetaTypeRegistry.h:25