michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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: #ifndef nsAutoConfig_h michael@0: #define nsAutoConfig_h michael@0: michael@0: #include "nsIAutoConfig.h" michael@0: #include "nsITimer.h" michael@0: #include "nsIFile.h" michael@0: #include "nsIObserver.h" michael@0: #include "nsNetUtil.h" michael@0: #include "nsIPrefService.h" michael@0: #include "nsIPrefBranch.h" michael@0: #include "nsWeakReference.h" michael@0: michael@0: class nsAutoConfig : public nsIAutoConfig, michael@0: public nsITimerCallback, michael@0: public nsIStreamListener, michael@0: public nsIObserver, michael@0: public nsSupportsWeakReference michael@0: michael@0: { michael@0: public: michael@0: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSIAUTOCONFIG michael@0: NS_DECL_NSIREQUESTOBSERVER michael@0: NS_DECL_NSISTREAMLISTENER michael@0: NS_DECL_NSIOBSERVER michael@0: NS_DECL_NSITIMERCALLBACK michael@0: michael@0: nsAutoConfig(); michael@0: virtual ~nsAutoConfig(); michael@0: nsresult Init(); michael@0: michael@0: protected: michael@0: michael@0: nsresult downloadAutoConfig(); michael@0: nsresult readOfflineFile(); michael@0: nsresult evaluateLocalFile(nsIFile *file); michael@0: nsresult writeFailoverFile(); michael@0: nsresult getEmailAddr(nsACString & emailAddr); michael@0: nsresult PromptForEMailAddress(nsACString &emailAddress); michael@0: nsCString mBuf; michael@0: nsCOMPtr mPrefBranch; michael@0: bool mLoaded; michael@0: nsCOMPtr mTimer; michael@0: nsCString mConfigURL; michael@0: }; michael@0: michael@0: #endif