michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: #ifndef NSAUTHINFORMATIONHOLDER_H_ michael@0: #define NSAUTHINFORMATIONHOLDER_H_ michael@0: michael@0: #include "nsIAuthInformation.h" michael@0: #include "nsString.h" michael@0: michael@0: class nsAuthInformationHolder : public nsIAuthInformation { michael@0: public: michael@0: // aAuthType must be ASCII michael@0: nsAuthInformationHolder(uint32_t aFlags, const nsString& aRealm, michael@0: const nsCString& aAuthType) michael@0: : mFlags(aFlags), mRealm(aRealm), mAuthType(aAuthType) {} michael@0: michael@0: virtual ~nsAuthInformationHolder() {} michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIAUTHINFORMATION michael@0: michael@0: const nsString& User() const { return mUser; } michael@0: const nsString& Password() const { return mPassword; } michael@0: const nsString& Domain() const { return mDomain; } michael@0: michael@0: /** michael@0: * This method can be used to initialize the username when the michael@0: * ONLY_PASSWORD flag is set. michael@0: */ michael@0: void SetUserInternal(const nsString& aUsername) { michael@0: mUser = aUsername; michael@0: } michael@0: private: michael@0: nsString mUser; michael@0: nsString mPassword; michael@0: nsString mDomain; michael@0: michael@0: uint32_t mFlags; michael@0: nsString mRealm; michael@0: nsCString mAuthType; michael@0: }; michael@0: michael@0: michael@0: #endif