1 /*
2  * Copyright (C) 2024 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 TELEPHONY_NUMBER_IDENTITY_DATA_BASE_HELPER_H
17 #define TELEPHONY_NUMBER_IDENTITY_DATA_BASE_HELPER_H
18 
19 #include "ability_manager_interface.h"
20 #include "common_type.h"
21 #include "data_ability_observer_stub.h"
22 #include "datashare_helper.h"
23 #include "datashare_predicates.h"
24 #include "if_system_ability_manager.h"
25 #include "refbase.h"
26 #include "singleton.h"
27 #include "system_ability.h"
28 #include "system_ability_definition.h"
29 
30 namespace OHOS {
31 namespace Telephony {
32 class NumberIdentityDataBaseHelper {
33     DECLARE_DELAYED_SINGLETON(NumberIdentityDataBaseHelper)
34 public:
35     bool Query(std::string &numberLocation, DataShare::DataSharePredicates &predicates);
36     bool QueryYellowPageAndMark(NumberMarkInfo &numberMarkInfo, DataShare::DataSharePredicates &predicates);
37     bool SetMarkInfoValues(std::shared_ptr<DataShare::DataShareResultSet> &resultSet, NumberMarkInfo &numberMarkInfo);
38     static constexpr const char *NUMBER_IDENTITY_URI = "datashare:///numberlocationability";
39 private:
40     std::shared_ptr<DataShare::DataShareHelper> CreateDataShareHelper(std::string uri);
41 };
42 } // namespace Telephony
43 } // namespace OHOS
44 #endif
45