Files
cantata/web/http/basichttpserver.h
Craig Drummond 59e329d3e9 Initial import of *VERY* incomplete, and not fully functional Cantata
webapp. Mainly used to test SQLite backend for storing MPD db.
2015-06-01 22:57:49 +01:00

49 lines
1020 B
C++

/**
* @file
*
* @author Stefan Frings
* @author Petr Bravenec petr.bravenec@hobrasoft.cz
* @author Craig Drummond
*/
#ifndef BASIC_HTTP_SERVER_H
#define BASIC_HTTP_SERVER_H
#include <QObject>
#include <QTcpServer>
#include <QString>
class HttpRequestHandler;
class HttpRequestHandlerFactory;
class HttpConnection;
class StaticFileController;
class QSettings;
class BasicHttpServer : public QTcpServer
{
Q_OBJECT
public:
static void enableDebug() { dbgEnabled=true; }
static bool debugEnabled() { return dbgEnabled; }
BasicHttpServer(QObject *parent, const QSettings *s);
bool start();
const QSettings * settings() const { return serverSettings; }
virtual HttpRequestHandler * getHandler(const QString &path);
virtual void handlerFinished(HttpRequestHandler *handler) { Q_UNUSED(handler) }
private Q_SLOTS:
void slotNewConnection();
protected:
const QSettings *serverSettings;
StaticFileController *staticFiles;
private:
static bool dbgEnabled;
};
#endif