• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 CANDIDATESCORE_H
17 #define CANDIDATESCORE_H
18 
19 #include "rdb_errno.h"
20 #include "rdb_store.h"
21 #include "result_set.h"
22 
23 #include "candidate.h"
24 
25 namespace OHOS {
26 namespace Contacts {
27 class CandidateStatus {
28 public:
29     CandidateStatus();
30     ~CandidateStatus();
31     Candidate QueryAllForMerge(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId);
32 
33 private:
34     int PhoneMatch(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::set<std::string> phones, int id);
35     bool IsMerged(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId);
36     bool IsNeedMerge(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId);
37     bool IsMergeStatus(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, int rawId);
38     bool JudgeDataDifferent(std::shared_ptr<OHOS::NativeRdb::RdbStore> store, std::vector<int> ids, int rawId);
39     void AddMergedStatus(Candidate &candidate);
40 };
41 } // namespace Contacts
42 } // namespace OHOS
43 #endif // CANDIDATESCORE_H
44