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_URL_RESOLVER_H 00019 #define QDJANGO_URL_RESOLVER_H 00020 00021 #include <QObject> 00022 #include <QVariant> 00023 00024 #include "QDjangoHttp_p.h" 00025 00026 class QDjangoHttpRequest; 00027 class QDjangoHttpResponse; 00028 class QDjangoUrlResolverPrivate; 00029 class QRegExp; 00030 00035 class QDJANGO_EXPORT QDjangoUrlResolver : public QObject 00036 { 00037 Q_OBJECT 00038 00039 public: 00040 QDjangoUrlResolver(QObject *parent = 0); 00041 ~QDjangoUrlResolver(); 00042 00043 bool include(const QRegExp &path, QDjangoUrlResolver *urls); 00044 bool set(const QRegExp &path, QObject *receiver, const char *member); 00045 QString reverse(QObject *receiver, const char *member, const QVariantList &args = QVariantList()) const; 00046 00047 public slots: 00048 QDjangoHttpResponse* respond(const QDjangoHttpRequest &request, const QString &path) const; 00049 00050 private: 00051 QDjangoUrlResolverPrivate *d; 00052 friend class QDjangoUrlResolverPrivate; 00053 }; 00054 00055 00056 #endif