• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 PASTEBOARD_DEVICE_PROFILE_ADAPTER_H
17 #define PASTEBOARD_DEVICE_PROFILE_ADAPTER_H
18 
19 #include <cstdint>
20 #include <string>
21 
22 #include "api/visibility.h"
23 
24 namespace OHOS {
25 namespace MiscServices {
26 
27 class IDeviceProfileAdapter {
28 public:
29     typedef void (*OnProfileUpdateCallback)(const std::string &udid, bool status);
30 
31     virtual ~IDeviceProfileAdapter() = default;
32     virtual int32_t RegisterUpdateCallback(const OnProfileUpdateCallback callback) = 0;
33     virtual int32_t PutDeviceStatus(const std::string &udid, bool status) = 0;
34     virtual int32_t GetDeviceStatus(const std::string &udid, bool &status) = 0;
35     virtual bool GetDeviceVersion(const std::string &udid, uint32_t &versionId) = 0;
36     virtual int32_t SubscribeProfileEvent(const std::string &udid) = 0;
37     virtual int32_t UnSubscribeProfileEvent(const std::string &udid) = 0;
38     virtual void SendSubscribeInfos() = 0;
39     virtual void ClearDeviceProfileService() = 0;
40 };
41 
42 extern "C" {
43     typedef IDeviceProfileAdapter *(*GetDeviceProfileAdapterFunc)();
44     typedef void (*DeinitDeviceProfileAdapterFunc)();
45 
46     API_EXPORT IDeviceProfileAdapter *GetDeviceProfileAdapter();
47     API_EXPORT void DeinitDeviceProfileAdapter();
48 }
49 
50 } // namespace MiscServices
51 } // namespace OHOS
52 
53 #endif // PASTEBOARD_DEVICE_PROFILE_ADAPTER_H
54