Sayonara Player
ChangeOperations.h
1/* ChangeOperations.h */
2
3/* Copyright (C) 2011-2020 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 SAYONARA_PLAYER_CHANGEOPERATIONS_H
22#define SAYONARA_PLAYER_CHANGEOPERATIONS_H
23
24#include "Utils/Pimpl.h"
25
26namespace Library
27{
28 class Manager;
29}
30
32{
33 PIMPL(ChangeOperation)
34 public:
35 explicit ChangeOperation(Library::Manager* libraryManager);
36 virtual ~ChangeOperation();
37 virtual bool exec() = 0;
38
39 protected:
40 [[nodiscard]] Library::Manager* manager() const;
41};
42
44 public ChangeOperation
45{
46 PIMPL(MoveOperation)
47
48 public:
49 MoveOperation(Library::Manager* libraryManager, int from, int to);
50 ~MoveOperation() override;
51
52 bool exec() override;
53};
54
56 public ChangeOperation
57{
58 PIMPL(RenameOperation)
59
60 public:
61 RenameOperation(Library::Manager* libraryManager, LibraryId id, const QString& newName);
62 ~RenameOperation() override;
63
64 bool exec() override;
65};
66
68 public ChangeOperation
69{
70 PIMPL(RemoveOperation)
71
72 public:
73 RemoveOperation(Library::Manager* libraryManager, LibraryId id);
74 ~RemoveOperation() override;
75
76 bool exec() override;
77};
78
80 public ChangeOperation
81{
82 PIMPL(AddOperation)
83
84 public:
85 AddOperation(Library::Manager* libraryManager, const QString& name, const QString& path);
86 ~AddOperation() override;
87
88 bool exec() override;
89};
90
92 public ChangeOperation
93{
95
96 public:
97 ChangePathOperation(Library::Manager* libraryManager, LibraryId id, const QString& newPath);
98 ~ChangePathOperation() override;
99
100 bool exec() override;
101};
102
103#endif // SAYONARA_PLAYER_CHANGEOPERATIONS_H
Definition: ChangeOperations.h:81
Definition: ChangeOperations.h:32
Definition: ChangeOperations.h:93
Definition: LibraryManager.h:40
Definition: ChangeOperations.h:45
Definition: ChangeOperations.h:69
Definition: ChangeOperations.h:57
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31