TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
qhttpserver.h
Go to the documentation of this file.
1 #ifndef QHTTPSERVER_H
2 #define QHTTPSERVER_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 #define QHTTPSERVER_VERSION_MAJOR 0
23 #define QHTTPSERVER_VERSION_MINOR 1
24 #define QHTTPSERVER_VERSION_PATCH 0
25 
26 #include <QHostAddress>
27 #include "qhttpserverfwd.h"
28 
29 class QHttpServerPrivate;
30 
32 extern QHash<int, QString> STATUS_CODES;
33 
37 class TTK_MODULE_EXPORT QHttpServer : public QObject
38 {
39  Q_OBJECT
40 public:
42 
43  explicit QHttpServer(QObject *parent = nullptr);
44 
46 
52  bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 80);
53 
55 
58  bool listen(quint16 port);
59 
61  void close();
62 
63 Q_SIGNALS:
65 
69  void newRequest(QHttpRequest *request, QHttpResponse *response);
70 
71 private Q_SLOTS:
72  void newConnection();
73 
74 private:
76 
77 };
78 
79 #endif
#define TTK_MODULE_EXPORT
The class of the http response.
Definition: qhttpresponse.h:29
QHash< int, QString > STATUS_CODES
Maps status codes to string reason phrases.
Definition: qhttpserver.cpp:9
The class of the http request.
Definition: qhttprequest.h:32
The class of the http server.
Definition: qhttpserver.h:37
#define TTK_DECLARE_PRIVATE(Class)
Definition: ttkprivate.h:26
The class of the http server private.
Definition: qhttpserver.cpp:14