strawberry-audio-player-win.../src/internet/internetsongsview.h

70 lines
1.9 KiB
C
Raw Normal View History

2019-06-17 23:54:24 +02:00
/*
* Strawberry Music Player
2021-03-20 21:14:47 +01:00
* Copyright 2018-2021, Jonas Kvinge <jonas@jkvinge.net>
2019-06-17 23:54:24 +02:00
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Strawberry is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef INTERNETSONGSVIEW_H
#define INTERNETSONGSVIEW_H
#include "config.h"
2020-02-09 02:29:35 +01:00
#include <QObject>
2019-06-17 23:54:24 +02:00
#include <QWidget>
#include <QMap>
2019-06-17 23:54:24 +02:00
#include <QString>
2020-02-09 02:29:35 +01:00
#include "core/song.h"
2019-06-17 23:54:24 +02:00
#include "settings/settingsdialog.h"
#include "ui_internetcollectionviewcontainer.h"
class QContextMenuEvent;
class Application;
class InternetService;
class InternetCollectionView;
class InternetSongsView : public QWidget {
Q_OBJECT
public:
2020-04-07 16:49:15 +02:00
explicit InternetSongsView(Application *app, InternetService *service, const QString &settings_group, const SettingsDialog::Page settings_page, QWidget *parent = nullptr);
2020-06-15 21:55:05 +02:00
~InternetSongsView() override;
2019-06-17 23:54:24 +02:00
void ReloadSettings();
InternetCollectionView *view() const { return ui_->view; }
bool SearchFieldHasFocus() const { return ui_->filter_widget->SearchFieldHasFocus(); }
void FocusSearchField() { ui_->filter_widget->FocusSearchField(); }
2019-06-17 23:54:24 +02:00
private slots:
2020-04-20 18:01:45 +02:00
void OpenSettingsDialog();
2019-06-17 23:54:24 +02:00
void GetSongs();
2019-09-15 20:27:32 +02:00
void AbortGetSongs();
void SongsFinished(const SongMap &songs, const QString &error);
2019-06-17 23:54:24 +02:00
private:
Application *app_;
InternetService *service_;
QString settings_group_;
SettingsDialog::Page settings_page_;
Ui_InternetCollectionViewContainer *ui_;
};
#endif // INTERNETSONGSVIEW_H