• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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() override;
43     virtual int32_t UnregisterCoordinationListener() override;
44     virtual int32_t PrepareCoordination(int32_t userData) override;
45     virtual int32_t UnprepareCoordination(int32_t userData) override;
46     virtual int32_t ActivateCoordination(int32_t userData, const std::string &remoteNetworkId,
47         int32_t startDeviceId) override;
48     virtual int32_t DeactivateCoordination(int32_t userData, bool isUnchained) override;
49     virtual int32_t GetCoordinationState(int32_t userData, const std::string &deviceId) override;
50     virtual int32_t StartDrag(const DragData &dragData) override;
51     virtual int32_t StopDrag(DragResult result, bool hasCustomAnimation) override;
52     virtual int32_t UpdateDragStyle(DragCursorStyle style) override;
53     virtual int32_t UpdateShadowPic(const ShadowInfo &shadowInfo) override;
54     virtual int32_t GetDragTargetPid() override;
55     virtual int32_t GetUdKey(std::string &udKey) override;
56     virtual int32_t AddDraglistener() override;
57     virtual int32_t RemoveDraglistener() override;
58     virtual int32_t SetDragWindowVisible(bool visible) override;
59     virtual int32_t GetShadowOffset(int32_t& offsetX, int32_t& offsetY, int32_t& width, int32_t& height) override;
60 
61 private:
62     static inline BrokerDelegator<DeviceStatusSrvProxy> delegator_;
63 };
64 } // namespace DeviceStatus
65 } // namespace Msdp
66 } // namespace OHOS
67 #endif // DEVICESTATUS_SRV_PROXY_H
68