Sayonara Player
LibraryContainer.h
1 /* LibraryContainerImpl.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 LIBRARYCONTAINERIMPL_H
22 #define LIBRARYCONTAINERIMPL_H
23 
24 #include "Utils/Pimpl.h"
25 #include "Components/LibraryManagement/AbstractLibraryContainer.h"
26 
33 namespace Library
34 {
35  class PluginHandler;
36 
37  class Container :
38  public QObject,
40  {
41  Q_OBJECT
42  PIMPL(Container)
43 
44  friend class PluginHandler;
45 
46  protected:
50  virtual void initUi() = 0;
51 
52  public:
53  explicit Container(QObject* parent = nullptr);
54  virtual ~Container() override;
55 
56  void init() override;
57 
58  virtual void rename(const QString& new_name) override;
59  virtual QString displayName() const override;
60  virtual QMenu* menu() override;
61  virtual bool isLocal() const override;
62  };
63 }
64 
65 #endif // LIBRARYCONTAINER_H
Library::Container::initUi
virtual void initUi()=0
Should initialize the ui. The ui constructor should be called within this function.
Library::PluginHandler
Library Plugin Manager.
Definition: LibraryPluginHandler.h:41
Library::Container::isLocal
virtual bool isLocal() const override
a local library is a library which writes to the library field of the database. This should be false ...
Library::AbstractContainer
This container is only used internally to avoid Ui dependencies in the Components....
Definition: AbstractLibraryContainer.h:20
Library
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31
Library::Container::init
void init() override
init
Library::Container
Definition: LibraryContainer.h:40
Library::Container::displayName
virtual QString displayName() const override
Should return the translated name displayed in the library view combobox.
Library::Container::menu
virtual QMenu * menu() override
return actions menu (may be nullptr). The title does not have to be set