• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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 DISTRIBUTED_INCLUDE_SOFTBUS_DISTRIBUTED_OPERATION_SERVICE_H
17 #define DISTRIBUTED_INCLUDE_SOFTBUS_DISTRIBUTED_OPERATION_SERVICE_H
18 
19 #include <set>
20 #include <map>
21 
22 #include "response_box.h"
23 #include "distributed_device_data.h"
24 #include "notification_operation_info.h"
25 
26 namespace OHOS {
27 namespace Notification {
28 class DistributedOperationService {
29 public:
30     static DistributedOperationService& GetInstance();
31 
32     void HandleNotificationOperation(const std::shared_ptr<TlvBox>& boxMessage);
33 #ifdef DISTRIBUTED_FEATURE_MASTER
34     void ReplyOperationResponse(const std::string& hashCode, const NotificationResponseBox& responseBox,
35         OperationType operationType, uint32_t result);
36     int32_t TriggerReplyApplication(const std::string& hashCode, const int32_t deviceType,
37         const NotificationResponseBox& responseBox);
38     void TriggerJumpApplication(const std::string& hashCode, const int32_t deviceType);
39     void TriggerByOperationType(const std::string& hashCode, const int32_t deviceType,
40         const int32_t operationType, const NotificationResponseBox& responseBox);
41 #else
42     int32_t OnOperationResponse(const std::shared_ptr<NotificationOperationInfo>& operationInfo,
43         const DistributedDeviceInfo& device);
44     void ResponseOperationResult(const std::string& hashCode, const NotificationResponseBox& responseBox);
45     void LaunchProjectionApp(const DistributedDeviceInfo& peerDevice, const DistributedDeviceInfo& localDevice);
46 #endif
47 };
48 }
49 }
50 #endif // DISTRIBUTED_INCLUDE_SOFTBUS_DISTRIBUTED_OPERATION_SERVICE_H
51