TTKMusicPlayer  4.3.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 - 2026 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
36 public:
40  explicit MusicScreenSaverHoverItem(QLabel *parent = nullptr);
41 
45  void setFilePath(const QString &path);
49  void setStatus(int index, bool status);
53  void display(const QPoint &point);
54 
55 Q_SIGNALS:
59  void itemClicked(int index, bool status);
60 
61 private Q_SLOTS:
65  void switchButtonState();
66 
67 private:
71  virtual void leaveEvent(QEvent *event) override final;
72  virtual void focusOutEvent(QFocusEvent *event) override final;
73  virtual void paintEvent(QPaintEvent *event) override final;
74 
75  int m_index;
76  QString m_path;
77  QLabel *m_parent;
78  QPushButton *m_enableButton;
79 };
80 
81 
82 
87 {
88  Q_OBJECT
89 public:
93  explicit MusicScreenSaverListItem(QObject *object, QWidget *parent = nullptr);
98 
102  void setFilePath(const QString &path);
106  void setStatus(int index, bool status);
110  void setHoverVisible(bool v);
111 
112 private:
116  virtual void enterEvent(QtEnterEvent *event) override final;
117 
119 
120 };
121 
122 
123 
128 {
129  Q_OBJECT
130 public:
134  explicit MusicScreenSaverListWidget(QWidget *parent = nullptr);
139 
143  void addCellItem(QObject *object, const QString &path, int index, bool status);
147  void resizeGeometry();
148 
149 private:
153  virtual void resizeEvent(QResizeEvent *event) override final;
154 
155  QGridLayout *m_gridLayout;
156  QList<MusicScreenSaverListItem*> m_items;
157 
158 };
159 
160 
161 
166 {
167  Q_OBJECT
168 public:
172  explicit MusicScreenSaverWidget(QWidget *parent = nullptr);
173 
177  void applyParameter();
178 
182  virtual void resizeGeometry() override final;
183 
184 public:
188  static QVector<bool> parseSettingParameter();
189 
190 private Q_SLOTS:
194  void inputDataChanged();
198  void switchButtonState();
202  void downloadDataFinished(const QString &bytes);
206  void currentItemClicked(int index, bool status);
207 
208 private:
212  void initialize();
213 
215  QLineEdit *m_inputEdit;
216  QPushButton *m_caseButton;
219 };
220 
221 
222 
227 {
228  Q_OBJECT
229 public:
233  explicit MusicScreenSaverBackgroundWidget(QWidget *parent = nullptr);
238 
242  void execute();
243 
244 private Q_SLOTS:
248  void runningTimeout();
252  void backgroundTimeout();
253 
254 private:
258  virtual bool eventFilter(QObject *watched, QEvent *event) override final;
259 
260 private:
261  bool m_state;
263  QTimer *m_runningTimer;
265 
266 };
267 
268 #endif // MUSICSCREENSAVERWIDGET_H
#define QtEnterEvent
Event enter.
Definition: ttkqtcompat.h:178
#define TTK_MODULE_EXPORT
The class of the screen saver list item.
MusicScreenSaverHoverItem * m_hoverItem
The class of the screen saver list widget.
TTK_MODULE_EXPORT bool execute(const QString &path)
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
TTK_MODULE_EXPORT void initialize(TTK::Attribute attr)
The class of the widget resize interface.
The class of the screen saver hover item.
virtual void resizeGeometry()=0