• 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 <hdf_log.h>
32 #include <iremote_broker.h>
33 #include "types.h"
34 
35 namespace OHOS::Camera {
36 enum {
37     CMD_CAMERA_HOST_CALLBACK_ON_STATUS = 0,
38     CMD_CAMERA_HOST_CALLBACK_ON_FLASHLIGHT_STATUS,
39 };
40 
41 class ICameraHostCallback : public IRemoteBroker {
42 public:
43     DECLARE_INTERFACE_DESCRIPTOR(u"HDI.Camera.V1_0.HostCallback");
~ICameraHostCallback()44     virtual ~ICameraHostCallback() {}
45 
46 public:
47     /**
48      * @brief Called when the camera status changes to report the latest status.
49      *
50      * @param cameraId Indicates the ID of the camera whose status changes.
51      * @param status Indicates the latest status of the camera.
52      *
53      * @since 1.0
54      * @version 1.0
55      */
56     virtual void OnCameraStatus(const std::string &cameraId, CameraStatus status) = 0;
57 
58     /**
59      * @brief Called when the flash status changes to report the latest status.
60      *
61      * @param cameraId Indicates the ID of the camera to which the flash whose status changes is bound.
62      * @param status Indicates the latest status of the flash.
63      *
64      * @since 1.0
65      * @version 1.0
66      */
67     virtual void OnFlashlightStatus(const std::string &cameraId, FlashlightStatus status) = 0;
68 };
69 }
70 #endif // HDI_CAMERA_HOST_CALLBACK_SERVER_H
71