Request

The Request class provides one-stop-shopping for data retrieval. More...

Publicly inherits QObject.

Public Methods

Request( QString url, Canvas* canvas=??? );
Request( const Url& url, Canvas* canvas=??? );
boolopen( );
~Request( );

Public Slots

voidabort( );
voidfwdData( const char* bytes, int length );
voidfwdEndOfData( );
voidfwdStartOfData( QString mediaType, QString mediaSubtype, int totalSize );
voidfwdStatus( QString msg );
voidfwdUrlChanged( const Url& url );

Protected Methods

virtual voidtimerEvent( QTimerEvent* e );

Signals

voiddata( const char* bytes, int length );
voiddone( Request* req );
voidendOfData( );
voidstartOfData( Request* req, QString mediaType, QString mediaSubtype, int totalSize );
voidstatus( QString msg );
voidurlChanged( const Url& url );

Private Data Members

Canvas*_canvas;
int_totalRead;
int_totalSize;
Url_url;

Detailed Documentation

The Request class provides one-stop-shopping for data retrieval.

Any object that needs to download data from a URL in a non-blocking way can use a request. The request uses the Cache for efficiency.

Public Methods Documentation

Request ( QString url, Canvas* canvas=??? );

Create a request for the given URL, after parsing it.

Request ( const Url& url, Canvas* canvas=??? );

Create a request for the given URL.

bool open ( );

Open a new connection.

~Request ( );

Destroy the request and abort any open connection.

Public Slots Documentation

void abort ( );

Abort the current connection, and delete the Request. This action is deferred (using startTimer(0)) in order to give the caller a chance to clean up first.

void fwdData ( const char* bytes, int length );

Forward the data signals from the connection.

void fwdEndOfData ( );

Forward the endOfData signal from the connection.

void fwdStartOfData ( QString mediaType, QString mediaSubtype, int totalSize );

Forward the startOfData signal from the connection.

void fwdStatus ( QString msg );

Forward the status signal from the connection.

void fwdUrlChanged ( const Url& url );

Forward the urlChanged signal from the connection.

Protected Methods Documentation

virtual void timerEvent ( QTimerEvent* e );

Process a delayed abort request. Abort the open connection, and die.

Signals Documentation

void data ( const char* bytes, int length );

This signal is used to forward the data signals from the connection.

void done ( Request* req );

This signal is emitted just before the Request deletes itself.

void endOfData ( );

This signal is used to forward the endOfData signal from the connection.

void startOfData ( Request* req, QString mediaType, QString mediaSubtype, int totalSize );

This signal is used to forward the startOfData signal from the connection.

void status ( QString msg );

This signal is emitted whenever the connection has something interesting to put in the status line of the browser.

void urlChanged ( const Url& url );

This signal is emitted when the Request is informed that the URL for its connection has changed.


Return to Index.
Automatically generated on Aug 11 23:32