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 mozilla_dom_time_TimeManager_h michael@0: #define mozilla_dom_time_TimeManager_h michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsISupports.h" michael@0: #include "nsPIDOMWindow.h" michael@0: #include "nsWrapperCache.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class Date; michael@0: michael@0: namespace time { michael@0: michael@0: class TimeManager MOZ_FINAL : public nsISupports michael@0: , public nsWrapperCache michael@0: { michael@0: public: michael@0: static bool PrefEnabled(JSContext* aCx, JSObject* aGlobal) michael@0: { michael@0: #ifdef MOZ_TIME_MANAGER michael@0: return true; michael@0: #else michael@0: return false; michael@0: #endif michael@0: } michael@0: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TimeManager) michael@0: michael@0: explicit TimeManager(nsPIDOMWindow* aWindow) michael@0: : mWindow(aWindow) michael@0: { michael@0: SetIsDOMBinding(); michael@0: } michael@0: michael@0: nsPIDOMWindow* GetParentObject() const michael@0: { michael@0: return mWindow; michael@0: } michael@0: JSObject* WrapObject(JSContext* aCx); michael@0: michael@0: void Set(Date& aDate); michael@0: void Set(double aTime); michael@0: michael@0: private: michael@0: nsCOMPtr mWindow; michael@0: }; michael@0: michael@0: } // namespace time michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif //mozilla_dom_time_TimeManager_h