src/network/access/qnetworkaccessbackend_p.h
changeset 30 5dc02b23752f
parent 18 2f34d5167611
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
   109     //   may choose to re-fill it with more data it has ready or get
   109     //   may choose to re-fill it with more data it has ready or get
   110     //   more data from the network (for instance, by reading from its
   110     //   more data from the network (for instance, by reading from its
   111     //   socket).
   111     //   socket).
   112 
   112 
   113     virtual void open() = 0;
   113     virtual void open() = 0;
       
   114 #ifndef QT_NO_BEARERMANAGEMENT
       
   115     virtual bool start();
       
   116 #endif
   114     virtual void closeDownstreamChannel() = 0;
   117     virtual void closeDownstreamChannel() = 0;
   115     virtual bool waitForDownstreamReadyRead(int msecs) = 0;
   118     virtual bool waitForDownstreamReadyRead(int msecs) = 0;
   116 
   119 
   117     // slot-like:
   120     // slot-like:
   118     virtual void downstreamReadyWrite();
   121     virtual void downstreamReadyWrite();
   158     // return true if the QNonContiguousByteDevice of the upload
   161     // return true if the QNonContiguousByteDevice of the upload
   159     // data needs to support reset(). Currently needed for HTTP.
   162     // data needs to support reset(). Currently needed for HTTP.
   160     // This will possibly enable buffering of the upload data.
   163     // This will possibly enable buffering of the upload data.
   161     virtual bool needsResetableUploadData() { return false; }
   164     virtual bool needsResetableUploadData() { return false; }
   162 
   165 
       
   166     // Returns true if backend is able to resume downloads.
       
   167     virtual bool canResume() const { return false; }
       
   168     virtual void setResumeOffset(quint64 offset) { Q_UNUSED(offset); }
       
   169 
   163 protected:
   170 protected:
   164     // Create the device used for reading the upload data
   171     // Create the device used for reading the upload data
   165     QNonContiguousByteDevice* createUploadByteDevice();
   172     QNonContiguousByteDevice* createUploadByteDevice();
   166 
   173 
   167 
   174 
   179     void error(QNetworkReply::NetworkError code, const QString &errorString);
   186     void error(QNetworkReply::NetworkError code, const QString &errorString);
   180 #ifndef QT_NO_NETWORKPROXY
   187 #ifndef QT_NO_NETWORKPROXY
   181     void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth);
   188     void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth);
   182 #endif
   189 #endif
   183     void authenticationRequired(QAuthenticator *auth);
   190     void authenticationRequired(QAuthenticator *auth);
       
   191     void cacheCredentials(QAuthenticator *auth);
   184     void metaDataChanged();
   192     void metaDataChanged();
   185     void redirectionRequested(const QUrl &destination);
   193     void redirectionRequested(const QUrl &destination);
   186     void sslErrors(const QList<QSslError> &errors);
   194     void sslErrors(const QList<QSslError> &errors);
   187     void emitReplyUploadProgress(qint64 bytesSent, qint64 bytesTotal);
   195     void emitReplyUploadProgress(qint64 bytesSent, qint64 bytesTotal);
   188 
   196 
   189 private:
   197 private:
   190     friend class QNetworkAccessManager;
   198     friend class QNetworkAccessManager;
   191     friend class QNetworkAccessManagerPrivate;
   199     friend class QNetworkAccessManagerPrivate;
   192     friend class QNetworkAccessBackendUploadIODevice;
   200     friend class QNetworkAccessBackendUploadIODevice;
       
   201     friend class QNetworkReplyImplPrivate;
   193     QNetworkAccessManagerPrivate *manager;
   202     QNetworkAccessManagerPrivate *manager;
   194     QNetworkReplyImplPrivate *reply;
   203     QNetworkReplyImplPrivate *reply;
   195 };
   204 };
   196 
   205 
   197 class QNetworkAccessBackendFactory
   206 class QNetworkAccessBackendFactory