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_STUB_H 17 #define DEVICESTATUS_SRV_STUB_H 18 19 #include <map> 20 21 #include <iremote_stub.h> 22 #include <nocopyable.h> 23 24 #include "i_devicestatus.h" 25 #include "message_option.h" 26 #include "message_parcel.h" 27 28 namespace OHOS { 29 namespace Msdp { 30 namespace DeviceStatus { 31 class DeviceStatusSrvStub : public IRemoteStub<Idevicestatus> { 32 public: 33 using ConnFunc = int32_t (DeviceStatusSrvStub::*)(MessageParcel& data, MessageParcel& reply); 34 35 DeviceStatusSrvStub(); 36 DISALLOW_COPY_AND_MOVE(DeviceStatusSrvStub); 37 virtual ~DeviceStatusSrvStub() = default; 38 39 int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 40 41 private: 42 int32_t SubscribeStub(MessageParcel& data, MessageParcel& reply); 43 int32_t UnsubscribeStub(MessageParcel& data, MessageParcel& reply); 44 int32_t GetLatestDeviceStatusDataStub(MessageParcel& data, MessageParcel& reply); 45 int32_t HandleAllocSocketFdStub(MessageParcel& data, MessageParcel& reply); 46 int32_t RegisterCoordinationMonitorStub(MessageParcel& data, MessageParcel& reply); 47 int32_t UnregisterCoordinationMonitorStub(MessageParcel& data, MessageParcel& reply); 48 int32_t PrepareCoordinationStub(MessageParcel& data, MessageParcel& reply); 49 int32_t UnPrepareCoordinationStub(MessageParcel& data, MessageParcel& reply); 50 int32_t ActivateCoordinationStub(MessageParcel& data, MessageParcel& reply); 51 int32_t DeactivateCoordinationStub(MessageParcel& data, MessageParcel& reply); 52 int32_t GetCoordinationStateStub(MessageParcel& data, MessageParcel& reply); 53 int32_t StartDragStub(MessageParcel& data, MessageParcel& reply); 54 int32_t StopDragStub(MessageParcel& data, MessageParcel& reply); 55 int32_t UpdateDragStyleStub(MessageParcel& data, MessageParcel& reply); 56 int32_t GetDragTargetPidStub(MessageParcel& data, MessageParcel& reply); 57 int32_t GetUdKeyStub(MessageParcel& data, MessageParcel& reply); 58 int32_t AddDraglistenerStub(MessageParcel& data, MessageParcel& reply); 59 int32_t RemoveDraglistenerStub(MessageParcel& data, MessageParcel& reply); 60 int32_t SetDragWindowVisibleStub(MessageParcel& data, MessageParcel& reply); 61 int32_t GetShadowOffsetStub(MessageParcel& data, MessageParcel& reply); 62 int32_t UpdateShadowPicStub(MessageParcel& data, MessageParcel& reply); 63 64 private: 65 std::map<uint32_t, ConnFunc> mapConnFunc_; 66 }; 67 } // namespace DeviceStatus 68 } // namespace Msdp 69 } // namespace OHOS 70 #endif // DEVICESTATUS_SRV_STUB_H 71