• 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 OHOS_DISTRIBUTED_DEVICE_PROFILE_PROXY_H
17 #define OHOS_DISTRIBUTED_DEVICE_PROFILE_PROXY_H
18 
19 #include <functional>
20 #include <iosfwd>
21 #include <list>
22 #include <stdint.h>
23 
24 #include "idistributed_device_profile.h"
25 #include "iremote_broker.h"
26 #include "iremote_proxy.h"
27 #include "profile_event.h"
28 #include "refbase.h"
29 
30 namespace OHOS {
31 namespace DeviceProfile {
32 class DistributedDeviceProfileProxy : public IRemoteProxy<IDistributedDeviceProfile> {
33 public:
DistributedDeviceProfileProxy(const sptr<IRemoteObject> & impl)34     explicit DistributedDeviceProfileProxy(const sptr<IRemoteObject>& impl)
35         : IRemoteProxy<IDistributedDeviceProfile>(impl) {}
36     ~DistributedDeviceProfileProxy() = default;
37 
38     int32_t PutDeviceProfile(const ServiceCharacteristicProfile& profile) override;
39     int32_t GetDeviceProfile(const std::string& udid, const std::string& serviceId,
40         ServiceCharacteristicProfile& profile) override;
41     int32_t DeleteDeviceProfile(const std::string& serviceId) override;
42     int32_t SubscribeProfileEvents(const std::list<SubscribeInfo>& subscribeInfos,
43         const sptr<IRemoteObject>& profileEventNotifier,
44         std::list<ProfileEvent>& failedEvents) override;
45     int32_t UnsubscribeProfileEvents(const std::list<ProfileEvent>& profileEvents,
46         const sptr<IRemoteObject>& profileEventNotifier,
47         std::list<ProfileEvent>& failedEvents) override;
48     int32_t SyncDeviceProfile(const SyncOptions& syncOptions,
49         const sptr<IRemoteObject>& profileEventNotifier) override;
50 
51 private:
52     static inline BrokerDelegator<DistributedDeviceProfileProxy> delegator_;
53 };
54 } // namespace DeviceProfile
55 } // namespace OHOS
56 #endif // OHOS_DISTRIBUTED_DEVICE_PROFILE_PROXY_H