@react-native-ohos/react-native-system-setting 1.7.7-rc.1 → 1.7.7-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API.md +57 -57
- package/CHANGELOG.md +206 -0
- package/COMMITTERS.md +7 -0
- package/LICENSE +21 -21
- package/LICENSE.md +21 -21
- package/OAT.xml +81 -0
- package/RCTSystemSetting.podspec +20 -20
- package/README.OpenSource +10 -10
- package/README.md +15 -15
- package/SystemSetting.d.ts +81 -81
- package/SystemSetting.js +347 -347
- package/Utils.js +11 -11
- package/harmony/react_native_system_setting/Index.ets +28 -27
- package/harmony/react_native_system_setting/build-profile.json5 +31 -31
- package/harmony/react_native_system_setting/hvigorfile.ts +6 -6
- package/harmony/react_native_system_setting/obfuscation-rules.txt +17 -17
- package/harmony/react_native_system_setting/oh-package.json5 +10 -10
- package/harmony/react_native_system_setting/src/main/cpp/CMakeLists.txt +5 -3
- package/harmony/react_native_system_setting/src/main/cpp/SystemSettingPackage.h +36 -0
- package/harmony/react_native_system_setting/src/main/cpp/{RNSystemSettingPackage.h → generated/RNOH/generated/BaseReactNativeSystemSettingPackage.h} +65 -76
- package/harmony/react_native_system_setting/src/main/cpp/{ReactNativeSystemSetting.cpp → generated/RNOH/generated/turbo_modules/ReactNativeSystemSetting.cpp} +47 -54
- package/harmony/react_native_system_setting/src/main/cpp/{ReactNativeSystemSetting.h → generated/RNOH/generated/turbo_modules/ReactNativeSystemSetting.h} +16 -21
- package/harmony/react_native_system_setting/src/main/cpp/generated/react/renderer/components/react_native_system_setting/ComponentDescriptors.h +22 -0
- package/harmony/react_native_system_setting/src/main/cpp/generated/react/renderer/components/react_native_system_setting/EventEmitters.cpp +18 -0
- package/harmony/react_native_system_setting/src/main/cpp/generated/react/renderer/components/react_native_system_setting/EventEmitters.h +19 -0
- package/harmony/react_native_system_setting/src/main/cpp/generated/react/renderer/components/react_native_system_setting/Props.cpp +21 -0
- package/harmony/react_native_system_setting/src/main/cpp/generated/react/renderer/components/react_native_system_setting/Props.h +20 -0
- package/harmony/react_native_system_setting/src/main/cpp/generated/react/renderer/components/react_native_system_setting/ShadowNodes.cpp +19 -0
- package/harmony/react_native_system_setting/src/main/cpp/generated/react/renderer/components/react_native_system_setting/ShadowNodes.h +25 -0
- package/harmony/react_native_system_setting/src/main/cpp/generated/react/renderer/components/react_native_system_setting/States.cpp +18 -0
- package/harmony/react_native_system_setting/src/main/cpp/generated/react/renderer/components/react_native_system_setting/States.h +23 -0
- package/harmony/react_native_system_setting/src/main/ets/Logger.ts +63 -63
- package/harmony/react_native_system_setting/src/main/ets/{RNSystemSettingPackage.ts → RNSystemSettingPackage.ets} +52 -51
- package/harmony/react_native_system_setting/src/main/ets/RNSystemSettingTurboModule.ts +346 -361
- package/harmony/react_native_system_setting/src/main/ets/generated/components/ts.ts +5 -5
- package/harmony/react_native_system_setting/src/main/ets/generated/index.ets +5 -8
- package/harmony/react_native_system_setting/src/main/ets/generated/ts.ts +6 -9
- package/harmony/react_native_system_setting/src/main/ets/generated/turboModules/ReactNativeSystemSetting.ts +78 -86
- package/harmony/react_native_system_setting/src/main/ets/generated/turboModules/ts.ts +5 -8
- package/harmony/react_native_system_setting/src/main/module.json5 +9 -9
- package/harmony/react_native_system_setting/src/main/resources/base/element/string.json +8 -8
- package/harmony/react_native_system_setting/src/main/resources/en_US/element/string.json +8 -8
- package/harmony/react_native_system_setting/src/main/resources/zh_CN/element/string.json +8 -8
- package/harmony/react_native_system_setting/src/mock/mock-config.json5 +2 -0
- package/harmony/react_native_system_setting/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/harmony/react_native_system_setting/src/ohosTest/ets/test/List.test.ets +5 -0
- package/harmony/react_native_system_setting/src/ohosTest/ets/testability/TestAbility.ets +47 -0
- package/harmony/react_native_system_setting/src/ohosTest/ets/testability/pages/Index.ets +17 -0
- package/harmony/react_native_system_setting/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets +90 -0
- package/harmony/react_native_system_setting/src/ohosTest/module.json5 +36 -0
- package/harmony/react_native_system_setting/src/ohosTest/resources/base/element/color.json +8 -0
- package/harmony/react_native_system_setting/src/ohosTest/resources/base/element/string.json +16 -0
- package/harmony/react_native_system_setting/src/ohosTest/resources/base/media/icon.png +0 -0
- package/harmony/react_native_system_setting/src/ohosTest/resources/base/profile/test_pages.json +5 -0
- package/harmony/react_native_system_setting/src/test/List.test.ets +5 -0
- package/harmony/react_native_system_setting/src/test/LocalUnit.test.ets +33 -0
- package/harmony/react_native_system_setting/{ts.ts → ts.ets} +24 -24
- package/harmony/react_native_system_setting.har +0 -0
- package/iOS.md +101 -0
- package/package.json +48 -46
- package/src/ReactRNSystemSetting.ts +108 -112
- package/harmony/react_native_system_setting/BuildProfile.ets +0 -6
package/Utils.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* @flow */
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Platform
|
|
5
|
-
} from 'react-native';
|
|
6
|
-
|
|
7
|
-
export default class Utils {
|
|
8
|
-
static isAndroid = Platform.OS === 'android'
|
|
9
|
-
|
|
10
|
-
static isIOS = Platform.OS === 'ios'
|
|
11
|
-
}
|
|
1
|
+
/* @flow */
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Platform
|
|
5
|
+
} from 'react-native';
|
|
6
|
+
|
|
7
|
+
export default class Utils {
|
|
8
|
+
static isAndroid = Platform.OS === 'android'
|
|
9
|
+
|
|
10
|
+
static isIOS = Platform.OS === 'ios'
|
|
11
|
+
}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
export * from './ts';
|
|
26
|
-
export * from "./src/main/ets/RNSystemSettingPackage";
|
|
27
|
-
export * from "./src/main/ets/RNSystemSettingTurboModule";
|
|
1
|
+
/*
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import { RNSystemSettingPackage as SystemSettingPackage } from './src/main/ets/RNSystemSettingPackage'
|
|
25
|
+
export * from './ts';
|
|
26
|
+
export * from "./src/main/ets/RNSystemSettingPackage";
|
|
27
|
+
export * from "./src/main/ets/RNSystemSettingTurboModule";
|
|
28
|
+
export default SystemSettingPackage
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
"apiType": "stageMode",
|
|
3
|
-
"buildOption": {
|
|
4
|
-
},
|
|
5
|
-
"buildOptionSet": [
|
|
6
|
-
{
|
|
7
|
-
"name": "release",
|
|
8
|
-
"arkOptions": {
|
|
9
|
-
"obfuscation": {
|
|
10
|
-
"ruleOptions": {
|
|
11
|
-
"enable": true,
|
|
12
|
-
"files": [
|
|
13
|
-
"./obfuscation-rules.txt"
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
"consumerFiles": [
|
|
17
|
-
"./consumer-rules.txt"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
"targets": [
|
|
24
|
-
{
|
|
25
|
-
"name": "default"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"name": "ohosTest"
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"apiType": "stageMode",
|
|
3
|
+
"buildOption": {
|
|
4
|
+
},
|
|
5
|
+
"buildOptionSet": [
|
|
6
|
+
{
|
|
7
|
+
"name": "release",
|
|
8
|
+
"arkOptions": {
|
|
9
|
+
"obfuscation": {
|
|
10
|
+
"ruleOptions": {
|
|
11
|
+
"enable": true,
|
|
12
|
+
"files": [
|
|
13
|
+
"./obfuscation-rules.txt"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"consumerFiles": [
|
|
17
|
+
"./consumer-rules.txt"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
"targets": [
|
|
24
|
+
{
|
|
25
|
+
"name": "default"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "ohosTest"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { harTasks } from '@ohos/hvigor-ohos-plugin';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
|
|
5
|
-
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
|
|
6
|
-
}
|
|
1
|
+
import { harTasks } from '@ohos/hvigor-ohos-plugin';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
|
|
5
|
+
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
|
|
6
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
# Define project specific obfuscation rules here.
|
|
2
|
-
# You can include the obfuscation configuration files in the current module's build-profile.json5.
|
|
3
|
-
#
|
|
4
|
-
# For more details, see
|
|
5
|
-
# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
|
|
6
|
-
|
|
7
|
-
# Obfuscation options:
|
|
8
|
-
# -disable-obfuscation: disable all obfuscations
|
|
9
|
-
# -enable-property-obfuscation: obfuscate the property names
|
|
10
|
-
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
|
|
11
|
-
# -compact: remove unnecessary blank spaces and all line feeds
|
|
12
|
-
# -remove-log: remove all console.* statements
|
|
13
|
-
# -print-namecache: print the name cache that contains the mapping from the old names to new names
|
|
14
|
-
# -apply-namecache: reuse the given cache file
|
|
15
|
-
|
|
16
|
-
# Keep options:
|
|
17
|
-
# -keep-property-name: specifies property names that you want to keep
|
|
1
|
+
# Define project specific obfuscation rules here.
|
|
2
|
+
# You can include the obfuscation configuration files in the current module's build-profile.json5.
|
|
3
|
+
#
|
|
4
|
+
# For more details, see
|
|
5
|
+
# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
|
|
6
|
+
|
|
7
|
+
# Obfuscation options:
|
|
8
|
+
# -disable-obfuscation: disable all obfuscations
|
|
9
|
+
# -enable-property-obfuscation: obfuscate the property names
|
|
10
|
+
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
|
|
11
|
+
# -compact: remove unnecessary blank spaces and all line feeds
|
|
12
|
+
# -remove-log: remove all console.* statements
|
|
13
|
+
# -print-namecache: print the name cache that contains the mapping from the old names to new names
|
|
14
|
+
# -apply-namecache: reuse the given cache file
|
|
15
|
+
|
|
16
|
+
# Keep options:
|
|
17
|
+
# -keep-property-name: specifies property names that you want to keep
|
|
18
18
|
# -keep-global-name: specifies names that you want to keep in the global scope
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@react-native-ohos/react-native-system-setting",
|
|
3
|
-
"version": "1.7.7-rc.
|
|
4
|
-
"description": "Please describe the basic information.",
|
|
5
|
-
"main": "Index.ets",
|
|
6
|
-
"author": "",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"@rnoh/react-native-openharmony": 'file:../react_native_openharmony'
|
|
10
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@react-native-ohos/react-native-system-setting",
|
|
3
|
+
"version": "1.7.7-rc.3",
|
|
4
|
+
"description": "Please describe the basic information.",
|
|
5
|
+
"main": "Index.ets",
|
|
6
|
+
"author": "",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@rnoh/react-native-openharmony": 'file:../react_native_openharmony'
|
|
10
|
+
}
|
|
11
11
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 3.13)
|
|
2
2
|
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
set(rnoh_system_setting_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
|
|
5
|
+
file(GLOB_RECURSE rnoh_system_setting_generated_SRC "${rnoh_system_setting_generated_dir}/**/*.cpp")
|
|
6
|
+
file(GLOB rnoh_system_setting_SRC CONFIGURE_DEPENDS *.cpp)
|
|
7
|
+
add_library(rnoh_system_setting SHARED ${rnoh_system_setting_SRC} ${rnoh_system_setting_generated_SRC})
|
|
8
|
+
target_include_directories(rnoh_system_setting PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${rnoh_system_setting_generated_dir})
|
|
7
9
|
target_link_libraries(rnoh_system_setting PUBLIC rnoh)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
#ifndef SYSTEMSETTINGPACKAGE_H
|
|
25
|
+
#define SYSTEMSETTINGPACKAGE_H
|
|
26
|
+
|
|
27
|
+
#include "generated/RNOH/generated/BaseReactNativeSystemSettingPackage.h"
|
|
28
|
+
#pragma once
|
|
29
|
+
|
|
30
|
+
namespace rnoh {
|
|
31
|
+
class SystemSettingPackage : public BaseReactNativeSystemSettingPackage {
|
|
32
|
+
using Super = BaseReactNativeSystemSettingPackage;
|
|
33
|
+
using Super::Super;
|
|
34
|
+
};
|
|
35
|
+
} // namespace rnoh
|
|
36
|
+
#endif // SYSTEMSETTINGPACKAGE_H
|
|
@@ -1,76 +1,65 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by "react-native codegen-harmony"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
EventEmitRequestHandlers createEventEmitRequestHandlers() override {
|
|
70
|
-
return {
|
|
71
|
-
std::make_shared<RNSystemSettingEventEmitRequestHandler>(),
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
} // namespace rnoh
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
|
|
7
|
+
#include "RNOH/Package.h"
|
|
8
|
+
#include "RNOH/ArkTSTurboModule.h"
|
|
9
|
+
#include "RNOH/generated/turbo_modules/ReactNativeSystemSetting.h"
|
|
10
|
+
|
|
11
|
+
namespace rnoh {
|
|
12
|
+
|
|
13
|
+
class BaseReactNativeSystemSettingPackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
|
|
14
|
+
public:
|
|
15
|
+
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
|
16
|
+
if (name == "ReactNativeSystemSetting") {
|
|
17
|
+
return std::make_shared<ReactNativeSystemSetting>(ctx, name);
|
|
18
|
+
}
|
|
19
|
+
return nullptr;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
class BaseReactNativeSystemSettingPackageEventEmitRequestHandler : public EventEmitRequestHandler {
|
|
24
|
+
public:
|
|
25
|
+
void handleEvent(Context const &ctx) override {
|
|
26
|
+
auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
|
|
27
|
+
if (eventEmitter == nullptr) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
std::vector<std::string> supportedEventNames = {
|
|
32
|
+
};
|
|
33
|
+
if (std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
|
|
34
|
+
eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class BaseReactNativeSystemSettingPackage : public Package {
|
|
41
|
+
public:
|
|
42
|
+
BaseReactNativeSystemSettingPackage(Package::Context ctx) : Package(ctx){};
|
|
43
|
+
|
|
44
|
+
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
|
|
45
|
+
return std::make_unique<BaseReactNativeSystemSettingPackageTurboModuleFactoryDelegate>();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
|
|
49
|
+
return {
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
ComponentJSIBinderByString createComponentJSIBinderByName() override {
|
|
54
|
+
return {
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
EventEmitRequestHandlers createEventEmitRequestHandlers() override {
|
|
59
|
+
return {
|
|
60
|
+
std::make_shared<BaseReactNativeSystemSettingPackageEventEmitRequestHandler>(),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace rnoh
|
|
@@ -1,54 +1,47 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by "react-native codegen-harmony"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
ARK_ASYNC_METHOD_METADATA(
|
|
19
|
-
ARK_ASYNC_METHOD_METADATA(
|
|
20
|
-
ARK_ASYNC_METHOD_METADATA(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
ARK_METHOD_METADATA(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
ARK_METHOD_METADATA(
|
|
34
|
-
|
|
35
|
-
ARK_ASYNC_METHOD_METADATA(
|
|
36
|
-
ARK_METHOD_METADATA(
|
|
37
|
-
|
|
38
|
-
ARK_METHOD_METADATA(
|
|
39
|
-
|
|
40
|
-
ARK_ASYNC_METHOD_METADATA(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
ARK_METHOD_METADATA(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
ARK_METHOD_METADATA(removeListener, 1),
|
|
49
|
-
ARK_METHOD_METADATA(addListener, 1),
|
|
50
|
-
ARK_METHOD_METADATA(removeListeners, 1),
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
} // namespace rnoh
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#include "ReactNativeSystemSetting.h"
|
|
6
|
+
|
|
7
|
+
namespace rnoh {
|
|
8
|
+
using namespace facebook;
|
|
9
|
+
|
|
10
|
+
ReactNativeSystemSetting::ReactNativeSystemSetting(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
|
|
11
|
+
methodMap_ = {
|
|
12
|
+
ARK_ASYNC_METHOD_METADATA(getBrightness, 0),
|
|
13
|
+
ARK_ASYNC_METHOD_METADATA(setBrightness, 1),
|
|
14
|
+
ARK_ASYNC_METHOD_METADATA(setBrightnessForce, 1),
|
|
15
|
+
ARK_ASYNC_METHOD_METADATA(getAppBrightness, 0),
|
|
16
|
+
ARK_ASYNC_METHOD_METADATA(setAppBrightness, 1),
|
|
17
|
+
ARK_METHOD_METADATA(grantWriteSettingPremission, 0),
|
|
18
|
+
ARK_ASYNC_METHOD_METADATA(getScreenMode, 0),
|
|
19
|
+
ARK_ASYNC_METHOD_METADATA(setScreenMode, 1),
|
|
20
|
+
ARK_ASYNC_METHOD_METADATA(saveBrightness, 0),
|
|
21
|
+
ARK_METHOD_METADATA(restoreBrightness, 0),
|
|
22
|
+
ARK_ASYNC_METHOD_METADATA(getVolume, 1),
|
|
23
|
+
ARK_METHOD_METADATA(setVolume, 2),
|
|
24
|
+
ARK_METHOD_METADATA(addVolumeListener, 0),
|
|
25
|
+
ARK_METHOD_METADATA(removeVolumeListener, 1),
|
|
26
|
+
ARK_ASYNC_METHOD_METADATA(isWifiEnabled, 0),
|
|
27
|
+
ARK_METHOD_METADATA(switchWifiSilence, 1),
|
|
28
|
+
ARK_METHOD_METADATA(switchWifi, 1),
|
|
29
|
+
ARK_ASYNC_METHOD_METADATA(isLocationEnabled, 0),
|
|
30
|
+
ARK_ASYNC_METHOD_METADATA(getLocationMode, 0),
|
|
31
|
+
ARK_METHOD_METADATA(switchLocation, 1),
|
|
32
|
+
ARK_ASYNC_METHOD_METADATA(isBluetoothEnabled, 0),
|
|
33
|
+
ARK_METHOD_METADATA(switchBluetooth, 1),
|
|
34
|
+
ARK_METHOD_METADATA(switchBluetoothSilence, 1),
|
|
35
|
+
ARK_ASYNC_METHOD_METADATA(isAirplaneEnabled, 0),
|
|
36
|
+
ARK_METHOD_METADATA(switchAirplane, 1),
|
|
37
|
+
ARK_METHOD_METADATA(openAppSystemSettings, 0),
|
|
38
|
+
ARK_METHOD_METADATA(addBluetoothListener, 0),
|
|
39
|
+
ARK_ASYNC_METHOD_METADATA(addWifiListener, 1),
|
|
40
|
+
ARK_ASYNC_METHOD_METADATA(addLocationListener, 1),
|
|
41
|
+
ARK_ASYNC_METHOD_METADATA(addLocationModeListener, 1),
|
|
42
|
+
ARK_ASYNC_METHOD_METADATA(addAirplaneListener, 1),
|
|
43
|
+
ARK_METHOD_METADATA(removeListener, 1),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
} // namespace rnoh
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by "react-native codegen-harmony"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
public:
|
|
18
|
-
ReactNativeSystemSetting(const ArkTSTurboModule::Context ctx, const std::string name);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
} // namespace rnoh
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
|
|
7
|
+
#include "RNOH/ArkTSTurboModule.h"
|
|
8
|
+
|
|
9
|
+
namespace rnoh {
|
|
10
|
+
|
|
11
|
+
class JSI_EXPORT ReactNativeSystemSetting : public ArkTSTurboModule {
|
|
12
|
+
public:
|
|
13
|
+
ReactNativeSystemSetting(const ArkTSTurboModule::Context ctx, const std::string name);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
} // namespace rnoh
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/react_native_system_setting/ShadowNodes.h>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
|
|
16
|
+
namespace facebook {
|
|
17
|
+
namespace react {
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
} // namespace react
|
|
22
|
+
} // namespace facebook
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/react_native_system_setting/EventEmitters.h>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook {
|
|
15
|
+
namespace react {
|
|
16
|
+
|
|
17
|
+
} // namespace react
|
|
18
|
+
} // namespace facebook
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace facebook {
|
|
16
|
+
namespace react {
|
|
17
|
+
|
|
18
|
+
} // namespace react
|
|
19
|
+
} // namespace facebook
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/react_native_system_setting/Props.h>
|
|
12
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
13
|
+
#include <react/renderer/core/propsConversions.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook {
|
|
16
|
+
namespace react {
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
} // namespace react
|
|
21
|
+
} // namespace facebook
|