TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicsongstoolboxwidget.h
Go to the documentation of this file.
1 #ifndef MUSICSONGSTOOLBOXWIDGET_H
2 #define MUSICSONGSTOOLBOXWIDGET_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 
23 
24 struct MusicSongSort;
26 
31 {
32  Q_OBJECT
34 public:
38  explicit MusicSongsToolBoxTopWidget(int index, const QString &text, QWidget *parent = nullptr);
43 
47  inline void setSongSort(MusicSongSort *sort) { m_songSort = sort; }
48 
49 Q_SIGNALS:
53  void addNewRowItem();
57  void deleteRowItem(int index);
61  void deleteRowItemAll(int index);
65  void changRowItemName(int index, const QString &name);
69  void addNewFiles(int index);
73  void addNewDir(int index);
77  void songListSortBy(int index);
81  void addToPlayLater(int index);
85  void addToPlayedList(int index);
86 
87 public Q_SLOTS:
91  void deleteRowItemChanged();
95  void deleteRowItemAllChanged();
99  void changRowItemNameChanged();
103  void changItemName(const QString &name);
107  void addNewFilesChanged();
111  void addNewDirChanged();
115  void exportSongsItemList();
119  void showMenu();
123  void songListSortBy(QAction *action);
127  void addToPlayLater();
131  void addToPlayedList();
132 
133 private:
137  virtual bool isItemEnabled() const override final;
141  virtual void contextMenuEvent(QContextMenuEvent *event) override final;
142  virtual void paintEvent(QPaintEvent *event) override;
143 
144  MusicSongSort *m_songSort;
145  MusicItemRenameEidt *m_renameEdit;
146 
147 };
148 
149 
154 {
155  Q_OBJECT
157 public:
161  explicit MusicSongsToolBoxMaskWidget(QWidget *parent = nullptr);
166 
167 private:
171  virtual void paintEvent(QPaintEvent *event) override final;
172 
173  QTimer *m_updateTimer;
174 
175 };
176 
177 
182 {
183  Q_OBJECT
185 public:
189  explicit MusicSongsToolBoxWidgetItem(int index, const QString &text, QWidget *parent = nullptr);
190 
194  void setSongSort(MusicSongSort *sort);
195 
196 Q_SIGNALS:
200  void addNewRowItem();
204  void deleteRowItem(int index);
208  void deleteRowItemAll(int index);
212  void changRowItemName(int index, const QString &name);
216  void addNewFiles(int index);
220  void addNewDir(int index);
224  void songListSortBy(int index);
228  void addToPlayLater(int index);
232  void addToPlayedList(int index);
233 
234 };
235 
236 
241 {
242  Q_OBJECT
244 public:
248  explicit MusicSongsToolBoxWidget(QWidget *parent = nullptr);
249 
253  void setSongSort(QWidget *item, MusicSongSort *sort);
254 
258  int makeValidIndex() const;
259 
260 private:
264  virtual MusicFunctionToolBoxWidgetItem* initialItem(QWidget *item, const QString &text) override final;
265 
266 };
267 
268 #endif // MUSICSONGSTOOLBOXWIDGET_H
The class of the tool box widget item.
#define TTK_MODULE_EXPORT
The class of the function tool box widget.
virtual MusicFunctionToolBoxWidgetItem * initialItem(QWidget *item, const QString &text)=0
The class of the function tool box top widget.
The class of the tool box top widget.
The class of the item rename edit.
virtual void paintEvent(QPaintEvent *event) override
The class of the tool box mask widget.
const char * name
Definition: http_parser.c:458
The class of the function tool box widget item.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the music song sort tag.
Definition: musicsong.h:142
The class of the tool box widget.
void setSongSort(MusicSongSort *sort)
#define const
Definition: zconf.h:233