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 INTENTION_BOOMERANG_CLIENT_H 17 #define INTENTION_BOOMERANG_CLIENT_H 18 19 #include <map> 20 21 #include "nocopyable.h" 22 23 #include "iremote_boomerang_callback.h" 24 25 namespace OHOS { 26 namespace Msdp { 27 namespace DeviceStatus { 28 class BoomerangClient final { 29 public: 30 BoomerangClient() = default; 31 ~BoomerangClient() = default; 32 DISALLOW_COPY_AND_MOVE(BoomerangClient); 33 34 int32_t SubscribeCallback(BoomerangType type, const std::string& bundleName, 35 const sptr<IRemoteBoomerangCallback>& callback); 36 int32_t UnsubscribeCallback(BoomerangType type, const std::string& bundleName, 37 const sptr<IRemoteBoomerangCallback>& callback); 38 int32_t NotifyMetadataBindingEvent(const std::string& bundleName, const sptr<IRemoteBoomerangCallback>& callback); 39 int32_t SubmitMetadata(const std::string& metaData); 40 int32_t BoomerangEncodeImage(const std::shared_ptr<Media::PixelMap>& pixelMap, 41 const std::string& metaData, const sptr<IRemoteBoomerangCallback>& callback); 42 int32_t BoomerangDecodeImage(const std::shared_ptr<Media::PixelMap>& pixelMap, 43 const sptr<IRemoteBoomerangCallback>& callback); 44 45 private: 46 std::mutex mtx_; 47 std::map<BoomerangType, int32_t> typeMap_; 48 }; 49 } // namespace DeviceStatus 50 } // namespace Msdp 51 } // namespace OHOS 52 #endif // INTENTION_BOOMERANG_CLIENT_H