TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiccloudmanagerwidget.h
Go to the documentation of this file.
1 #ifndef MUSICCLOUDMANAGERWIDGET_H
2 #define MUSICCLOUDMANAGERWIDGET_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 "musicwidgetheaders.h"
23 #include "musicclouddataitem.h"
25 
26 class QSyncListData;
27 class QSyncDeleteData;
28 class QSyncUploadData;
29 class QSyncDownloadData;
30 class QNetworkAccessManager;
33 
38 {
39  Q_OBJECT
41 public:
45  explicit MusicCloudManagerTableWidget(QWidget *parent = nullptr);
50 
54  bool queryCloudKey();
58  void resizeSection() const;
59 
60 Q_SIGNALS:
64  void updateLabelMessage(const QString &text);
68  void updataSizeLabel(qint64 size);
72  void finished();
76  void uploadFileError(const MusicCloudDataItem &item);
77 
78 public Q_SLOTS:
82  void downLoadFinished(const QByteArray &bytes);
86  void receiveDataFinshed(const QSyncDataItemList &items);
90  void uploadFileFinished(const QString &time);
94  void deleteFileFinished(bool state);
95 
99  void updateListToServer();
103  void deleteFileToServer();
107  void deleteFilesToServer();
111  void downloadFileToServer();
112 
116  void cancelUploadFilesToServer();
120  void uploadFilesToServer();
124  void uploadFileDirToServer();
128  void reuploadFilesToServer(const QStringList &items);
129 
133  void uploadProgress(const QString &time, qint64 bytesSent, qint64 bytesTotal);
137  void uploadDone();
141  void showFileInformationWidget();
142 
143 private:
147  virtual void contextMenuEvent(QContextMenuEvent *event) override final;
151  bool cloudConfigValid() const;
155  void addCellItem(const MusicCloudDataItem &data);
159  void uploadFilesToServer(const QStringList &paths);
163  void createUploadFileModule();
167  void startToUploadFile();
171  int FindUploadItemRow(const QString &time) const;
175  MusicCloudDataItem FindWaitedItemRow() const;
176 
178  bool m_cancel;
184  QNetworkAccessManager *m_manager;
188 
189 };
190 
191 
192 
197 {
198  Q_OBJECT
200 public:
204  explicit MusicCloudManagerWidget(QWidget *parent = nullptr);
209 
213  void initialize() const;
217  virtual void resizeWidget() override final;
218 
219 public Q_SLOTS:
223  void updataSizeLabel(qint64 size);
227  void downloadFileToServer();
231  void deleteFileToServer();
235  void uploadFilesToServer();
236 
237 private:
241  virtual void resizeEvent(QResizeEvent *event) override final;
242 
244  QWidgetList m_resizeWidgets;
245  QProgressBar *m_sizeValueBar;
247 
248 };
249 
250 #endif // MUSICCLOUDMANAGERWIDGET_H
TTKProgressBarItemDelegate * m_progressBarDelegate
#define TTK_MODULE_EXPORT
The class of the cloud shared song table widget.
The class of the table widget base.
The class of the progress bar item delegate.
voidpf void uLong size
Definition: ioapi.h:136
The class of the cloud manager widget.
MusicCloudManagerTableWidget * m_tableWidget
MusicOpenFileWidget * m_openFileWidget
The class of the sync cloud download data.
The class of the cloud data item.
The class of the sync cloud upload data.
The class of the sync cloud list data.
Definition: qsynclistdata.h:27
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the widget resize interface.
virtual void resizeWidget()=0
The class of the open file widget.
state
Definition: http_parser.c:279
The class of the sync cloud delete data.