• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @file icamera_host_callback.h
18  *
19  * @brief Declares callbacks for status changes of cameras and flashes. The caller needs to implement the callbacks.
20  *
21  * @since 1.0
22  * @version 1.0
23  */
24 
25 #ifndef HDI_CAMERA_HOST_CALLBACK_SERVER_H
26 #define HDI_CAMERA_HOST_CALLBACK_SERVER_H
27 
28 #include <list>
29 #include <map>
30 #include <vector>
31 #include "types.h"
32 #include "icamera_interface.h"
33 
34 namespace OHOS::Camera {
35 class ICameraHostCallback : public ICameraInterface {
36 public:
37     DECLARE_INTERFACE_DESCRIPTOR(u"HDI.Camera.V1_0.HostCallback");
~ICameraHostCallback()38     virtual ~ICameraHostCallback() {}
39 
40 public:
41     /**
42      * @brief Called when the camera status changes to report the latest status.
43      *
44      * @param cameraId Indicates the ID of the camera whose status changes.
45      * @param status Indicates the latest status of the camera.
46      *
47      * @since 1.0
48      * @version 1.0
49      */
50     virtual void OnCameraStatus(const std::string &cameraId, CameraStatus status) = 0;
51 
52     /**
53      * @brief Called when the flash status changes to report the latest status.
54      *
55      * @param cameraId Indicates the ID of the camera to which the flash whose status changes is bound.
56      * @param status Indicates the latest status of the flash.
57      *
58      * @since 1.0
59      * @version 1.0
60      */
61     virtual void OnFlashlightStatus(const std::string &cameraId, FlashlightStatus status) = 0;
62 
63     /**
64      * @brief Called when the camera event occurs.
65      *
66      * @param cameraId Indicates the ID of the camera to which the camera event is bound.
67      * @param event Indicates the camera event type.
68      *
69      * @since 1.0
70      * @version 1.0
71      */
72     virtual void OnCameraEvent(const std::string &cameraId, CameraEvent event) = 0;
73 };
74 }
75 #endif // HDI_CAMERA_HOST_CALLBACK_SERVER_H