1 /*
2 * Copyright (c) 2025 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 #include "form_edit_extension_module_loader.h"
17
18 #include "form_edit_extension.h"
19 #include "hilog_tag_wrapper.h"
20
21 namespace OHOS {
22 namespace AbilityRuntime {
23 FormEditExtensionModuleLoader::FormEditExtensionModuleLoader() = default;
24 FormEditExtensionModuleLoader::~FormEditExtensionModuleLoader() = default;
25
Create(const std::unique_ptr<Runtime> & runtime) const26 Extension *FormEditExtensionModuleLoader::Create(const std::unique_ptr<Runtime> &runtime) const
27 {
28 TAG_LOGD(AAFwkTag::FORM_EDIT_EXT, "called");
29 return FormEditExtension::Create(runtime);
30 }
31
GetParams()32 std::map<std::string, std::string> FormEditExtensionModuleLoader::GetParams()
33 {
34 TAG_LOGD(AAFwkTag::FORM_EDIT_EXT, "called");
35 std::map<std::string, std::string> params;
36 // type means extension type in ExtensionAbilityType of
37 // extension_ability_info.h, 27 means formEditExtension.
38 params.insert(std::pair<std::string, std::string>("type", "27"));
39 params.insert(std::pair<std::string, std::string>("name", "FormEditExtensionAbility"));
40 return params;
41 }
42
OHOS_EXTENSION_GetExtensionModule()43 extern "C" __attribute__((visibility("default"))) void *OHOS_EXTENSION_GetExtensionModule()
44 {
45 return &FormEditExtensionModuleLoader::GetInstance();
46 }
47 } // namespace AbilityRuntime
48 } // namespace OHOS