1 /* 2 * Copyright (c) 2022-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 DEVICESTATUS_SRV_PROXY_H 17 #define DEVICESTATUS_SRV_PROXY_H 18 19 #include "iremote_proxy.h" 20 #include <nocopyable.h> 21 22 #include "drag_data.h" 23 #include "i_devicestatus.h" 24 25 namespace OHOS { 26 namespace Msdp { 27 namespace DeviceStatus { 28 class DeviceStatusSrvProxy : public IRemoteProxy<Idevicestatus> { 29 public: DeviceStatusSrvProxy(const sptr<IRemoteObject> & impl)30 explicit DeviceStatusSrvProxy(const sptr<IRemoteObject> &impl) 31 : IRemoteProxy<Idevicestatus>(impl) {} 32 DISALLOW_COPY_AND_MOVE(DeviceStatusSrvProxy); 33 ~DeviceStatusSrvProxy() = default; 34 35 virtual void Subscribe(Type type, ActivityEvent event, ReportLatencyNs latency, 36 sptr<IRemoteDevStaCallback> callback) override; 37 virtual void Unsubscribe(Type type, ActivityEvent event, 38 sptr<IRemoteDevStaCallback> callback) override; 39 virtual Data GetCache(const Type &type) override; 40 int32_t AllocSocketFd(const std::string &programName, int32_t moduleType, 41 int32_t &socketFd, int32_t &tokenType) override; 42 virtual int32_t RegisterCoordinationListener(bool isCompatible = false) override; 43 virtual int32_t UnregisterCoordinationListener(bool isCompatible = false) override; 44 virtual int32_t PrepareCoordination(int32_t userData, bool isCompatible = false) override; 45 virtual int32_t UnprepareCoordination(int32_t userData, bool isCompatible = false) override; 46 virtual int32_t ActivateCoordination(int32_t userData, const std::string &remoteNetworkId, 47 int32_t startDeviceId, bool isCompatible = false) override; 48 virtual int32_t DeactivateCoordination(int32_t userData, bool isUnchained, bool isCompatible = false) override; 49 virtual int32_t GetCoordinationState(int32_t userData, 50 const std::string &networkId, bool isCompatible = false) override; 51 virtual int32_t StartDrag(const DragData &dragData) override; 52 virtual int32_t StopDrag(const DragDropResult &dropResult) override; 53 virtual int32_t UpdateDragStyle(DragCursorStyle style) override; 54 virtual int32_t UpdateShadowPic(const ShadowInfo &shadowInfo) override; 55 virtual int32_t GetDragData(DragData &dragData) override; 56 virtual int32_t GetDragState(DragState &dragState) override; 57 virtual int32_t GetDragTargetPid() override; 58 virtual int32_t GetUdKey(std::string &udKey) override; 59 virtual int32_t AddDraglistener() override; 60 virtual int32_t RemoveDraglistener() override; 61 virtual int32_t AddSubscriptListener() override; 62 virtual int32_t RemoveSubscriptListener() override; 63 virtual int32_t SetDragWindowVisible(bool visible, bool isForce = false) override; 64 virtual int32_t GetShadowOffset(int32_t &offsetX, int32_t &offsetY, int32_t &width, int32_t &height) override; 65 virtual int32_t AddHotAreaListener() override; 66 virtual int32_t RemoveHotAreaListener() override; 67 virtual int32_t UpdatePreviewStyle(const PreviewStyle &previewStyle) override; 68 virtual int32_t UpdatePreviewStyleWithAnimation(const PreviewStyle &previewStyle, 69 const PreviewAnimation &animation) override; 70 virtual int32_t GetDragSummary(std::map<std::string, int64_t> &summarys) override; 71 virtual int32_t EnterTextEditorArea(bool enable) override; 72 virtual int32_t GetDragAction(DragAction &dragAction) override; 73 virtual int32_t GetExtraInfo(std::string &extraInfo) override; 74 virtual int32_t AddPrivilege() override; 75 76 private: 77 static inline BrokerDelegator<DeviceStatusSrvProxy> delegator_; 78 }; 79 } // namespace DeviceStatus 80 } // namespace Msdp 81 } // namespace OHOS 82 #endif // DEVICESTATUS_SRV_PROXY_H