Bumping manifests a=b2g-bump
[gecko.git] / dom / camera / TestGonkCameraControl.h
blobead7cf272dc5423a5ccdf5338def26197ff8579a
1 /*
2 * Copyright (C) 2014 Mozilla Foundation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef DOM_CAMERA_TESTGONKCAMERACONTROL_H
18 #define DOM_CAMERA_TESTGONKCAMERACONTROL_H
20 #include "GonkCameraControl.h"
22 namespace mozilla {
24 class TestGonkCameraControl : public nsGonkCameraControl
26 public:
27 TestGonkCameraControl(uint32_t aCameraId);
29 virtual nsresult Start(const Configuration* aConfig = nullptr) MOZ_OVERRIDE;
30 virtual nsresult Stop() MOZ_OVERRIDE;
31 virtual nsresult SetConfiguration(const Configuration& aConfig) MOZ_OVERRIDE;
32 virtual nsresult StartPreview() MOZ_OVERRIDE;
33 virtual nsresult StopPreview() MOZ_OVERRIDE;
34 virtual nsresult AutoFocus() MOZ_OVERRIDE;
35 virtual nsresult StartFaceDetection() MOZ_OVERRIDE;
36 virtual nsresult StopFaceDetection() MOZ_OVERRIDE;
37 virtual nsresult TakePicture() MOZ_OVERRIDE;
38 virtual nsresult StartRecording(DeviceStorageFileDescriptor* aFileDescriptor,
39 const StartRecordingOptions* aOptions) MOZ_OVERRIDE;
40 virtual nsresult StopRecording() MOZ_OVERRIDE;
42 protected:
43 virtual ~TestGonkCameraControl();
45 virtual nsresult StartImpl(const Configuration* aInitialConfig = nullptr) MOZ_OVERRIDE;
46 virtual nsresult StopImpl() MOZ_OVERRIDE;
47 virtual nsresult SetConfigurationImpl(const Configuration& aConfig) MOZ_OVERRIDE;
48 virtual nsresult StartPreviewImpl() MOZ_OVERRIDE;
49 virtual nsresult StopPreviewImpl() MOZ_OVERRIDE;
50 virtual nsresult AutoFocusImpl() MOZ_OVERRIDE;
51 virtual nsresult StartFaceDetectionImpl() MOZ_OVERRIDE;
52 virtual nsresult StopFaceDetectionImpl() MOZ_OVERRIDE;
53 virtual nsresult TakePictureImpl() MOZ_OVERRIDE;
54 virtual nsresult StartRecordingImpl(DeviceStorageFileDescriptor* aFileDescriptor,
55 const StartRecordingOptions* aOptions = nullptr) MOZ_OVERRIDE;
56 virtual nsresult StopRecordingImpl() MOZ_OVERRIDE;
58 nsresult ForceMethodFailWithCodeInternal(const char* aFile, int aLine);
59 nsresult ForceAsyncFailWithCodeInternal(const char* aFile, int aLine);
61 private:
62 TestGonkCameraControl(const TestGonkCameraControl&) MOZ_DELETE;
63 TestGonkCameraControl& operator=(const TestGonkCameraControl&) MOZ_DELETE;
66 #define ForceMethodFailWithCode() ForceMethodFailWithCodeInternal(__FILE__, __LINE__)
67 #define ForceAsyncFailWithCode() ForceAsyncFailWithCodeInternal(__FILE__, __LINE__)
69 } // namespace mozilla
71 #endif // DOM_CAMERA_TESTGONKCAMERACONTROL_H