1cb7eb8c9Sopenharmony_ci/*
2cb7eb8c9Sopenharmony_ci * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3cb7eb8c9Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4cb7eb8c9Sopenharmony_ci * you may not use this file except in compliance with the License.
5cb7eb8c9Sopenharmony_ci * You may obtain a copy of the License at
6cb7eb8c9Sopenharmony_ci *
7cb7eb8c9Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8cb7eb8c9Sopenharmony_ci *
9cb7eb8c9Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10cb7eb8c9Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11cb7eb8c9Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12cb7eb8c9Sopenharmony_ci * See the License for the specific language governing permissions and
13cb7eb8c9Sopenharmony_ci * limitations under the License.
14cb7eb8c9Sopenharmony_ci */
15cb7eb8c9Sopenharmony_ci#ifndef DAEMON_STUB_H
16cb7eb8c9Sopenharmony_ci#define DAEMON_STUB_H
17cb7eb8c9Sopenharmony_ci
18cb7eb8c9Sopenharmony_ci#include <map>
19cb7eb8c9Sopenharmony_ci
20cb7eb8c9Sopenharmony_ci#include "dm_device_info.h"
21cb7eb8c9Sopenharmony_ci#include "i_daemon.h"
22cb7eb8c9Sopenharmony_ci#include "iremote_stub.h"
23cb7eb8c9Sopenharmony_ci#include "message_option.h"
24cb7eb8c9Sopenharmony_ci#include "message_parcel.h"
25cb7eb8c9Sopenharmony_ci#include "refbase.h"
26cb7eb8c9Sopenharmony_ci
27cb7eb8c9Sopenharmony_cinamespace OHOS {
28cb7eb8c9Sopenharmony_cinamespace Storage {
29cb7eb8c9Sopenharmony_cinamespace DistributedFile {
30cb7eb8c9Sopenharmony_ciclass DaemonStub : public IRemoteStub<IDaemon> {
31cb7eb8c9Sopenharmony_cipublic:
32cb7eb8c9Sopenharmony_ci    DaemonStub();
33cb7eb8c9Sopenharmony_ci    virtual ~DaemonStub() = default;
34cb7eb8c9Sopenharmony_ci    int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
35cb7eb8c9Sopenharmony_ci
36cb7eb8c9Sopenharmony_ciprivate:
37cb7eb8c9Sopenharmony_ci    using DaemonInterface = int32_t (DaemonStub::*)(MessageParcel &data, MessageParcel &reply);
38cb7eb8c9Sopenharmony_ci    std::map<uint32_t, DaemonInterface> opToInterfaceMap_;
39cb7eb8c9Sopenharmony_ci
40cb7eb8c9Sopenharmony_ci    int32_t HandleOpenP2PConnection(MessageParcel &data, MessageParcel &reply);
41cb7eb8c9Sopenharmony_ci    int32_t HandleCloseP2PConnection(MessageParcel &data, MessageParcel &reply);
42cb7eb8c9Sopenharmony_ci    int32_t HandleOpenP2PConnectionEx(MessageParcel &data, MessageParcel &reply);
43cb7eb8c9Sopenharmony_ci    int32_t HandleCloseP2PConnectionEx(MessageParcel &data, MessageParcel &reply);
44cb7eb8c9Sopenharmony_ci    int32_t HandlePrepareSession(MessageParcel &data, MessageParcel &reply);
45cb7eb8c9Sopenharmony_ci    int32_t HandleCancelCopyTask(MessageParcel &data, MessageParcel &reply);
46cb7eb8c9Sopenharmony_ci    int32_t HandleRequestSendFile(MessageParcel &data, MessageParcel &reply);
47cb7eb8c9Sopenharmony_ci    int32_t HandleGetRemoteCopyInfo(MessageParcel &data, MessageParcel &reply);
48cb7eb8c9Sopenharmony_ci
49cb7eb8c9Sopenharmony_ci    int32_t HandlePushAsset(MessageParcel &data, MessageParcel &reply);
50cb7eb8c9Sopenharmony_ci    int32_t HandleRegisterRecvCallback(MessageParcel &data, MessageParcel &reply);
51cb7eb8c9Sopenharmony_ci    int32_t HandleUnRegisterRecvCallback(MessageParcel &data, MessageParcel &reply);
52cb7eb8c9Sopenharmony_ci};
53cb7eb8c9Sopenharmony_ci} // namespace DistributedFile
54cb7eb8c9Sopenharmony_ci} // namespace Storage
55cb7eb8c9Sopenharmony_ci} // namespace OHOS
56cb7eb8c9Sopenharmony_ci#endif // DAEMON_STUB_H