Sayonara Player
LibraryManager.h
1 /* LibraryManager.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 
22 
23 #ifndef LIBRARYMANAGER_H
24 #define LIBRARYMANAGER_H
25 
26 #include "Utils/Singleton.h"
27 #include "Utils/Pimpl.h"
28 #include "Utils/Settings/SayonaraClass.h"
29 
30 #include <QObject>
31 
32 class LocalLibrary;
33 
34 namespace Library
35 {
36  class Info;
37  class Manager :
38  public QObject,
39  public SayonaraClass
40  {
41  Q_OBJECT
42  PIMPL(Manager)
43  SINGLETON(Manager)
44 
45  friend class LocalLibrary;
46 
47  signals:
48  void sig_path_changed(LibraryId id);
49  void sig_added(LibraryId id);
50  void sig_renamed(LibraryId id);
51  void sig_moved(LibraryId id, int from, int to);
52  void sig_removed(LibraryId id);
53 
54  private:
55  void reset();
56 
57  public:
58  LibraryId add_library(const QString& name, const QString& path);
59  bool rename_library(LibraryId id, const QString& name);
60  bool remove_library(LibraryId id);
61  bool move_library(int old_row, int new_row);
62  bool change_library_path(LibraryId id, const QString& path);
63 
64  QList<Info> all_libraries() const;
65 
66  Info library_info(LibraryId id) const;
67  Info library_info_by_path(const QString& path) const;
68  Info library_info_by_sympath(const QString& path) const;
69 
70  int count() const;
71 
72  LocalLibrary* library_instance(LibraryId id);
73 
74  static QString request_library_name(const QString& path);
75  };
76 }
77 
78 
79 #endif // LIBRARYMANAGER_H
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
Definition: LibraryManager.h:37
Definition: LocalLibrary.h:35
Definition: LibraryInfo.h:29
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:29
Definition: org_mpris_media_player2_adaptor.h:20