TTKMusicPlayer  4.3.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 - 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 
23 
24 struct MusicSongSort;
26 
31 {
32  Q_OBJECT
33 public:
37  explicit MusicSongsToolBoxTopWidget(int index, const QString &text, QWidget *parent = nullptr);
42 
46  inline void setSongSort(MusicSongSort *sort) noexcept { m_songSort = sort; }
47 
48 Q_SIGNALS:
52  void addNewRowItem();
56  void deleteRowItem(int index);
60  void deleteAllItems(int index);
64  void changRowItemName(int index, const QString &name);
68  void addNewFiles(int index);
72  void addNewDir(int index);
76  void songListSortBy(int index);
80  void addToPlayLater(int index);
84  void addToPlayedList(int index);
85 
86 public Q_SLOTS:
90  void deleteRowItemChanged();
94  void deleteAllItemsChanged();
98  void changRowItemNameChanged();
102  void changItemName(const QString &name);
106  void addNewFilesChanged();
110  void addNewDirChanged();
114  void exportSongsItem();
118  void showMenu();
122  void songListSortBy(QAction *action);
126  void addToPlayLater();
130  void addToPlayedList();
131 
132 private:
136  virtual bool isItemEnabled() const override final;
140  virtual void contextMenuEvent(QContextMenuEvent *event) override final;
141  virtual void paintEvent(QPaintEvent *event) override;
142 
143  MusicSongSort *m_songSort;
144  MusicItemRenameEidt *m_renameEdit;
145 
146 };
147 
148 
153 {
154  Q_OBJECT
155 public:
159  explicit MusicSongsToolBoxMaskWidget(QWidget *parent = nullptr);
164 
165 private:
169  virtual void paintEvent(QPaintEvent *event) override final;
170 
171  QTimer *m_updateTimer;
172 
173 };
174 
175 
180 {
181  Q_OBJECT
182 public:
186  explicit MusicSongsToolBoxWidgetItem(int index, const QString &text, QWidget *parent = nullptr);
187 
191  void setSongSort(MusicSongSort *sort);
192 
193 Q_SIGNALS:
197  void addNewRowItem();
201  void deleteRowItem(int index);
205  void deleteAllItems(int index);
209  void changRowItemName(int index, const QString &name);
213  void addNewFiles(int index);
217  void addNewDir(int index);
221  void songListSortBy(int index);
225  void addToPlayLater(int index);
229  void addToPlayedList(int index);
230 
231 };
232 
233 
238 {
239  Q_OBJECT
240 public:
244  explicit MusicSongsToolBoxWidget(QWidget *parent = nullptr);
245 
249  void setSongSort(QWidget *item, MusicSongSort *sort);
250 
254  int makeValidIndex() const;
255 
256 private:
260  virtual MusicFunctionToolBoxWidgetItem* initialItem(QWidget *item, const QString &text) override final;
261 
262 };
263 
264 #endif // MUSICSONGSTOOLBOXWIDGET_H
The class of the tool box widget item.
#define TTK_MODULE_EXPORT
The class of the function tool box widget.
void setSongSort(MusicSongSort *sort) noexcept
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.
The class of the music song sort tag.
Definition: musicsong.h:141
The class of the tool box widget.
#define const
Definition: zconf.h:233