• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 I_DDP_ADAPTER_H
17 #define I_DDP_ADAPTER_H
18 
19 #include <memory>
20 #include <string>
21 
22 namespace OHOS {
23 namespace Msdp {
24 namespace DeviceStatus {
25 class IDeviceProfileObserver {
26 public:
27     IDeviceProfileObserver() = default;
28     virtual ~IDeviceProfileObserver() = default;
29 
30     virtual void OnProfileChanged(const std::string &networkId) = 0;
31 };
32 
33 class IDDPAdapter {
34 public:
35     IDDPAdapter() = default;
36     virtual ~IDDPAdapter() = default;
37 
38     virtual void AddObserver(std::shared_ptr<IDeviceProfileObserver> observer) = 0;
39     virtual void RemoveObserver(std::shared_ptr<IDeviceProfileObserver> observer) = 0;
40     virtual void AddWatch(const std::string &networkId) = 0;
41     virtual void RemoveWatch(const std::string &networkId) = 0;
42 
43     virtual int32_t GetProperty(const std::string &networkId, const std::string &name, bool &value) = 0;
44     virtual int32_t GetProperty(const std::string &networkId, const std::string &name, int32_t &value) = 0;
45     virtual int32_t GetProperty(const std::string &networkId, const std::string &name, std::string &value) = 0;
46     virtual int32_t SetProperty(const std::string &name, bool value) = 0;
47     virtual int32_t SetProperty(const std::string &name, int32_t value) = 0;
48     virtual int32_t SetProperty(const std::string &name, const std::string &value) = 0;
49 };
50 } // namespace DeviceStatus
51 } // namespace Msdp
52 } // namespace OHOS
53 #endif // I_DDP_ADAPTER_H
54