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 <QList>
31 #include <QObject>
32 
33 class LocalLibrary;
35 
36 namespace Library
37 {
38  class Info;
39  class Manager :
40  public QObject,
41  public SayonaraClass
42  {
43  Q_OBJECT
44  PIMPL(Manager)
45  SINGLETON(Manager)
46 
47  friend class LocalLibrary;
48 
49  signals:
50  void sig_path_changed(LibraryId library_id);
51  void sig_name_changed(LibraryId library_id);
52 
53  private:
54  void reset();
55 
56  public:
57  LibraryId add_library(const QString& name, const QString& path);
58  bool rename_library(LibraryId id, const QString& name);
59  bool remove_library(LibraryId id);
60  bool move_library(int old_row, int new_row);
61  bool change_library_path(LibraryId id, const QString& path);
62 
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) const;
73 
74  static QString request_library_name(const QString& path);
75 
76 
77  };
78 }
79 
80 
81 #endif // LIBRARYMANAGER_H
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
Definition: LibraryManager.h:39
Definition: LocalLibrary.h:35
Definition: LibraryInfo.h:30
An interface class needed when implementing a library plugin.
Definition: LibraryManager.h:36
Definition: LocalLibraryContainer.h:32
Definition: org_mpris_media_player2_adaptor.h:20