KIO::AccessManager

Search for usage in LXR

#include <KIO/AccessManager>

Inheritance diagram for KIO::AccessManager:

Public Types

enum  Attribute { MetaData = QNetworkRequest::User, KioError }
 
- Public Types inherited from QNetworkAccessManager
enum  NetworkAccessibility
 
enum  Operation
 

Public Member Functions

 AccessManager (QObject *parent)
 
 ~AccessManager () override
 
WId cookieJarWindowid () const
 
bool isExternalContentAllowed () const
 
KIO::MetaDatarequestMetaData ()
 
KIO::MetaDatasessionMetaData ()
 
void setCookieJarWindowId (WId id)
 
void setEmitReadyReadOnMetaDataChange (bool)
 
void setExternalContentAllowed (bool allowed)
 
void setWindow (QWidget *widget)
 
QWidgetwindow () const
 
- Public Member Functions inherited from QNetworkAccessManager
 QNetworkAccessManager (QObject *parent)
 
QNetworkConfiguration activeConfiguration () const const
 
void addStrictTransportSecurityHosts (const QVector< QHstsPolicy > &knownHosts)
 
void authenticationRequired (QNetworkReply *reply, QAuthenticator *authenticator)
 
bool autoDeleteReplies () const const
 
QAbstractNetworkCachecache () const const
 
void clearAccessCache ()
 
void clearConnectionCache ()
 
QNetworkConfiguration configuration () const const
 
void connectToHost (const QString &hostName, quint16 port)
 
void connectToHostEncrypted (const QString &hostName, quint16 port, const QSslConfiguration &sslConfiguration)
 
void connectToHostEncrypted (const QString &hostName, quint16 port, const QSslConfiguration &sslConfiguration, const QString &peerName)
 
QNetworkCookieJarcookieJar () const const
 
QNetworkReplydeleteResource (const QNetworkRequest &request)
 
void enableStrictTransportSecurityStore (bool enabled, const QString &storeDir)
 
void encrypted (QNetworkReply *reply)
 
void finished (QNetworkReply *reply)
 
QNetworkReplyget (const QNetworkRequest &request)
 
QNetworkReplyhead (const QNetworkRequest &request)
 
bool isStrictTransportSecurityEnabled () const const
 
bool isStrictTransportSecurityStoreEnabled () const const
 
QNetworkAccessManager::NetworkAccessibility networkAccessible () const const
 
void networkAccessibleChanged (QNetworkAccessManager::NetworkAccessibility accessible)
 
QNetworkReplypost (const QNetworkRequest &request, const QByteArray &data)
 
QNetworkReplypost (const QNetworkRequest &request, QHttpMultiPart *multiPart)
 
QNetworkReplypost (const QNetworkRequest &request, QIODevice *data)
 
void preSharedKeyAuthenticationRequired (QNetworkReply *reply, QSslPreSharedKeyAuthenticator *authenticator)
 
QNetworkProxy proxy () const const
 
void proxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *authenticator)
 
QNetworkProxyFactoryproxyFactory () const const
 
QNetworkReplyput (const QNetworkRequest &request, const QByteArray &data)
 
QNetworkReplyput (const QNetworkRequest &request, QHttpMultiPart *multiPart)
 
QNetworkReplyput (const QNetworkRequest &request, QIODevice *data)
 
QNetworkRequest::RedirectPolicy redirectPolicy () const const
 
QNetworkReplysendCustomRequest (const QNetworkRequest &request, const QByteArray &verb, const QByteArray &data)
 
QNetworkReplysendCustomRequest (const QNetworkRequest &request, const QByteArray &verb, QHttpMultiPart *multiPart)
 
QNetworkReplysendCustomRequest (const QNetworkRequest &request, const QByteArray &verb, QIODevice *data)
 
void setAutoDeleteReplies (bool shouldAutoDelete)
 
void setCache (QAbstractNetworkCache *cache)
 
void setConfiguration (const QNetworkConfiguration &config)
 
void setCookieJar (QNetworkCookieJar *cookieJar)
 
void setNetworkAccessible (QNetworkAccessManager::NetworkAccessibility accessible)
 
void setProxy (const QNetworkProxy &proxy)
 
void setProxyFactory (QNetworkProxyFactory *factory)
 
void setRedirectPolicy (QNetworkRequest::RedirectPolicy policy)
 
void setStrictTransportSecurityEnabled (bool enabled)
 
void setTransferTimeout (int timeout)
 
void sslErrors (QNetworkReply *reply, const QList< QSslError > &errors)
 
QVector< QHstsPolicystrictTransportSecurityHosts () const const
 
QStringList supportedSchemes () const const
 
int transferTimeout () const const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static void putReplyOnHold (QNetworkReply *reply)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Protected Member Functions

QNetworkReplycreateRequest (Operation op, const QNetworkRequest &req, QIODevice *outgoingData=nullptr) override
 
- Protected Member Functions inherited from QNetworkAccessManager
QStringList supportedSchemesImplementation () const const
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Properties inherited from QNetworkAccessManager
 networkAccessible
 
- Properties inherited from QObject
 objectName
 
- Public Attributes inherited from QNetworkAccessManager
 Accessible
 
 CustomOperation
 
 DeleteOperation
 
 GetOperation
 
 HeadOperation
 
 NotAccessible
 
 PostOperation
 
 PutOperation
 
 UnknownAccessibility
 
 UnknownOperation
 
- Public Attributes inherited from QObject
typedef QObjectList
 

Detailed Description

A KDE implementation of QNetworkAccessManager.

Use this class instead of QNetworkAccessManager if you want to integrate with KDE's KIO and KCookieJar modules for network operations and cookie handling respectively.

Here is a simple example that shows how to set the QtWebKit module to use KDE's KIO for its network operations:

QWebView *view = new QWebView(this);
view->page()->setNetworkAccessManager(manager);

To access member functions in the cookiejar class at a later point in your code simply downcast the pointer returned by QWebPage::networkAccessManager as follows:

KIO::Integration::AccessManager *manager = qobject_cast<KIO::Integration::AccessManager*>(view->page()->accessManager());

Please note that this class is in the KIO namespace for backward compatibility. You should use KIO::Integration::AccessManager to access this class in your code.

IMPORTANTThis class is not a replacement for the standard KDE API. It should ONLY be used to provide KDE integration in applications that cannot use the standard KDE API directly.

Author
Urs Wolfer <uwolfer @ kde.org>
Dawit Alemayehu <adawit @ kde.org>
Deprecated:
Use the KIO::Integration::AccessManager typedef to access this class instead.
Since
4.3

Definition at line 64 of file accessmanager.h.

Member Enumeration Documentation

◆ Attribute

Extensions to QNetworkRequest::Attribute enums.

Since
4.3.2
Enumerator
KioError 

< Used to send KIO MetaData back and forth.

type: QVariant::Map. Used to send KIO error codes that cannot be mapped into QNetworkReply::NetworkError. type: QVariant::Int

Definition at line 72 of file accessmanager.h.

Constructor & Destructor Documentation

◆ AccessManager()

AccessManager::AccessManager ( QObject parent)

Constructor.

Definition at line 93 of file accessmanager.cpp.

◆ ~AccessManager()

AccessManager::~AccessManager ( )
overridedefault

Destructor.

Member Function Documentation

◆ cookieJarWindowid()

WId AccessManager::cookieJarWindowid ( ) const

Returns the cookiejar's window id.

This is a convenience function that returns the window id associated with the cookiejar. Note that this function will return a 0 if the cookiejar is not of type KIO::Integration::CookieJar or a window id has not yet been set.

See also
KIO::Integration::CookieJar::windowId.
Since
4.4
Deprecated:
Since 5.0, use KIO::Integration::CookieJar::windowId

Definition at line 149 of file accessmanager.cpp.

◆ createRequest()

QNetworkReply * AccessManager::createRequest ( Operation  op,
const QNetworkRequest req,
QIODevice outgoingData = nullptr 
)
overrideprotectedvirtual

Reimplemented for internal reasons, the API is not affected.

See also
QNetworkAccessManager::createRequest

Reimplemented from QNetworkAccessManager.

Definition at line 190 of file accessmanager.cpp.

◆ isExternalContentAllowed()

bool AccessManager::isExternalContentAllowed ( ) const

Returns true if external content is going to be fetched.

See also
setExternalContentAllowed

Definition at line 108 of file accessmanager.cpp.

◆ putReplyOnHold()

void AccessManager::putReplyOnHold ( QNetworkReply reply)
static

Puts the KIO worker associated with the given reply on hold.

This function is intended to make possible the implementation of the special case mentioned in KIO::get's documentation within the KIO-QNAM integration.

See also
KIO::get.
Since
4.6

Definition at line 175 of file accessmanager.cpp.

◆ requestMetaData()

KIO::MetaData & AccessManager::requestMetaData ( )

Returns a reference to the temporary meta data container.

See kdelibs/kio/DESIGN.metadata for list of supported KIO meta data.

Use this function when you want to set per request KIO meta data that will be removed after it has been sent once.

Since
4.4

Definition at line 165 of file accessmanager.cpp.

◆ sessionMetaData()

KIO::MetaData & AccessManager::sessionMetaData ( )

Returns a reference to the persistent meta data container.

See kdelibs/kio/DESIGN.metadata for list of supported KIO meta data.

Use this function when you want to set per session KIO meta data that will be sent with every request.

Unlike requestMetaData, the meta data values set using the reference returned by this function will not be deleted and will be sent with every request.

Since
4.4

Definition at line 170 of file accessmanager.cpp.

◆ setCookieJarWindowId()

void AccessManager::setCookieJarWindowId ( WId  id)

Sets the cookiejar's window id to id.

This is a convenience function that allows you to set the cookiejar's window id. Note that this function does nothing unless the cookiejar in use is of type KIO::Integration::CookieJar.

By default the cookiejar's window id is set to false. Make sure you call this function and set the window id to its proper value when create an instance of this object. Otherwise, the KDE cookiejar will not be able to properly manage session based cookies.

See also
KIO::Integration::CookieJar::setWindowId.
Since
4.4
Deprecated:
Since 5.0, use KIO::Integration::CookieJar::setWindowId

Definition at line 114 of file accessmanager.cpp.

◆ setEmitReadyReadOnMetaDataChange()

void AccessManager::setEmitReadyReadOnMetaDataChange ( bool  enable)

Sets the network reply object to emit readyRead when it receives meta data.

Meta data is any information that is not the actual content itself, e.g. HTTP response headers of the HTTP protocol.

Calling this function will force the code connecting to QNetworkReply's readyRead signal to prematurely start dealing with the content that might not yet have arrived. However, it is essential to make the put worker on hold functionality of KIO work in libraries like QtWebKit.

See also
QNetworkReply::metaDataChanged
Since
4.7

Definition at line 185 of file accessmanager.cpp.

◆ setExternalContentAllowed()

void AccessManager::setExternalContentAllowed ( bool  allowed)

Set allowed to false if you don't want any external content to be fetched.

By default external content is fetched.

Definition at line 103 of file accessmanager.cpp.

◆ setWindow()

void AccessManager::setWindow ( QWidget widget)

Sets the window associated with this network access manager.

Note that widget will be used as a parent for dialogs in KIO as well as the cookie jar. If widget is not a window, this function will invoke QWidget::window() to obtain the window for the given widget.

See also
KIO::Integration::CookieJar::setWindow.
Since
4.7

Definition at line 130 of file accessmanager.cpp.

◆ window()

QWidget * AccessManager::window ( ) const

Returns the window associated with this network access manager.

See also
setWindow
Since
4.7

Definition at line 160 of file accessmanager.cpp.


The documentation for this class was generated from the following files:
A KDE implementation of QNetworkAccessManager.
Definition: accessmanager.h:64
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Dec 6 2022 03:56:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.