Sayonara Player
ChangeOperations.h
1 /* ChangeOperations.h */
2 
3 /* Copyright (C) 2011-2017 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 
31 class QString;
32 
34 {
35 public:
37  virtual ~ChangeOperation();
38  virtual bool exec()=0;
39 
40  Library::Manager* manager() const;
41 };
42 
44  public ChangeOperation
45 {
46  PIMPL(MoveOperation)
47 
48 public:
49  MoveOperation(int from, int to);
50  ~MoveOperation();
51 
52  bool exec() override;
53 };
54 
55 
57  public ChangeOperation
58 {
59  PIMPL(RenameOperation)
60 
61 public:
62  RenameOperation(LibraryId id, const QString& new_name);
63  ~RenameOperation();
64 
65  bool exec() override;
66 };
67 
69  public ChangeOperation
70 {
71  PIMPL(RemoveOperation)
72 
73 public:
74  RemoveOperation(LibraryId id);
75  ~RemoveOperation();
76 
77  bool exec() override;
78 };
79 
80 class AddOperation :
81  public ChangeOperation
82 {
83  PIMPL(AddOperation)
84 
85 public:
86  AddOperation(const QString& name, const QString& path);
87  ~AddOperation();
88 
89  bool exec() override;
90 };
91 
93  public ChangeOperation
94 {
95  PIMPL(ChangePathOperation)
96 
97 public:
98  ChangePathOperation(LibraryId id, const QString& new_path);
100 
101  bool exec() override;
102 };
103 
104 
105 
106 
107 #endif // CHANGEOPERATIONS_H
Definition: ChangeOperations.h:56
Definition: ChangeOperations.h:33
Definition: ChangeOperations.h:68
Definition: ChangeOperations.h:80
Definition: LibraryManager.h:39
Definition: ChangeOperations.h:43
An interface class needed when implementing a library plugin.
Definition: LibraryManager.h:36
Definition: ChangeOperations.h:92