KIO
accessmanager.h
Go to the documentation of this file.
00001 /* 00002 * This file is part of the KDE project. 00003 * 00004 * Copyright (C) 2008 - 2009 Urs Wolfer <uwolfer @ kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 */ 00022 00023 #ifndef KIO_ACCESSMANAGER_H 00024 #define KIO_ACCESSMANAGER_H 00025 00026 #include <kio/global.h> 00027 00028 #include <QtNetwork/QNetworkAccessManager> 00029 #include <QtNetwork/QNetworkRequest> 00030 #include <QtNetwork/QNetworkCookieJar> 00031 00032 namespace KIO { 00033 00069 class KIO_EXPORT AccessManager : public QNetworkAccessManager 00070 { 00071 Q_OBJECT 00072 public: 00077 enum Attribute { 00078 MetaData = QNetworkRequest::User, 00079 KioError 00080 }; 00081 00085 AccessManager(QObject *parent); 00086 00090 virtual ~AccessManager(); 00091 00096 void setExternalContentAllowed(bool allowed); 00097 00103 bool isExternalContentAllowed() const; 00104 00120 void setCookieJarWindowId(WId id); 00121 00133 WId cookieJarWindowid() const; 00134 00145 KIO::MetaData& requestMetaData(); 00146 00161 KIO::MetaData& sessionMetaData(); 00162 00173 static void putReplyOnHold(QNetworkReply* reply); 00174 00175 protected: 00182 virtual QNetworkReply *createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0); 00183 00184 private: 00185 class AccessManagerPrivate; 00186 AccessManagerPrivate* const d; 00187 }; 00188 00189 namespace Integration { 00190 // KDE5: Move AccessManager into the KIO::Integration namespace. 00191 typedef KIO::AccessManager AccessManager; 00192 00199 KIO_EXPORT bool sslConfigFromMetaData(const KIO::MetaData& metadata, QSslConfiguration& sslconfig); 00200 00232 class KIO_EXPORT CookieJar : public QNetworkCookieJar 00233 { 00234 Q_OBJECT 00235 public: 00239 explicit CookieJar(QObject *parent = 0); 00240 00244 ~CookieJar(); 00245 00249 WId windowId() const; 00250 00263 void setWindowId(WId id); 00264 00268 void reparseConfiguration(); 00269 00276 QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const; 00277 00284 bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url); 00285 00292 bool isCookieStorageDisabled() const; 00293 00303 void setDisableCookieStorage (bool disable); 00304 00305 private: 00306 class CookieJarPrivate; 00307 CookieJarPrivate* const d; 00308 }; 00309 00310 } 00311 00312 } 00313 00314 #endif // KIO_ACCESSMANAGER_H
KDE 4.6 API Reference