2010-10-27 14:03:31 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2010 Haiku Inc. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _B_URL_CONTEXT_H_
|
|
|
|
#define _B_URL_CONTEXT_H_
|
|
|
|
|
|
|
|
|
2013-10-28 17:09:18 +01:00
|
|
|
#include <HttpAuthentication.h>
|
2010-10-27 14:03:31 +00:00
|
|
|
#include <NetworkCookieJar.h>
|
|
|
|
|
|
|
|
|
2013-10-28 17:09:18 +01:00
|
|
|
namespace BPrivate {
|
|
|
|
template <class key, class value> class HashMap;
|
|
|
|
class HashString;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-10-27 14:03:31 +00:00
|
|
|
class BUrlContext {
|
|
|
|
public:
|
|
|
|
BUrlContext();
|
2013-10-28 17:09:18 +01:00
|
|
|
~BUrlContext();
|
2010-10-27 14:03:31 +00:00
|
|
|
|
|
|
|
// Context modifiers
|
|
|
|
void SetCookieJar(
|
|
|
|
const BNetworkCookieJar& cookieJar);
|
2013-10-28 17:09:18 +01:00
|
|
|
void AddAuthentication(const BUrl& url,
|
|
|
|
BHttpAuthentication* const authentication);
|
2010-10-27 14:03:31 +00:00
|
|
|
|
|
|
|
// Context accessors
|
|
|
|
BNetworkCookieJar& GetCookieJar();
|
2013-10-28 17:09:18 +01:00
|
|
|
BHttpAuthentication& GetAuthentication(const BUrl& url);
|
2010-10-27 14:03:31 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
BNetworkCookieJar fCookieJar;
|
2013-10-28 17:09:18 +01:00
|
|
|
typedef BPrivate::HashMap<BPrivate::HashString,
|
|
|
|
BHttpAuthentication*> BHttpAuthenticationMap;
|
|
|
|
BHttpAuthenticationMap* fAuthenticationMap;
|
2010-10-27 14:03:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _B_URL_CONTEXT_H_
|