QDjango
|
00001 /* 00002 * Copyright (C) 2010-2012 Jeremy Lainé 00003 * Contact: http://code.google.com/p/qdjango/ 00004 * 00005 * This file is part of the QDjango Library. 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 */ 00017 00018 #ifndef QDJANGO_HTTP_SERVER_H 00019 #define QDJANGO_HTTP_SERVER_H 00020 00021 #include <QHostAddress> 00022 #include <QObject> 00023 00024 #include "QDjangoHttp_p.h" 00025 00026 class QDjangoHttpRequest; 00027 class QDjangoHttpResponse; 00028 class QDjangoHttpServer; 00029 class QDjangoHttpServerPrivate; 00030 class QDjangoUrlResolver; 00031 00042 class QDJANGO_EXPORT QDjangoHttpServer : public QObject 00043 { 00044 Q_OBJECT 00045 00046 public: 00047 QDjangoHttpServer(QObject *parent = 0); 00048 ~QDjangoHttpServer(); 00049 00050 void close(); 00051 bool listen(const QHostAddress &address, quint16 port); 00052 QDjangoUrlResolver *urls() const; 00053 00054 signals: 00057 void requestFinished(QDjangoHttpRequest *request, QDjangoHttpResponse *response); 00058 00059 private slots: 00060 void _q_newTcpConnection(); 00061 00062 private: 00063 Q_DISABLE_COPY(QDjangoHttpServer) 00064 QDjangoHttpServerPrivate* const d; 00065 }; 00066 00067 #endif