1c8a96e64Sopenharmony_ci/*
2c8a96e64Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
3c8a96e64Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c8a96e64Sopenharmony_ci * you may not use this file except in compliance with the License.
5c8a96e64Sopenharmony_ci * You may obtain a copy of the License at
6c8a96e64Sopenharmony_ci *
7c8a96e64Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8c8a96e64Sopenharmony_ci *
9c8a96e64Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c8a96e64Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c8a96e64Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c8a96e64Sopenharmony_ci * See the License for the specific language governing permissions and
13c8a96e64Sopenharmony_ci * limitations under the License.
14c8a96e64Sopenharmony_ci */
15c8a96e64Sopenharmony_ci
16c8a96e64Sopenharmony_ci#ifndef API_POLICY_ADAPTER_H
17c8a96e64Sopenharmony_ci#define API_POLICY_ADAPTER_H
18c8a96e64Sopenharmony_ci
19c8a96e64Sopenharmony_ci#include "string"
20c8a96e64Sopenharmony_ci#ifndef __WIN32
21c8a96e64Sopenharmony_ci#include <dlfcn.h>
22c8a96e64Sopenharmony_ci#endif
23c8a96e64Sopenharmony_ci
24c8a96e64Sopenharmony_ciclass ApiPolicyAdapter {
25c8a96e64Sopenharmony_cipublic:
26c8a96e64Sopenharmony_ci    ApiPolicyAdapter();
27c8a96e64Sopenharmony_ci    ~ApiPolicyAdapter();
28c8a96e64Sopenharmony_ci
29c8a96e64Sopenharmony_ci    int32_t CheckUrl(const std::string& bundleName, const std::string& domainType, const std::string& url);
30c8a96e64Sopenharmony_ci
31c8a96e64Sopenharmony_ci    using CheckUrlFunc = int32_t (*)(const std::string&, const std::string&, const std::string&);
32c8a96e64Sopenharmony_ci    void SetCheckUrlFunc(CheckUrlFunc& func);
33c8a96e64Sopenharmony_ci
34c8a96e64Sopenharmony_ciprivate:
35c8a96e64Sopenharmony_ci    void *handle = nullptr;
36c8a96e64Sopenharmony_ci    CheckUrlFunc func = nullptr;
37c8a96e64Sopenharmony_ci};
38c8a96e64Sopenharmony_ci
39c8a96e64Sopenharmony_ci#endif
40