haiku/headers/os/net/UrlRequest.h
Stephan Aßmus 45939109b4 Patch done by Christophe Huriaux as part of GSoC 2010 "Services Kit" project:
Integrated the classes in the Network Kit (libbnetapi.so). Only the foundation
classed BUrl, BUrlContext, BNetworkCookie, BNetworkCookieJar and the private
HttpTime code is currently compiled. The BUrlProtocol currently contains some
misplaced BUrlProtocolHttp specific stuff, and the HTTP stuff itself has a
dependency on libcrypto and should live in an add-on instead. I've sprinkled
some TODOs in the code, and I've done some renaming compared to the last
version of the GSoC patch. Any help to bring this further along is appreciated.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39161 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-27 14:03:31 +00:00

69 lines
1.6 KiB
C++

/*
* Copyright 2010 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _B_URL_REQUEST_H_
#define _B_URL_REQUEST_H_
#include <HttpHeaders.h>
#include <Url.h>
#include <UrlResult.h>
#include <UrlContext.h>
#include <UrlProtocol.h>
#include <UrlProtocolListener.h>
enum {
B_NO_HANDLER_FOR_PROTOCOL = B_ERROR
};
class BUrlRequest {
public:
BUrlRequest(const BUrl& url,
BUrlProtocolListener* listener);
BUrlRequest(const BUrl& url);
BUrlRequest(const BUrlRequest& other);
virtual ~BUrlRequest() { };
// Request parameters modification
status_t SetUrl(const BUrl& url);
void SetContext(BUrlContext* context);
void SetProtocolListener(
BUrlProtocolListener* listener);
bool SetProtocolOption(int32 option,
void* value);
// Request parameters access
const BUrlProtocol* Protocol();
const BUrlResult& Result();
const BUrl& Url();
// Request control
status_t Identify();
virtual status_t Perform();
// TODO: Rename to Run() perhaps? "Perform" is used for FBC stuff.
virtual status_t Pause();
virtual status_t Resume();
virtual status_t Abort();
// Request informations
virtual bool InitCheck() const;
bool IsRunning() const;
status_t Status() const;
// Overloaded members
BUrlRequest& operator=(const BUrlRequest& other);
protected:
BUrlProtocolListener* fListener;
BUrlProtocol* fUrlProtocol;
BUrlResult fResult;
BUrlContext* fContext;
BUrl fUrl;
bool fReady;
};
#endif // _B_URL_REQUEST_H_