1 /*
2  * Copyright (c) 2023 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 #ifndef OHOS_I_AV_SENDER_ENGINE_CALLBACK_H
17 #define OHOS_I_AV_SENDER_ENGINE_CALLBACK_H
18 
19 #include "av_trans_errno.h"
20 #include "av_trans_message.h"
21 #include "av_trans_types.h"
22 
23 namespace OHOS {
24 namespace DistributedHardware {
25 /**
26  * @brief AV sender engine callback interface.
27  *
28  * AV sender engine callback is used to receive the engine state change events and message notification.
29  *
30  * @since 1.0
31  * @version 1.0
32  */
33 class IAVSenderEngineCallback {
34 public:
35     /**
36      * @brief Destructor.
37      * @return No return value.
38      */
39     virtual ~IAVSenderEngineCallback() = default;
40 
41     /**
42      * @brief Report the engine state change events to the distributed service.
43      * @param event  event content.
44      * @return Returns DH_AVT_SUCCESS(0) if successful, otherwise returns other error code.
45      */
46     virtual int32_t OnSenderEvent(const AVTransEvent &event) = 0;
47 
48     /**
49      * @brief Report the engine message to the distributed service.
50      * @param message  message content.
51      * @return Returns DH_AVT_SUCCESS(0) if successful, otherwise returns other error code.
52      */
53     virtual int32_t OnMessageReceived(const std::shared_ptr<AVTransMessage> &message) = 0;
54 };
55 } // DistributedHardware
56 } // OHOS
57 #endif // OHOS_I_AV_SENDER_ENGINE_CALLBACK_H