1/*
2 * Copyright (c) 2021-2022 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 MERGE_UTILS_H
17#define MERGE_UTILS_H
18
19#include "candidate.h"
20#include "common.h"
21#include "contacts_columns.h"
22#include "hilog_wrapper.h"
23#include "rdb_errno.h"
24#include "rdb_store.h"
25#include "result_set.h"
26
27namespace OHOS {
28namespace Contacts {
29class MergeUtils {
30public:
31    MergeUtils();
32    ~MergeUtils();
33    std::set<std::string> QueryRawContactByType(
34        std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId, int typeId);
35    std::set<std::string> QueryDataDetailInfo(
36        std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::set<int> &rawIds, int typeId);
37    std::set<std::string> QueryDataExecute(
38        std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::set<int> rawIds, int typeId);
39    std::vector<int> QueryByDataName(
40        int rawId, std::set<std::string> data, std::shared_ptr<OHOS::NativeRdb::RdbStore> store);
41    bool SetEqual(std::set<std::string> setLeft, std::set<std::string> setRight);
42    void AddHasJudgeForRawId(
43        std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId, OHOS::NativeRdb::ValuesBucket &value);
44    void GetRawIdsByRawId(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId, std::set<int> &rawIds);
45};
46} // namespace Contacts
47} // namespace OHOS
48#endif // MERGE_UTILS_H
49