1603e0bdfSNiels Sascha Reedijk /* 2603e0bdfSNiels Sascha Reedijk * Copyright 2010-2015 Haiku Inc. All rights reserved. 3603e0bdfSNiels Sascha Reedijk * Distributed under the terms of the MIT License. 4603e0bdfSNiels Sascha Reedijk */ 5603e0bdfSNiels Sascha Reedijk 6603e0bdfSNiels Sascha Reedijk 7603e0bdfSNiels Sascha Reedijk #ifndef _B_URL_CONTEXT_H_ 8603e0bdfSNiels Sascha Reedijk #define _B_URL_CONTEXT_H_ 9603e0bdfSNiels Sascha Reedijk 10603e0bdfSNiels Sascha Reedijk 11603e0bdfSNiels Sascha Reedijk #include <Certificate.h> 12603e0bdfSNiels Sascha Reedijk #include <HttpAuthentication.h> 13603e0bdfSNiels Sascha Reedijk #include <NetworkCookieJar.h> 14603e0bdfSNiels Sascha Reedijk #include <Referenceable.h> 15603e0bdfSNiels Sascha Reedijk 16603e0bdfSNiels Sascha Reedijk 17ce64ffdbSNiels Sascha Reedijk namespace BPrivate { 18ce64ffdbSNiels Sascha Reedijk 19ce64ffdbSNiels Sascha Reedijk namespace Network { 20*70b63f18SNiels Sascha Reedijk 21ce64ffdbSNiels Sascha Reedijk 22603e0bdfSNiels Sascha Reedijk class BUrlContext: public BReferenceable { 23603e0bdfSNiels Sascha Reedijk public: 24603e0bdfSNiels Sascha Reedijk BUrlContext(); 25603e0bdfSNiels Sascha Reedijk ~BUrlContext(); 26603e0bdfSNiels Sascha Reedijk 27603e0bdfSNiels Sascha Reedijk // Context modifiers 28603e0bdfSNiels Sascha Reedijk void SetCookieJar( 29603e0bdfSNiels Sascha Reedijk const BNetworkCookieJar& cookieJar); 30603e0bdfSNiels Sascha Reedijk void AddAuthentication(const BUrl& url, 31603e0bdfSNiels Sascha Reedijk const BHttpAuthentication& authentication); 32603e0bdfSNiels Sascha Reedijk void SetProxy(BString host, uint16 port); 33603e0bdfSNiels Sascha Reedijk void AddCertificateException(const BCertificate& certificate); 34603e0bdfSNiels Sascha Reedijk 35603e0bdfSNiels Sascha Reedijk // Context accessors 36603e0bdfSNiels Sascha Reedijk BNetworkCookieJar& GetCookieJar(); 37603e0bdfSNiels Sascha Reedijk BHttpAuthentication& GetAuthentication(const BUrl& url); 38603e0bdfSNiels Sascha Reedijk bool UseProxy(); 39603e0bdfSNiels Sascha Reedijk BString GetProxyHost(); 40603e0bdfSNiels Sascha Reedijk uint16 GetProxyPort(); 41603e0bdfSNiels Sascha Reedijk bool HasCertificateException(const BCertificate& certificate); 42603e0bdfSNiels Sascha Reedijk 43603e0bdfSNiels Sascha Reedijk private: 44603e0bdfSNiels Sascha Reedijk class BHttpAuthenticationMap; 45603e0bdfSNiels Sascha Reedijk 46603e0bdfSNiels Sascha Reedijk private: 47603e0bdfSNiels Sascha Reedijk BNetworkCookieJar fCookieJar; 48603e0bdfSNiels Sascha Reedijk BHttpAuthenticationMap* fAuthenticationMap; 49603e0bdfSNiels Sascha Reedijk typedef BObjectList<const BCertificate> BCertificateSet; 50603e0bdfSNiels Sascha Reedijk BCertificateSet fCertificates; 51603e0bdfSNiels Sascha Reedijk 52603e0bdfSNiels Sascha Reedijk BString fProxyHost; 53603e0bdfSNiels Sascha Reedijk uint16 fProxyPort; 54603e0bdfSNiels Sascha Reedijk }; 55603e0bdfSNiels Sascha Reedijk 56603e0bdfSNiels Sascha Reedijk 57ce64ffdbSNiels Sascha Reedijk } // namespace Network 58ce64ffdbSNiels Sascha Reedijk 59ce64ffdbSNiels Sascha Reedijk } // namespace BPrivate 60ce64ffdbSNiels Sascha Reedijk 61603e0bdfSNiels Sascha Reedijk #endif // _B_URL_CONTEXT_H_ 62