1 /*
2  * Copyright (c) 2024 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 IAM_REMOTE_CONNECT_LISTENER_H
17 #define IAM_REMOTE_CONNECT_LISTENER_H
18 
19 #include <cstdint>
20 #include <string>
21 
22 #include "attributes.h"
23 #include "iam_logger.h"
24 
25 #define LOG_TAG "USER_AUTH_SA"
26 namespace OHOS {
27 namespace UserIam {
28 namespace UserAuth {
29 using MsgCallback = std::function<void(const std::shared_ptr<Attributes> &)>;
30 
31 enum ConnectStatus {
32     DISCONNECTED = 0,
33     CONNECTED = 1,
34 };
35 
36 class ConnectionListener {
37 public:
38     ConnectionListener() = default;
39     virtual ~ConnectionListener() = default;
40     virtual void OnMessage(const std::string &connectionName, const std::string &srcEndPoint,
41         const std::shared_ptr<Attributes> &request, std::shared_ptr<Attributes> &reply) = 0;
42     virtual void OnConnectStatus(const std::string &connectionName, ConnectStatus connectStatus) = 0;
43 };
44 } // namespace UserAuth
45 } // namespace UserIam
46 } // namespace OHOS
47 #endif // IAM_REMOTE_CONNECT_LISTENER_H
48