MAUtil::ImageDownloader Class Reference

#include <MAUtil/Downloader.h>

Inheritance diagram for MAUtil::ImageDownloader:

MAUtil::Downloader MAUtil::HttpConnectionListener MAUtil::ConnectionListener List of all members.

Detailed Description

The ImageDownloader class. Use it to simplify asynchronous downloading of images to image resources.


Public Member Functions

virtual ~ImageDownloader ()
int beginDownloading (const char *url, MAHandle placeholder=0)
void cancelDownloading ()
void addDownloadListener (DownloadListener *dl)
void removeDownloadListener (DownloadListener *dl)
bool isDownloading () const
virtual void connectFinished (Connection *conn, int result) __attribute__((noreturn))
virtual void connWriteFinished (Connection *conn, int result) __attribute__((noreturn))
virtual void connReadFinished (Connection *conn, int result) __attribute__((noreturn))

Protected Member Functions

MAHandle getHandle ()
void fireFinishedDownloading (MAHandle data)
void fireError (int code)
void connRecvFinished (Connection *conn, int result)
virtual void httpFinished (HttpConnection *http, int result)

Protected Attributes

bool mUserPlaceholder
MAHandle mPlaceholder
HttpConnectionmConn
bool mIsDownloading
bool mUserData
MAHandle mData
int mDataOffset
int mContentLength
Vector< DownloadListener * > mDownloadListeners


Constructor & Destructor Documentation

virtual MAUtil::ImageDownloader::~ImageDownloader  )  [virtual]
 


Member Function Documentation

int MAUtil::ImageDownloader::beginDownloading const char *  url,
MAHandle  placeholder = 0
[virtual]
 

See also:
Downloader::beginDownloading(const char*, MAHandle);

Reimplemented from MAUtil::Downloader.

void MAUtil::ImageDownloader::cancelDownloading  )  [virtual]
 

Function to cancel the current download.

Reimplemented from MAUtil::Downloader.

MAHandle MAUtil::ImageDownloader::getHandle  )  [protected, virtual]
 

Reimplemented from MAUtil::Downloader.

void MAUtil::Downloader::addDownloadListener DownloadListener dl  )  [inherited]
 

Function to register a DownloadListener, to which all events for this Downloader is distributed.

Parameters:
dl Pointer to the DownloadListener instance.

void MAUtil::Downloader::removeDownloadListener DownloadListener dl  )  [inherited]
 

bool MAUtil::Downloader::isDownloading  )  const [inline, inherited]
 

Function to retrieve if the Downloader is currently downloading something.

Returns:
a boolean value, if true the function is currently downloading otherwise it isn't.

void MAUtil::Downloader::fireFinishedDownloading MAHandle  data  )  [protected, inherited]
 

void MAUtil::Downloader::fireError int  code  )  [protected, inherited]
 

void MAUtil::Downloader::connRecvFinished Connection conn,
int  result
[protected, virtual, inherited]
 

Called when a recv operation finishes.

Parameters:
conn The Connection that ran the operation.
result The number of bytes read on success, or a CONNERR code < 0 on failure.

Reimplemented from MAUtil::ConnectionListener.

virtual void MAUtil::Downloader::httpFinished HttpConnection http,
int  result
[protected, virtual, inherited]
 

Called when a finish operation is done.

Parameters:
http The HttpConnection that ran the operation.
result The HTTP response code (eg 200 or 404) on success, or a CONNERR code < 0 on failure.

Implements MAUtil::HttpConnectionListener.

Reimplemented in MAUtil::AudioDownloader.

virtual void MAUtil::ConnectionListener::connectFinished Connection conn,
int  result
[virtual, inherited]
 

Called when a connect operation finishes.

Parameters:
conn The Connection that ran the operation.
result The result of the operation. > 0 on success, or a CONNERR code < 0 on failure.

virtual void MAUtil::ConnectionListener::connWriteFinished Connection conn,
int  result
[virtual, inherited]
 

Called when a write operation finishes.

virtual void MAUtil::ConnectionListener::connReadFinished Connection conn,
int  result
[virtual, inherited]
 

Called when a read operation finishes.


Member Data Documentation

bool MAUtil::ImageDownloader::mUserPlaceholder [protected]
 

MAHandle MAUtil::ImageDownloader::mPlaceholder [protected]
 

HttpConnection* MAUtil::Downloader::mConn [protected, inherited]
 

bool MAUtil::Downloader::mIsDownloading [protected, inherited]
 

bool MAUtil::Downloader::mUserData [protected, inherited]
 

MAHandle MAUtil::Downloader::mData [protected, inherited]
 

int MAUtil::Downloader::mDataOffset [protected, inherited]
 

int MAUtil::Downloader::mContentLength [protected, inherited]
 

Vector<DownloadListener*> MAUtil::Downloader::mDownloadListeners [protected, inherited]
 


Generated on Sat Feb 13 00:15:39 2010 for MoSync 2 beta 1 by  doxygen 1.4.6-NO