1 /* 2 * Copyright (c) 2022-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 OHOS_IPUBLISHER_LISTENER_H 17 #define OHOS_IPUBLISHER_LISTENER_H 18 19 #include <cstdint> 20 #include <string> 21 22 #include <iremote_broker.h> 23 24 namespace OHOS { 25 namespace DistributedHardware { 26 enum class DHTopic : uint32_t { 27 // Topic min border, not use for real topic 28 TOPIC_MIN = 0, 29 // Start project distributed screen 30 TOPIC_START_DSCREEN = 1, 31 // Publish Sink Project Window Info 32 TOPIC_SINK_PROJECT_WINDOW_INFO = 2, 33 // Stop distributed screen project 34 TOPIC_STOP_DSCREEN = 3, 35 // publish device offline message 36 TOPIC_DEV_OFFLINE = 4, 37 // publish low latency message 38 TOPIC_LOW_LATENCY = 5, 39 // Topic init DHMS is ready 40 TOPIC_INIT_DHMS_READY = 6, 41 // Topic for physical input devices plugin event 42 TOPIC_PHY_DEV_PLUGIN = 7, 43 // Topic max border, not use for real topic 44 TOPIC_ISOMERISM = 8, 45 TOPIC_MAX = 9 46 }; 47 48 class IPublisherListener : public IRemoteBroker { 49 public: 50 virtual void OnMessage(const DHTopic topic, const std::string& message) = 0; 51 52 enum class Message : uint32_t { 53 ON_MESSAGE, 54 }; 55 56 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedHardwareFwk.IPublisherListener"); 57 }; 58 } // namespace DistributedHardware 59 } // namespace OHOS 60 #endif // OHOS_IPUBLISHER_LISTENER_H