TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicscreensaverwidget.h
Go to the documentation of this file.
1 #ifndef MUSICSCREENSAVERWIDGET_H
2 #define MUSICSCREENSAVERWIDGET_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2024 Greedysky Studio
7 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17 
18  * You should have received a copy of the GNU General Public License along
19  * with this program; If not, see <http://www.gnu.org/licenses/>.
20  ***************************************************************************/
21 
22 #include <QLineEdit>
23 #include <QPushButton>
24 #include <QGridLayout>
27 
29 
34 {
35  Q_OBJECT
37 public:
41  explicit MusicScreenSaverHoverItem(QLabel *parent = nullptr);
42 
46  void setFilePath(const QString &path);
50  void setStatus(int index, bool status);
54  void display(const QPoint &point);
55 
56 Q_SIGNALS:
60  void itemClicked(int index, bool status);
61 
62 private Q_SLOTS:
66  void switchButtonState();
67 
68 private:
72  virtual void leaveEvent(QEvent *event) override final;
73  virtual void focusOutEvent(QFocusEvent *event) override final;
74  virtual void paintEvent(QPaintEvent *event) override final;
75 
76  int m_index;
77  QString m_path;
78  QLabel *m_parent;
79  QPushButton *m_enableButton;
80 };
81 
82 
83 
88 {
89  Q_OBJECT
91 public:
95  explicit MusicScreenSaverListItem(QObject *object, QWidget *parent = nullptr);
100 
104  void setFilePath(const QString &path);
108  void setStatus(int index, bool status);
112  void setHoverVisible(bool v);
113 
114 private:
118  virtual void enterEvent(QtEnterEvent *event) override final;
119 
121 
122 };
123 
124 
125 
130 {
131  Q_OBJECT
133 public:
137  explicit MusicScreenSaverListWidget(QWidget *parent = nullptr);
142 
146  void addCellItem(QObject *object, const QString &path, int index, bool status);
150  void resizeWindow();
151 
152 private:
156  virtual void resizeEvent(QResizeEvent *event) override final;
157 
158  QGridLayout *m_gridLayout;
159  QList<MusicScreenSaverListItem*> m_items;
160 
161 };
162 
163 
164 
169 {
170  Q_OBJECT
172 public:
176  explicit MusicScreenSaverWidget(QWidget *parent = nullptr);
177 
181  void applyParameter();
185  virtual void resizeWidget() override final;
186 
187 public:
191  static QVector<bool> parseSettingParameter();
192 
193 private Q_SLOTS:
197  void inputDataChanged();
201  void switchButtonState();
205  void downLoadFinished(const QString &bytes);
209  void currentItemClicked(int index, bool status);
210 
211 private:
215  void initialize();
216 
218  QLineEdit *m_inputEdit;
219  QPushButton *m_caseButton;
222 };
223 
224 
225 
230 {
231  Q_OBJECT
233 public:
237  explicit MusicScreenSaverBackgroundWidget(QWidget *parent = nullptr);
242 
246  void run();
247 
248 private Q_SLOTS:
252  void runningTimeout();
256  void backgroundTimeout();
257 
258 private:
262  virtual bool eventFilter(QObject *watched, QEvent *event) override final;
263 
264 private:
265  bool m_state;
267  QTimer *m_runningTimer;
269 
270 };
271 
272 #endif // MUSICSCREENSAVERWIDGET_H
#define QtEnterEvent
Event enter.
Definition: ttkqtcompat.h:160
#define TTK_MODULE_EXPORT
The class of the screen saver list item.
MusicScreenSaverHoverItem * m_hoverItem
The class of the screen saver list widget.
The class of the download data from queue request.
The class of the screen saver background widget.
MusicScreenSaverListWidget * m_backgroundList
The class of the label transition animation.
MusicDownloadQueueRequest * m_networkRequest
The class of the screen saver widget.
QList< MusicScreenSaverListItem * > m_items
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the widget resize interface.
virtual void resizeWidget()=0
The class of the screen saver hover item.