hyperion.ng/libsrc/webconfig/StaticFileServing.h
redPanther 4533b34606 Hyperiond refactoring + preparation for ip restriction settings (#12)
* make hyperion to singelton.
remove arguments for config and hyperion - both are gettable via Hyperion::getInstance

* refactor hyperiond

* remove qt4 comapt
make zeroconf mandatory
refactor hyperiond

* xbmcchecker is now a singleton

* cleanup in hyperiond
zeroconf switchable between static and shared linking

* fix xbmcchecker

* extensive refactoring of hyperiond
webserver: make client ip information availabel in request object - preparation for ip filters
proto/json server, use hyperion::getInstance instead of hyperion argument

* move creation of hyperion core into hyperionDeamon class
cleanup
2016-06-19 00:56:47 +02:00

37 lines
875 B
C++

#ifndef STATICFILESERVING_H
#define STATICFILESERVING_H
#include <QObject>
#include <QMimeDatabase>
#include "QtHttpServer.h"
#include "QtHttpRequest.h"
#include "QtHttpReply.h"
#include "QtHttpHeader.h"
#include "CgiHandler.h"
#include <hyperion/Hyperion.h>
class StaticFileServing : public QObject {
Q_OBJECT
public:
explicit StaticFileServing (Hyperion *hyperion, QString baseUrl, quint16 port, QObject * parent = nullptr);
virtual ~StaticFileServing (void);
public slots:
void onServerStopped (void);
void onServerStarted (quint16 port);
void onServerError (QString msg);
void onRequestNeedsReply (QtHttpRequest * request, QtHttpReply * reply);
private:
Hyperion * _hyperion;
QString _baseUrl;
QtHttpServer * _server;
QMimeDatabase * _mimeDb;
CgiHandler _cgi;
};
#endif // STATICFILESERVING_H