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