struct CCL::Web::IWebService

Overview

Service interface for web-aware applications. More…

#include <iwebservice.h>

struct IWebService: public CCL::IUnknown
{
    // structs

    struct DownloadDataArgs;
    struct DownloadInBackgroundArgs;
    struct UploadDataArgs;
    struct UploadInBackgroundArgs;

    // methods

    virtual tresult CCL_API setUserAgent (StringRef userAgent) = 0;
    virtual IWebClient*CCL_API createClient (StringID protocol) = 0;
    virtual IWebServer*CCL_API createServer (StringID protocol) = 0;
    virtual IWebNewsReader*CCL_API createReader () = 0;
    virtual IWebCredentials*CCL_API createCredentials () = 0;
    virtual IWebHeaderCollection*CCL_API createHeaderCollection () = 0;
    virtual tresult CCL_API downloadData (const DownloadDataArgs& args) = 0;
    virtual tresult CCL_API downloadInBackground (const DownloadInBackgroundArgs& args) = 0;
    virtual tresult CCL_API uploadData (const UploadDataArgs& args) = 0;
    virtual tresult CCL_API uploadInBackground (const UploadInBackgroundArgs& args) = 0;
    virtual tresult CCL_API cancelOperation (IObserver* observer) = 0;
    virtual tresult CCL_API cancelOnExit () = 0;
};

Inherited Members

public:
    // methods

    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;

Detailed Documentation

Service interface for web-aware applications.

Methods

virtual tresult CCL_API setUserAgent (StringRef userAgent) = 0

Set user agent string used in HTTP transactions.

virtual IWebClient*CCL_API createClient (StringID protocol) = 0

Create client instance for given protocol (e.g.

HTTP).

virtual IWebServer*CCL_API createServer (StringID protocol) = 0

Create server instance for given protocol (e.g.

HTTP).

virtual IWebNewsReader*CCL_API createReader () = 0

Create feed reader (Atom/RSS).

virtual IWebCredentials*CCL_API createCredentials () = 0

Create credentials object.

virtual IWebHeaderCollection*CCL_API createHeaderCollection () = 0

Create header collection object.

virtual tresult CCL_API downloadData (const DownloadDataArgs& args) = 0

Download remote resource to local storage.

Returns result at network level, use status for application level.

virtual tresult CCL_API downloadInBackground (const DownloadInBackgroundArgs& args) = 0

Download remote resource asynchronously.

Observer receives kBackgroundProgressNotify and kDownloadComplete messages.

virtual tresult CCL_API uploadData (const UploadDataArgs& args) = 0

Upload data.

Headers must include content type. Returns result at network level, use status for application level.

virtual tresult CCL_API uploadInBackground (const UploadInBackgroundArgs& args) = 0

Upload data asynchronously.

Headers must include content type. Observer receives kBackgroundProgressNotify + kUploadComplete messages.

virtual tresult CCL_API cancelOperation (IObserver* observer) = 0

Cancel asynchronous upload or download.

virtual tresult CCL_API cancelOnExit () = 0

Mark all asynchronous operations canceled on program exit.

Note that this doesn’t wait for them to be finished so cancelOperation() still needs to be called individually but with the benefit of operations not waiting on each other.