• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.9.5 API Reference
  • KDE Home
  • Contact Us
 

KDEWebKit

kwebpage.h
Go to the documentation of this file.
00001 /*
00002  * This file is part of the KDE project.
00003  *
00004  * Copyright (C) 2008 Dirk Mueller <mueller@kde.org>
00005  * Copyright (C) 2008 Urs Wolfer <uwolfer @ kde.org>
00006  * Copyright (C) 2008 Michael Howell <mhowell123@gmail.com>
00007  * Copyright (C) 2009,2010 Dawit Alemayehu <adawit @ kde.org>
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Library General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2 of the License, or (at your option) any later version.
00013  *
00014  * This library is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Library General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Library General Public License
00020  * along with this library; see the file COPYING.LIB.  If not, write to
00021  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022  * Boston, MA 02110-1301, USA.
00023  *
00024  */
00025 #ifndef KWEBPAGE_H
00026 #define KWEBPAGE_H
00027 
00028 #include <kdewebkit_export.h>
00029 
00030 #include <QtWebKit/QWebPage>
00031 
00032 class KWebWallet;
00033 class KUrl;
00034 class KJob;
00035 
00036 namespace KIO {
00037     class MetaData;
00038     class Job;
00039 }
00040 
00075 class KDEWEBKIT_EXPORT KWebPage : public QWebPage
00076 {
00077     Q_OBJECT
00078     Q_FLAGS (Integration)
00079 
00080 public:
00084     enum IntegrationFlags
00085     {
00090         NoIntegration = 0x01,
00096         KIOIntegration = 0x02,
00101         KPartsIntegration = 0x04,
00108         KWalletIntegration = 0x08
00109     };
00110     Q_DECLARE_FLAGS(Integration, IntegrationFlags)
00111 
00112     
00124     explicit KWebPage(QObject *parent = 0, Integration flags = Integration());
00125 
00129     ~KWebPage();
00130 
00144     bool isExternalContentAllowed() const;
00145 
00156     KWebWallet *wallet() const;
00157 
00169     void setAllowExternalContent(bool allow);
00170 
00184     void setWallet(KWebWallet* wallet);
00185 
00186 public Q_SLOTS:
00193     virtual void downloadRequest(const QNetworkRequest &request);
00194 
00201     virtual void downloadUrl(const KUrl &url);
00202 
00220     void downloadResponse(QNetworkReply *reply);
00221 
00222 protected:
00237     QString sessionMetaData(const QString &key) const;
00238 
00253     QString requestMetaData(const QString &key) const;
00254 
00268     void setSessionMetaData(const QString &key, const QString &value);
00269 
00284     void setRequestMetaData(const QString &key, const QString &value);
00285 
00296     void removeSessionMetaData(const QString &key);
00297 
00308     void removeRequestMetaData(const QString &key);
00309 
00323     virtual QString userAgentForUrl(const QUrl& url) const;
00324 
00338     virtual bool acceptNavigationRequest(QWebFrame * frame, const QNetworkRequest & request, NavigationType type);
00339 
00356     bool handleReply (QNetworkReply* reply, QString* contentType = 0, KIO::MetaData* metaData = 0);
00357 
00358 private:
00359     class KWebPagePrivate;
00360     KWebPagePrivate* const d;
00361     Q_PRIVATE_SLOT(d, void _k_copyResultToTempFile(KJob*))
00362     Q_PRIVATE_SLOT(d, void _k_receivedContentType(KIO::Job*, const QString&))
00363     Q_PRIVATE_SLOT(d, void _k_contentTypeCheckFailed(KJob*))
00364 };
00365 
00366 Q_DECLARE_OPERATORS_FOR_FLAGS(KWebPage::Integration)
00367 
00368 #endif // KWEBPAGE_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Jan 21 2019 12:37:47 by doxygen 1.7.5.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEWebKit

Skip menu "KDEWebKit"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.9.5 API Reference

Skip menu "kdelibs-4.9.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal