• 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 OHOS_DP_PROFILE_DATA_MANAGER_H
17 #define OHOS_DP_PROFILE_DATA_MANAGER_H
18 
19 #include <cstdint>
20 
21 #include "kvstore_observer.h"
22 
23 #include "device_icon_info.h"
24 #include "device_icon_info_filter_options.h"
25 #include "device_profile.h"
26 #include "device_profile_dao.h"
27 #include "product_info.h"
28 #include "single_instance.h"
29 namespace OHOS {
30 namespace DistributedDeviceProfile {
31 class ProfileDataManager {
32     DECLARE_SINGLE_INSTANCE(ProfileDataManager);
33 public:
34     int32_t Init();
35     int32_t UnInit();
36 
37     int32_t PutDeviceProfileBatch(std::vector<DeviceProfile>& deviceProfiles);
38     int32_t DeleteDeviceProfileBatch(std::vector<DeviceProfile>& deviceProfiles);
39     int32_t GetDeviceProfiles(DeviceProfileFilterOptions& options,
40         std::vector<DeviceProfile>& deviceProfiles);
41     int32_t PutProductInfoBatch(const std::vector<ProductInfo>& productInfos);
42     int32_t PutDeviceIconInfoBatch(const std::vector<DeviceIconInfo>& deviceIconInfos);
43     int32_t GetDeviceIconInfos(const DeviceIconInfoFilterOptions& filterOptions,
44         std::vector<DeviceIconInfo>& deviceIconInfos);
45 
46     int32_t PutDeviceProfile(DeviceProfile deviceProfile);
47 private:
48     bool FilterInvaildSymbol(std::string str);
49     int32_t PutDeviceIconInfo(const DeviceIconInfo& deviceIconInfo);
50     int32_t PutProductInfo(const ProductInfo& productInfo);
51 };
52 } // DistributedDeviceProfile
53 } // OHOS
54 #endif // OHOS_DP_PROFILE_DATA_MANAGER_H
55