Backout a74bd5095902, Bug 959405 - Please update the Buri Moz-central, 1.3, 1.2 with...
[gecko.git] / dom / camera / DOMCameraCapabilities.h
blob04b3c1d8a8e50ce290d153c6380bff83c2b28c34
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef DOM_CAMERA_DOMCAMERACAPABILITIES_H
6 #define DOM_CAMERA_DOMCAMERACAPABILITIES_H
8 #include "ICameraControl.h"
9 #include "nsAutoPtr.h"
10 #include "CameraCommon.h"
12 namespace mozilla {
14 typedef nsresult (*ParseItemAndAddFunc)(JSContext* aCx, JS::Handle<JSObject*> aArray,
15 uint32_t aIndex, const char* aStart, char** aEnd);
17 class DOMCameraCapabilities MOZ_FINAL : public nsICameraCapabilities
19 public:
20 NS_DECL_ISUPPORTS
21 NS_DECL_NSICAMERACAPABILITIES
23 DOMCameraCapabilities(ICameraControl* aCamera)
24 : mCamera(aCamera)
26 DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
29 nsresult ParameterListToNewArray(
30 JSContext* cx,
31 JS::MutableHandle<JSObject*> aArray,
32 uint32_t aKey,
33 ParseItemAndAddFunc aParseItemAndAdd
35 nsresult StringListToNewObject(JSContext* aCx, JS::Value* aArray, uint32_t aKey);
36 nsresult DimensionListToNewObject(JSContext* aCx, JS::Value* aArray, uint32_t aKey);
38 private:
39 DOMCameraCapabilities(const DOMCameraCapabilities&) MOZ_DELETE;
40 DOMCameraCapabilities& operator=(const DOMCameraCapabilities&) MOZ_DELETE;
42 protected:
43 /* additional members */
44 ~DOMCameraCapabilities()
46 // destructor code
47 DOM_CAMERA_LOGT("%s:%d : this=%p, mCamera=%p\n", __func__, __LINE__, this, mCamera.get());
50 nsRefPtr<ICameraControl> mCamera;
53 } // namespace mozilla
55 #endif // DOM_CAMERA_DOMCAMERACAPABILITIES_H