Bug 788829 - Call SetSizeConstraints even if a popup is not open. r=enndeakin
[gecko.git] / dom / camera / FallbackCameraControl.cpp
blob5b16ded9ba27642a4e89c906fc9d96f882f89cf8
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 #include "DOMCameraControl.h"
6 #include "CameraControlImpl.h"
8 using namespace mozilla;
10 /**
11 * Fallback camera control subclass. Can be used as a template for the
12 * definition of new camera support classes.
14 class nsFallbackCameraControl : public CameraControlImpl
16 public:
17 nsFallbackCameraControl(uint32_t aCameraId, nsIThread* aCameraThread, nsDOMCameraControl* aDOMCameraControl, nsICameraGetCameraCallback* onSuccess, nsICameraErrorCallback* onError, uint64_t aWindowId);
19 const char* GetParameter(const char* aKey);
20 const char* GetParameterConstChar(uint32_t aKey);
21 double GetParameterDouble(uint32_t aKey);
22 void GetParameter(uint32_t aKey, nsTArray<dom::CameraRegion>& aRegions);
23 void SetParameter(const char* aKey, const char* aValue);
24 void SetParameter(uint32_t aKey, const char* aValue);
25 void SetParameter(uint32_t aKey, double aValue);
26 void SetParameter(uint32_t aKey, const nsTArray<dom::CameraRegion>& aRegions);
27 nsresult PushParameters();
29 protected:
30 ~nsFallbackCameraControl();
32 nsresult GetPreviewStreamImpl(GetPreviewStreamTask* aGetPreviewStream);
33 nsresult StartPreviewImpl(StartPreviewTask* aStartPreview);
34 nsresult StopPreviewImpl(StopPreviewTask* aStopPreview);
35 nsresult AutoFocusImpl(AutoFocusTask* aAutoFocus);
36 nsresult TakePictureImpl(TakePictureTask* aTakePicture);
37 nsresult StartRecordingImpl(StartRecordingTask* aStartRecording);
38 nsresult StopRecordingImpl(StopRecordingTask* aStopRecording);
39 nsresult PushParametersImpl();
40 nsresult PullParametersImpl();
42 private:
43 nsFallbackCameraControl(const nsFallbackCameraControl&) MOZ_DELETE;
44 nsFallbackCameraControl& operator=(const nsFallbackCameraControl&) MOZ_DELETE;
47 /**
48 * Stub implementation of the DOM-facing camera control constructor.
50 * This should never get called--it exists to keep the linker happy; if
51 * implemented, it should construct (e.g.) nsFallbackCameraControl and
52 * store a reference in the 'mCameraControl' member (which is why it is
53 * defined here).
55 nsDOMCameraControl::nsDOMCameraControl(uint32_t aCameraId, nsIThread* aCameraThread, nsICameraGetCameraCallback* onSuccess, nsICameraErrorCallback* onError, uint64_t aWindowId)
59 /**
60 * Stub implemetations of the fallback camera control.
62 * None of these should ever get called--they exist to keep the linker happy,
63 * and may be used as templates for new camera support classes.
65 nsFallbackCameraControl::nsFallbackCameraControl(uint32_t aCameraId, nsIThread* aCameraThread, nsDOMCameraControl* aDOMCameraControl, nsICameraGetCameraCallback* onSuccess, nsICameraErrorCallback* onError, uint64_t aWindowId)
66 : CameraControlImpl(aCameraId, aCameraThread, aWindowId)
70 nsFallbackCameraControl::~nsFallbackCameraControl()
74 const char*
75 nsFallbackCameraControl::GetParameter(const char* aKey)
77 return nullptr;
80 const char*
81 nsFallbackCameraControl::GetParameterConstChar(uint32_t aKey)
83 return nullptr;
86 double
87 nsFallbackCameraControl::GetParameterDouble(uint32_t aKey)
89 return NAN;
92 void
93 nsFallbackCameraControl::GetParameter(uint32_t aKey, nsTArray<dom::CameraRegion>& aRegions)
97 void
98 nsFallbackCameraControl::SetParameter(const char* aKey, const char* aValue)
102 void
103 nsFallbackCameraControl::SetParameter(uint32_t aKey, const char* aValue)
107 void
108 nsFallbackCameraControl::SetParameter(uint32_t aKey, double aValue)
112 void
113 nsFallbackCameraControl::SetParameter(uint32_t aKey, const nsTArray<dom::CameraRegion>& aRegions)
117 nsresult
118 nsFallbackCameraControl::PushParameters()
120 return NS_ERROR_NOT_IMPLEMENTED;
123 nsresult
124 nsFallbackCameraControl::GetPreviewStreamImpl(GetPreviewStreamTask* aGetPreviewStream)
126 return NS_ERROR_NOT_IMPLEMENTED;
129 nsresult
130 nsFallbackCameraControl::StartPreviewImpl(StartPreviewTask* aGetPreviewStream)
132 return NS_ERROR_NOT_IMPLEMENTED;
135 nsresult
136 nsFallbackCameraControl::StopPreviewImpl(StopPreviewTask* aGetPreviewStream)
138 return NS_ERROR_NOT_IMPLEMENTED;
141 nsresult
142 nsFallbackCameraControl::AutoFocusImpl(AutoFocusTask* aAutoFocus)
144 return NS_ERROR_NOT_IMPLEMENTED;
147 nsresult
148 nsFallbackCameraControl::TakePictureImpl(TakePictureTask* aTakePicture)
150 return NS_ERROR_NOT_IMPLEMENTED;
153 nsresult
154 nsFallbackCameraControl::StartRecordingImpl(StartRecordingTask* aStartRecording)
156 return NS_ERROR_NOT_IMPLEMENTED;
159 nsresult
160 nsFallbackCameraControl::StopRecordingImpl(StopRecordingTask* aStopRecording)
162 return NS_ERROR_NOT_IMPLEMENTED;
165 nsresult
166 nsFallbackCameraControl::PushParametersImpl()
168 return NS_ERROR_NOT_IMPLEMENTED;
171 nsresult
172 nsFallbackCameraControl::PullParametersImpl()
174 return NS_ERROR_NOT_IMPLEMENTED;