1 /*
2  * Strawberry Music Player
3  * This file was part of Clementine.
4  * Copyright 2010, David Sansome <me@davidsansome.com>
5  * Copyright 2019-2021, Jonas Kvinge <jonas@jkvinge.net>
6  *
7  * Strawberry 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  * Strawberry 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 Strawberry.  If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef NOTIFICATIONSSETTINGSPAGE_H
23 #define NOTIFICATIONSSETTINGSPAGE_H
24 
25 #include "config.h"
26 
27 #include <QObject>
28 #include <QString>
29 
30 #include "settingspage.h"
31 
32 class QAction;
33 class QHideEvent;
34 class QShowEvent;
35 
36 class OSDPretty;
37 class SettingsDialog;
38 class Ui_NotificationsSettingsPage;
39 
40 class NotificationsSettingsPage : public SettingsPage {
41   Q_OBJECT
42 
43  public:
44   explicit NotificationsSettingsPage(SettingsDialog *dialog, QWidget *parent = nullptr);
45   ~NotificationsSettingsPage() override;
46 
47   void Load() override;
48   void Save() override;
49 
50  protected:
51   void hideEvent(QHideEvent*) override;
52   void showEvent(QShowEvent*) override;
53 
54  private slots:
55   void NotificationTypeChanged();
56   void NotificationCustomTextChanged(bool enabled);
57   void PrepareNotificationPreview();
58   void InsertVariableFirstLine(QAction *action);
59   void InsertVariableSecondLine(QAction *action);
60   void ShowMenuTooltip(QAction *action);
61 
62   void PrettyOpacityChanged(int value);
63   void PrettyColorPresetChanged(int index);
64   void ChooseBgColor();
65   void ChooseFgColor();
66   void ChooseFont();
67 
68   void UpdatePopupVisible();
69 
70   void PrettyOSDChanged();
71 
72  private:
73   Ui_NotificationsSettingsPage *ui_;
74   OSDPretty *pretty_popup_;
75 };
76 
77 #endif  // NOTIFICATIONSSETTINGSPAGE_H
78