1*603e0bdfSNiels Sascha Reedijk /* 2*603e0bdfSNiels Sascha Reedijk * Copyright 2010-2015 Haiku Inc. All rights reserved. 3*603e0bdfSNiels Sascha Reedijk * Distributed under the terms of the MIT License. 4*603e0bdfSNiels Sascha Reedijk */ 5*603e0bdfSNiels Sascha Reedijk 6*603e0bdfSNiels Sascha Reedijk 7*603e0bdfSNiels Sascha Reedijk #ifndef _B_URL_CONTEXT_H_ 8*603e0bdfSNiels Sascha Reedijk #define _B_URL_CONTEXT_H_ 9*603e0bdfSNiels Sascha Reedijk 10*603e0bdfSNiels Sascha Reedijk 11*603e0bdfSNiels Sascha Reedijk #include <Certificate.h> 12*603e0bdfSNiels Sascha Reedijk #include <HttpAuthentication.h> 13*603e0bdfSNiels Sascha Reedijk #include <NetworkCookieJar.h> 14*603e0bdfSNiels Sascha Reedijk #include <Referenceable.h> 15*603e0bdfSNiels Sascha Reedijk 16*603e0bdfSNiels Sascha Reedijk 17*603e0bdfSNiels Sascha Reedijk class BUrlContext: public BReferenceable { 18*603e0bdfSNiels Sascha Reedijk public: 19*603e0bdfSNiels Sascha Reedijk BUrlContext(); 20*603e0bdfSNiels Sascha Reedijk ~BUrlContext(); 21*603e0bdfSNiels Sascha Reedijk 22*603e0bdfSNiels Sascha Reedijk // Context modifiers 23*603e0bdfSNiels Sascha Reedijk void SetCookieJar( 24*603e0bdfSNiels Sascha Reedijk const BNetworkCookieJar& cookieJar); 25*603e0bdfSNiels Sascha Reedijk void AddAuthentication(const BUrl& url, 26*603e0bdfSNiels Sascha Reedijk const BHttpAuthentication& authentication); 27*603e0bdfSNiels Sascha Reedijk void SetProxy(BString host, uint16 port); 28*603e0bdfSNiels Sascha Reedijk void AddCertificateException(const BCertificate& certificate); 29*603e0bdfSNiels Sascha Reedijk 30*603e0bdfSNiels Sascha Reedijk // Context accessors 31*603e0bdfSNiels Sascha Reedijk BNetworkCookieJar& GetCookieJar(); 32*603e0bdfSNiels Sascha Reedijk BHttpAuthentication& GetAuthentication(const BUrl& url); 33*603e0bdfSNiels Sascha Reedijk bool UseProxy(); 34*603e0bdfSNiels Sascha Reedijk BString GetProxyHost(); 35*603e0bdfSNiels Sascha Reedijk uint16 GetProxyPort(); 36*603e0bdfSNiels Sascha Reedijk bool HasCertificateException(const BCertificate& certificate); 37*603e0bdfSNiels Sascha Reedijk 38*603e0bdfSNiels Sascha Reedijk private: 39*603e0bdfSNiels Sascha Reedijk class BHttpAuthenticationMap; 40*603e0bdfSNiels Sascha Reedijk 41*603e0bdfSNiels Sascha Reedijk private: 42*603e0bdfSNiels Sascha Reedijk BNetworkCookieJar fCookieJar; 43*603e0bdfSNiels Sascha Reedijk BHttpAuthenticationMap* fAuthenticationMap; 44*603e0bdfSNiels Sascha Reedijk typedef BObjectList<const BCertificate> BCertificateSet; 45*603e0bdfSNiels Sascha Reedijk BCertificateSet fCertificates; 46*603e0bdfSNiels Sascha Reedijk 47*603e0bdfSNiels Sascha Reedijk BString fProxyHost; 48*603e0bdfSNiels Sascha Reedijk uint16 fProxyPort; 49*603e0bdfSNiels Sascha Reedijk }; 50*603e0bdfSNiels Sascha Reedijk 51*603e0bdfSNiels Sascha Reedijk 52*603e0bdfSNiels Sascha Reedijk #endif // _B_URL_CONTEXT_H_ 53