Sayonara Player
Loading...
Searching...
No Matches
LFMWebAccess.h
1/* WebAccess.h */
2
3/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21
22/*
23 * WebAccess.h
24 *
25 * Created on: Oct 22, 2011
26 * Author: Michael Lugmair (Lucio Carreras)
27 */
28
29#ifndef SAYONARA_LASTFM_WEBACCESS_H
30#define SAYONARA_LASTFM_WEBACCESS_H
31
32#include "Utils/Pimpl.h"
33
34#include <QObject>
35#include <QMap>
36
37class QByteArray;
38class QString;
39
41class WebClient;
42namespace LastFM
43{
44 using UrlParams = QMap<QString, QString>;
45 class WebAccess :
46 public QObject
47 {
48 Q_OBJECT
49 PIMPL(WebAccess)
50
51 signals:
52 void sigFinished();
53
54 public:
55 explicit WebAccess(const std::shared_ptr <WebClientFactory>& webClientFactory, QObject* parent = nullptr);
56 ~WebAccess() override;
57
58 void callUrl(const QString& url);
59 void callPostUrl(const QString& url, const QByteArray& postData);
60
61 [[nodiscard]] QByteArray data() const;
62
63 private:
64 WebClient* initWebClient();
65
66 private slots: // NOLINT(readability-redundant-access-specifiers)
67 void webClientFinished();
68 };
69
70 QByteArray createPostData(UrlParams signatureData);
71}
72#endif /* SAYONARA_LASTFM_WEBACCESS_H */
Definition: LFMWebAccess.h:47
Definition: org_mpris_media_player2_adaptor.h:21
Definition: WebClientFactory.h:29
Definition: WebClient.h:30