Files
haiku-beta6/headers/os/net/UrlContext.h
T

58 lines
1.4 KiB
C++
Raw Normal View History

/*
* Copyright 2010-2015 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
2014-09-15 14:24:37 +02:00
#ifndef _B_URL_CONTEXT_H_
#define _B_URL_CONTEXT_H_
#include <Certificate.h>
2013-10-28 17:09:18 +01:00
#include <HttpAuthentication.h>
#include <NetworkCookieJar.h>
#include <Referenceable.h>
2013-10-28 17:09:18 +01:00
namespace BPrivate {
template <class key, class value> class SynchronizedHashMap;
2013-10-28 17:09:18 +01:00
class HashString;
}
class BUrlContext: public BReferenceable {
public:
BUrlContext();
2013-10-28 17:09:18 +01:00
~BUrlContext();
// Context modifiers
void SetCookieJar(
const BNetworkCookieJar& cookieJar);
2013-10-28 17:09:18 +01:00
void AddAuthentication(const BUrl& url,
const BHttpAuthentication& authentication);
2014-09-15 14:24:37 +02:00
void SetProxy(BString host, uint16 port);
void AddCertificateException(const BCertificate& certificate);
2014-09-15 14:24:37 +02:00
// Context accessors
BNetworkCookieJar& GetCookieJar();
2013-10-28 17:09:18 +01:00
BHttpAuthentication& GetAuthentication(const BUrl& url);
2014-09-15 14:24:37 +02:00
bool UseProxy();
BString GetProxyHost();
uint16 GetProxyPort();
bool HasCertificateException(const BCertificate& certificate);
private:
BNetworkCookieJar fCookieJar;
typedef BPrivate::SynchronizedHashMap<BPrivate::HashString,
2013-10-28 17:09:18 +01:00
BHttpAuthentication*> BHttpAuthenticationMap;
BHttpAuthenticationMap* fAuthenticationMap;
typedef BObjectList<const BCertificate> BCertificateSet;
BCertificateSet fCertificates;
2014-09-15 14:24:37 +02:00
BString fProxyHost;
uint16 fProxyPort;
};
2014-09-15 14:24:37 +02:00
#endif // _B_URL_CONTEXT_H_