Sayonara Player
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Utils
WebAccess
WebClientImpl.h
1
/* WebClientImpl.h */
2
/*
3
* Copyright (C) 2011-2024 Michael Lugmair
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
#ifndef SAYONARA_PLAYER_WEBCLIENTIMPL_H
21
#define SAYONARA_PLAYER_WEBCLIENTIMPL_H
22
23
#include "WebClient.h"
24
#include "Utils/Pimpl.h"
25
26
class
AbstractWebClientStopper :
27
public
QObject
28
{
29
Q_OBJECT
30
PIMPL(AbstractWebClientStopper)
31
32
signals:
33
void
sigFinished();
34
void
sigTimeout();
35
void
sigStopped();
36
37
public
:
38
explicit
AbstractWebClientStopper(QObject* parent);
39
~AbstractWebClientStopper()
noexcept
override
;
40
41
void
startTimer(
int
timeout);
42
void
stopTimer();
43
void
stop();
44
45
private
slots:
// NOLINT(readability-redundant-access-specifiers)
46
void
timeout();
47
};
48
49
class
WebClientImpl :
50
public
WebClient
51
{
52
Q_OBJECT
53
PIMPL(WebClientImpl)
54
55
public
:
56
explicit
WebClientImpl(QObject* parent);
57
~WebClientImpl()
override
;
58
59
void
run(
const
QString& url,
int
timeout = WebClient::Timeout)
override
;
60
void
runPost(
const
QString& url,
const
QByteArray& postData,
int
timeout)
override
;
61
62
void
setMode(WebClientImpl::Mode mode)
override
;
63
void
setRawHeader(
const
QMap<QByteArray, QByteArray>
& header)
override
;
64
65
[[nodiscard]]
bool
hasData()
const override
;
66
[[nodiscard]] QByteArray data()
const override
;
67
[[nodiscard]] QByteArray errorData()
const override
;
68
[[nodiscard]] QString url()
const override
;
69
[[nodiscard]] WebClientImpl::Status status()
const override
;
70
[[nodiscard]]
bool
hasError()
const override
;
71
72
public
slots:
// NOLINT(readability-redundant-access-specifiers)
73
void
stop()
override
;
74
void
setUserAgent(
const
QString& userAgent)
override
;
75
76
private
slots:
77
void
dataAvailable();
78
void
finished();
79
void
timeout();
80
81
private
:
82
void
reset();
83
};
84
85
#endif
//SAYONARA_PLAYER_WEBCLIENTIMPL_H
QMap
Definition
org_mpris_media_player2_adaptor.h:21
Generated on
for Sayonara Player by
1.17.0