• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 OHOS_ADAPTER_HELPER_H
17 #define OHOS_ADAPTER_HELPER_H
18 
19 #include <memory>
20 
21 #include "aafwk_app_mgr_client_adapter.h"
22 #include "audio_renderer_adapter.h"
23 #include "audio_system_manager_adapter.h"
24 #include "battery_mgr_client_adapter.h"
25 #include "datashare_adapter.h"
26 #include "display_manager_adapter.h"
27 #include "imf_adapter.h"
28 #include "mmi_adapter.h"
29 #include "net_connect_adapter.h"
30 #include "ohos_init_web_adapter.h"
31 #include "ohos_web_data_base_adapter.h"
32 #include "pasteboard_client_adapter.h"
33 #include "power_mgr_client_adapter.h"
34 #include "soc_perf_client_adapter.h"
35 
36 namespace OHOS::NWeb {
37 class OhosAdapterHelper {
38 public:
39     static OhosAdapterHelper &GetInstance();
40 
41     virtual ~OhosAdapterHelper() = default;
42 
43     std::unique_ptr<AafwkAppMgrClientAdapter> CreateAafwkAdapter();
44 
45     std::unique_ptr<PowerMgrClientAdapter> CreatePowerMgrClientAdapter();
46 
47     std::unique_ptr<DisplayManagerAdapter> CreateDisplayMgrAdapter();
48 
49     std::unique_ptr<BatteryMgrClientAdapter> CreateBatteryClientAdapter();
50 
51     std::unique_ptr<NetConnectAdapter> CreateNetConnectAdapter();
52 
53     OhosWebDataBaseAdapter& GetOhosWebDataBaseAdapterInstance();
54 
55     PasteBoardClientAdapter& GetPasteBoard() const;
56 
57     std::unique_ptr<AudioRendererAdapter> CreateAudioRendererAdapter();
58 
59     AudioSystemManagerAdapter& GetAudioSystemManager() const;
60 
61     OhosWebPermissionDataBaseAdapter& GetWebPermissionDataBaseInstance();
62 
63     std::unique_ptr<MMIAdapter> CreateMMIAdapter();
64 
65     std::unique_ptr<SocPerfClientAdapter> CreateSocPerfClientAdapter();
66 
67     OhosWebDnsDataBaseAdapter& GetWebDnsDataBaseInstance();
68 
69     std::unique_ptr<OhosInitWebAdapter> GetInitWebAdapter() const;
70 
71     DatashareAdapter& GetDatashareInstance() const;
72 
73     std::unique_ptr<IMFAdapter> CreateIMFAdapter() const;
74 
75 private:
76     OhosAdapterHelper() = default;
77 
78     OhosAdapterHelper(const OhosAdapterHelper&) = delete;
79 
80     OhosAdapterHelper& operator=(const OhosAdapterHelper&) = delete;
81 };
82 } // namespace OHOS::NWeb
83 
84 #endif // OHOS_ADAPTER_HELPER_H
85