TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicmainrecommendwidget.h
Go to the documentation of this file.
1 #ifndef MUSICMAINRECOMMENDWIDGET_H
2 #define MUSICMAINRECOMMENDWIDGET_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 <QLabel>
23 #include <QStackedWidget>
24 #include "musicquerytablewidget.h"
25 
26 class QGridLayout;
27 class TTKClickedGroup;
29 
31 {
36 };
37 
42 {
43  Q_OBJECT
44 public:
48  explicit MusicNewSongRecommendQueryTableWidget(QWidget *parent = nullptr);
53 
57  virtual void startToSearchByValue(const QString &value) override final;
61  virtual void downloadQueryResult(int row) override final;
65  virtual void resizeGeometry() override final;
66 
67 public Q_SLOTS:
71  virtual void itemCellEntered(int row, int column) override final;
75  virtual void itemCellClicked(int row, int column) override;
79  virtual void itemDoubleClicked(int row, int column) override;
83  virtual void removeItems() override final;
87  virtual void createResultItem(const MusicResultInfoItem &result) override;
88 
89 private:
93  void addSearchMusicToPlaylist(int row, bool play);
97  bool downloadDataFrom(TTK::MusicSongInformation *info, bool play);
98 
99 };
100 
101 
106 {
107  Q_OBJECT
108 public:
112  explicit MusicItemRecommendQueryWidget(RecommendModule module, QWidget *parent = nullptr);
117 
121  void setQueryInput(MusicAbstractQueryRequest *query);
125  void resizeGeometry();
126 
127 public Q_SLOTS:
131  void createResultItem(const MusicResultDataItem &item);
135  void currentItemClicked(const MusicResultDataItem &item);
136 
137 private:
139  QGridLayout *m_gridLayout;
140  QWidgetList m_resizeWidgets;
142 
143 };
144 
145 
150 {
151  Q_OBJECT
152 public:
156  explicit MusicItemMoreRecommendQueryWidget(RecommendModule module, QWidget *parent = nullptr);
161 
165  void resizeGeometry();
166 
167 public Q_SLOTS:
171  void buttonClicked(int index);
175  void categoryChanged(int index);
179  void createResultItem(const MusicResultDataItem &item);
183  void currentItemClicked(const MusicResultDataItem &item);
184 
185 private:
189  void initialize();
193  void removeItems(QLayout *layout);
194 
197  QWidget *m_mainWidget;
198  QGridLayout *m_gridLayout;
199  QWidgetList m_resizeWidgets;
203 
204 };
205 
206 
211 {
212  Q_OBJECT
213 public:
217  explicit MusicMainRecommendWidget(QWidget *parent = nullptr);
222 
226  virtual void resizeGeometry() override final;
227 
228 private Q_SLOTS:
232  void areaItemChangedToMore(int id);
236  void moreItemChangedToArea();
237 
238 private:
242  void createHomeWidget();
246  void createTopWidget();
250  void createContainerWidget();
254  void createContainerTopWidget();
258  void createContainerMiddleTopWidget();
262  void createContainerMiddleWidget();
266  void createContainerMiddleBottomWidget();
267 
268  QStackedWidget *m_mainWidget;
270  QWidget *m_homeWidget, *m_homeContainer;
277 
278 };
279 
280 #endif // MUSICMAINRECOMMENDWIDGET_H
#define TTK_MODULE_EXPORT
MusicNewSongRecommendQueryTableWidget * m_newSongsWidget
The class of the search result data item.
MusicItemMoreRecommendQueryWidget * m_itemMoreWidget
virtual void createResultItem(const MusicResultInfoItem &result)=0
virtual void itemDoubleClicked(int row, int column)=0
virtual void downloadQueryResult(int row)=0
The class of the new song recommend query item table widget.
MusicAbstractQueryRequest * m_networkRequest
MusicItemRecommendQueryWidget * m_hqPlaylistWidget
MusicItemRecommendQueryWidget * m_artistsWidget
The class of the item recommend query widget.
The class of the page query widget.
virtual void itemCellEntered(int row, int column)
TTK_MODULE_EXPORT void initialize(TTK::Attribute attr)
The class of the widget resize interface.
virtual void resizeGeometry() override
MusicItemRecommendQueryWidget * m_newAlbumsWidget
MusicAbstractQueryRequest * m_networkRequest
virtual void startToSearchByValue(const QString &value)=0
virtual void removeItems() override
The class of the search result info item.
The class of the main recommend widget.
The class of the query table widget.
virtual void itemCellClicked(int row, int column) override
The class of the abstract query data from net.
virtual void resizeGeometry()=0
MusicItemRecommendQueryWidget * m_playlistWidget
The class of the item more recommend query widget.
The class of the music song information.
Definition: musicobject.h:300
The class of the label widget click group mapper.