2011-09-23 22:06:21 +02:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2013-07-11 16:21:57 +02:00
|
|
|
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
|
2011-09-23 22:06:21 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2011-09-18 15:35:44 +02:00
|
|
|
#ifndef QUPZILLASCHEMEHANDLER_H
|
|
|
|
#define QUPZILLASCHEMEHANDLER_H
|
|
|
|
|
|
|
|
#include <QNetworkReply>
|
|
|
|
#include <QBuffer>
|
2012-02-29 18:33:50 +01:00
|
|
|
|
2012-03-15 19:35:37 +01:00
|
|
|
#include "schemehandler.h"
|
2012-02-29 18:33:50 +01:00
|
|
|
#include "qz_namespace.h"
|
2011-09-18 15:35:44 +02:00
|
|
|
|
2012-03-15 19:35:37 +01:00
|
|
|
class QT_QUPZILLA_EXPORT QupZillaSchemeHandler : public SchemeHandler
|
2011-09-18 15:35:44 +02:00
|
|
|
{
|
|
|
|
public:
|
2012-01-21 20:27:45 +01:00
|
|
|
explicit QupZillaSchemeHandler();
|
2011-09-18 15:35:44 +02:00
|
|
|
|
|
|
|
QNetworkReply* createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData);
|
|
|
|
};
|
|
|
|
|
2012-02-29 18:33:50 +01:00
|
|
|
class QT_QUPZILLA_EXPORT QupZillaSchemeReply : public QNetworkReply
|
2011-09-18 15:35:44 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit QupZillaSchemeReply(const QNetworkRequest &req, QObject* parent = 0);
|
|
|
|
|
2012-06-24 23:46:32 +02:00
|
|
|
qint64 bytesAvailable() const;
|
2011-09-18 15:35:44 +02:00
|
|
|
|
|
|
|
protected:
|
2012-06-24 23:46:32 +02:00
|
|
|
qint64 readData(char* data, qint64 maxSize);
|
|
|
|
void abort() { }
|
2011-09-18 15:35:44 +02:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void delayedFinish();
|
|
|
|
void loadPage();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString aboutPage();
|
2011-09-19 20:49:39 +02:00
|
|
|
QString reportbugPage();
|
2011-10-01 20:06:38 +02:00
|
|
|
QString startPage();
|
2011-12-02 23:25:27 +01:00
|
|
|
QString speeddialPage();
|
2012-08-21 20:28:38 +02:00
|
|
|
QString restorePage();
|
2012-02-13 19:09:02 +01:00
|
|
|
QString configPage();
|
2011-09-18 15:35:44 +02:00
|
|
|
|
|
|
|
QBuffer m_buffer;
|
|
|
|
QString m_pageName;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QUPZILLASCHEMEHANDLER_H
|