michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cindent: */ 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_CameraCapabilities_h__ michael@0: #define mozilla_dom_CameraCapabilities_h__ michael@0: michael@0: #include "nsString.h" michael@0: #include "nsAutoPtr.h" michael@0: #include "mozilla/Attributes.h" michael@0: #include "mozilla/ErrorResult.h" michael@0: #include "mozilla/dom/CameraManagerBinding.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsWrapperCache.h" michael@0: #include "nsPIDOMWindow.h" michael@0: michael@0: struct JSContext; michael@0: class nsPIDOMWindow; michael@0: michael@0: namespace mozilla { michael@0: michael@0: class ICameraControl; michael@0: class RecorderProfileManager; michael@0: michael@0: namespace dom { michael@0: michael@0: class CameraCapabilities MOZ_FINAL : public nsISupports michael@0: , public nsWrapperCache michael@0: { michael@0: public: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CameraCapabilities) michael@0: michael@0: // Because this header's filename doesn't match its C++ or DOM-facing michael@0: // classname, we can't rely on the [Func="..."] WebIDL tag to implicitly michael@0: // include the right header for us; instead we must explicitly include a michael@0: // HasSupport() method in each header. We can get rid of these with the michael@0: // Great Renaming proposed in bug 983177. michael@0: static bool HasSupport(JSContext* aCx, JSObject* aGlobal); michael@0: michael@0: CameraCapabilities(nsPIDOMWindow* aWindow); michael@0: ~CameraCapabilities(); michael@0: michael@0: nsresult Populate(ICameraControl* aCameraControl); michael@0: michael@0: nsPIDOMWindow* GetParentObject() const { return mWindow; } michael@0: michael@0: virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; michael@0: michael@0: void GetPreviewSizes(nsTArray& aRetVal) const; michael@0: void GetPictureSizes(nsTArray& aRetVal) const; michael@0: void GetThumbnailSizes(nsTArray& aRetVal) const; michael@0: void GetVideoSizes(nsTArray& aRetVal) const; michael@0: void GetFileFormats(nsTArray& aRetVal) const; michael@0: void GetWhiteBalanceModes(nsTArray& aRetVal) const; michael@0: void GetSceneModes(nsTArray& aRetVal) const; michael@0: void GetEffects(nsTArray& aRetVal) const; michael@0: void GetFlashModes(nsTArray& aRetVal) const; michael@0: void GetFocusModes(nsTArray& aRetVal) const; michael@0: void GetZoomRatios(nsTArray& aRetVal) const; michael@0: uint32_t MaxFocusAreas() const; michael@0: uint32_t MaxMeteringAreas() const; michael@0: uint32_t MaxDetectedFaces() const; michael@0: double MinExposureCompensation() const; michael@0: double MaxExposureCompensation() const; michael@0: double ExposureCompensationStep() const; michael@0: void GetRecorderProfiles(JSContext* aCx, JS::MutableHandle aRetval) const; michael@0: void GetIsoModes(nsTArray& aRetVal) const; michael@0: michael@0: protected: michael@0: nsresult TranslateToDictionary(ICameraControl* aCameraControl, michael@0: uint32_t aKey, nsTArray& aSizes); michael@0: michael@0: nsTArray mPreviewSizes; michael@0: nsTArray mPictureSizes; michael@0: nsTArray mThumbnailSizes; michael@0: nsTArray mVideoSizes; michael@0: michael@0: nsTArray mFileFormats; michael@0: nsTArray mWhiteBalanceModes; michael@0: nsTArray mSceneModes; michael@0: nsTArray mEffects; michael@0: nsTArray mFlashModes; michael@0: nsTArray mFocusModes; michael@0: nsTArray mIsoModes; michael@0: michael@0: nsTArray mZoomRatios; michael@0: michael@0: uint32_t mMaxFocusAreas; michael@0: uint32_t mMaxMeteringAreas; michael@0: uint32_t mMaxDetectedFaces; michael@0: michael@0: double mMinExposureCompensation; michael@0: double mMaxExposureCompensation; michael@0: double mExposureCompensationStep; michael@0: michael@0: nsRefPtr mRecorderProfileManager; michael@0: JS::Heap mRecorderProfiles; michael@0: michael@0: nsRefPtr mWindow; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_CameraCapabilities_h__