Sayonara Player
GUI_PlayerMenubar.h
1 /* GUI_PlayerMenubar.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 GUI_PLAYERMENUBAR_H
22 #define GUI_PLAYERMENUBAR_H
23 
24 #include "Gui/Utils/Shortcuts/ShortcutIdentifier.h"
25 #include "Gui/Utils/Widgets/WidgetTemplate.h"
26 #include "Utils/Pimpl.h"
27 
28 #include <QMenuBar>
29 
30 namespace Library
31 {
32  class AbstractContainer;
33 }
34 
35 namespace PlayerPlugin
36 {
37  class Base;
38 }
39 
40 class Menubar :
41  public Gui::WidgetTemplate<QMenuBar>
42 {
43  Q_OBJECT
44  PIMPL(Menubar)
45 
46  signals:
47  void sigCloseClicked();
48  void sigMinimizeClicked();
49  void sigLoggerClicked();
50 
51  public:
52  explicit Menubar(QWidget* parent = nullptr);
53  ~Menubar() override;
54 
55  void insertPreferenceAction(QAction* action);
56 
57  void showLibraryAction(bool visible);
58  void setShowLibraryActionEnabled(bool b);
59  void showLibraryMenu(bool b);
60 
61  private:
62  void initDonateLink();
63  void initConnections();
64  void styleChanged();
65 
66  QAction* changeCurrentLibrary(Library::AbstractContainer* library);
67 
68  private slots:
69  void openDirClicked();
70  void openFilesClicked();
71  void shutdownClicked();
72  void closeClicked();
73  void minimizeClicked();
74  void skinToggled(bool b);
75  void bigCoverToggled(bool b);
76  void showLibraryToggled(bool b);
77  void showFullscreenToggled(bool b);
78  void helpClicked();
79  void aboutClicked();
80  void shortcutChanged(ShortcutIdentifier identifier);
81  void pluginAdded(PlayerPlugin::Base* plugin);
82 
83  protected:
84  void languageChanged() override;
85  void skinChanged() override;
86 };
87 
88 #endif // GUI_PLAYERMENUBAR_H
PlayerPlugin::Base
Definition: PlayerPluginBase.h:40
Library::AbstractContainer
This container is only used internally to avoid Ui dependencies in the Components....
Definition: AbstractLibraryContainer.h:20
Gui::WidgetTemplate
Template for Sayonara Widgets. This template is responsible for holding a reference to the settings.
Definition: WidgetTemplate.h:87
Library
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31
PlayerPlugin
Interface for PlayerPlugin classes. get_name() and language_changed() must be overwritten.
Definition: GUI_Player.h:41
Menubar
Definition: GUI_PlayerMenubar.h:42