• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 DISTRIBUTEDFILE_SERVICE_PROXY_H
17 #define DISTRIBUTEDFILE_SERVICE_PROXY_H
18 
19 #include "iremote_proxy.h"
20 #include "i_distributedfile_service.h"
21 #include "message_parcel.h"
22 
23 namespace OHOS {
24 namespace Storage {
25 namespace DistributedFile {
26 class ServiceProxy : public IRemoteProxy<IDistributedFileService> {
27 public:
28     /**
29      * ServiceProxy
30      *
31      * @param impl
32      */
ServiceProxy(const sptr<IRemoteObject> & impl)33     explicit ServiceProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IDistributedFileService>(impl) {}
34     virtual ~ServiceProxy() = default;
35 
36     int32_t SendFile(const std::string &cid,
37                      const std::vector<std::string> &sourceFileList,
38                      const std::vector<std::string> &destinationFileList,
39                      const uint32_t fileCount) override;
40     int32_t OpenFile(int32_t fd, const std::string &fileName, int32_t mode) override;
41     int32_t RegisterNotifyCallback(sptr<IFileTransferCallback> &callback) override;
42     int32_t UnRegisterNotifyCallback() override;
43     int32_t IsDeviceOnline(const std::string &cid) override;
44 private:
45     static inline BrokerDelegator<ServiceProxy> delegator_;
46 };
47 } // namespace DistributedFile
48 } // namespace Storage
49 } // namespace OHOS
50 #endif // DISTRIBUTEDFILE_SERVICE_PROXY_H