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 I_DEVICESTATUS_H 17 #define I_DEVICESTATUS_H 18 19 #include <iremote_broker.h> 20 21 #include "drag_data.h" 22 #include "msdp_ipc_interface_code.h" 23 #include "stationary_callback.h" 24 #include "stationary_data.h" 25 26 namespace OHOS { 27 namespace Msdp { 28 namespace DeviceStatus { 29 class Idevicestatus : public IRemoteBroker { 30 public: 31 virtual void Subscribe(Type type, 32 ActivityEvent event, 33 ReportLatencyNs latency, 34 sptr<IRemoteDevStaCallback> callback) = 0; 35 virtual void Unsubscribe(Type type, 36 ActivityEvent event, 37 sptr<IRemoteDevStaCallback> callback) = 0; 38 virtual Data GetCache(const Type &type) = 0; 39 40 virtual int32_t RegisterCoordinationListener(bool isCompatible = false) = 0; 41 virtual int32_t UnregisterCoordinationListener(bool isCompatible = false) = 0; 42 virtual int32_t PrepareCoordination(int32_t userData, bool isCompatible = false) = 0; 43 virtual int32_t UnprepareCoordination(int32_t userData, bool isCompatible = false) = 0; 44 virtual int32_t ActivateCoordination(int32_t userData, const std::string &remoteNetworkId, 45 int32_t startDeviceId, bool isCompatible = false) = 0; 46 virtual int32_t DeactivateCoordination(int32_t userData, bool isUnchained, bool isCompatible = false) = 0; 47 virtual int32_t GetCoordinationState(int32_t userData, 48 const std::string &networkId, bool isCompatible = false) = 0; 49 virtual int32_t GetCoordinationState(const std::string &udId, bool &state) = 0; 50 virtual int32_t StartDrag(const DragData &dragData) = 0; 51 virtual int32_t StopDrag(const DragDropResult &dropResult) = 0; 52 virtual int32_t UpdateDragStyle(DragCursorStyle style) = 0; 53 virtual int32_t GetDragTargetPid() = 0; 54 virtual int32_t GetUdKey(std::string &udKey) = 0; 55 virtual int32_t AddDraglistener() = 0; 56 virtual int32_t RemoveDraglistener() = 0; 57 virtual int32_t AddSubscriptListener() = 0; 58 virtual int32_t RemoveSubscriptListener() = 0; 59 virtual int32_t AllocSocketFd(const std::string &programName, int32_t moduleType, 60 int32_t &socketFd, int32_t &tokenType) = 0; 61 virtual int32_t SetDragWindowVisible(bool visible, bool isForce = false) = 0; 62 virtual int32_t GetShadowOffset(ShadowOffset &shadowOffset) = 0; 63 virtual int32_t UpdateShadowPic(const ShadowInfo &shadowInfo) = 0; 64 virtual int32_t GetDragData(DragData &dragData) = 0; 65 virtual int32_t GetDragState(DragState &dragState) = 0; 66 virtual int32_t GetDragSummary(std::map<std::string, int64_t> &summarys) = 0; 67 virtual int32_t EnterTextEditorArea(bool enable) = 0; 68 virtual int32_t GetDragAction(DragAction &dragAction) = 0; 69 virtual int32_t GetExtraInfo(std::string &extraInfo) = 0; IsRunning()70 virtual bool IsRunning() const 71 { 72 return true; 73 } 74 75 virtual int32_t AddHotAreaListener() = 0; 76 virtual int32_t RemoveHotAreaListener() = 0; 77 virtual int32_t UpdatePreviewStyle(const PreviewStyle &previewStyle) = 0; 78 virtual int32_t UpdatePreviewStyleWithAnimation(const PreviewStyle &previewStyle, 79 const PreviewAnimation &animation) = 0; 80 virtual int32_t AddPrivilege() = 0; 81 virtual int32_t EraseMouseIcon() = 0; 82 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.msdp.Idevicestatus"); 83 }; 84 } // namespace DeviceStatus 85 } // namespace Msdp 86 } // namespace OHOS 87 #endif // I_DEVICESTATUS_H 88