Customizing the Text for a Specific Scenario
SetCustomUIText
API Description
This API is used to customize the text for a specific scenario.
Precautions
- This API is an asynchronous API. The return value only indicates whether the API is successfully called. The actual service processing result is returned in the corresponding callback function.
Method Definition
1
|
HWM_SDK_AGENT_API hwmsdk::HwmErrCode SetCustomUIText(const HwmCustomSceneTextInfoList* customSceneTextInfoList); |
Callback Function
1
|
virtual void OnSetCustomUITextResult(hwmsdk::HwmErrCode ret, const char* reason) {}; |
Parameter Description
Parameter |
Type |
Description |
---|---|---|
customSceneTextInfoListSize |
unsigned int |
Number of scenarios requiring text customization. |
customSceneTextInfoList |
HwmCustomSceneTextInfo* |
Custom text details. |
Parameter |
Type |
Description |
---|---|---|
scene |
HwmUICustomTextScene |
Scenario requiring text customization. |
sceneTextListSize |
unsigned int |
Number of custom text strings. |
sceneTextInfoList |
HwmUICustomTextInfo* |
List of custom text strings. |
Enumerated Value |
Description |
---|---|
CLOUD_RECORD_FINISHED_ALERT_SCENE |
Cloud recording end notification. |
CLOUD_RECORD_MENU_TITLE_TEXT_SCENE |
Cloud recording title in the recording pop-up menu. |
CLOUD_RECORD_MENU_DES_TEXT_SCENE |
Cloud recording description in the recording pop-up menu. |
MAIN_WINDOW_CLOUD_RECORD_DES_TEXT_SCENE |
Cloud recording description in the main window. |
Parameter |
Type |
Description |
---|---|---|
languageType |
HwmLanguage |
Language type. |
languageCode |
char[] |
Custom language code. |
customText |
char[] |
Custom text. |
Type |
Description |
---|---|
HwmErrCode |
If 0 is returned, the operation is successful. If other values are returned, the operation fails. For details about values returned upon failures, see Common Error Codes. |
1 2 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 |
/** * Customize the text for a specific scenario. */ void demoCustomSceneContentDlg::OnBnClickedOk() { hwmsdkagent::HwmCustomSceneTextInfo textInfo; AssembleCustomSceneTextInfo(textInfo); hwmsdkagent::HwmCustomSceneTextInfoList data{}; if (textInfo.sceneTextListSize == 0) { data.customSceneTextInfoListSize = 0; data.customSceneTextInfoList = nullptr; } else { data.customSceneTextInfoListSize = 1; // Apply for the struct memory. data.customSceneTextInfoList = new (std::nothrow)hwmsdkagent::HwmCustomSceneTextInfo[data.customSceneTextInfoListSize]; if (data.customSceneTextInfoList == nullptr) { return; } data.customSceneTextInfoList[0] = std::move(textInfo); } hwmsdk::HwmErrCode ret = hwmsdkagent::SetCustomUIText(&data); if (ret != hwmsdk::HWM_COMMON_SUCCESS) { CTools::OutputRetStr("Custom scene content error"); } // Release the struct memory. for (int i = 0; i < data.customSceneTextInfoListSize; i++) { if (data.customSceneTextInfoList[i].sceneTextList != nullptr) { delete data.customSceneTextInfoList[i].sceneTextList; data.customSceneTextInfoList[i].sceneTextList = nullptr; } } if (data.customSceneTextInfoList != nullptr) { delete data.customSceneTextInfoList; data.customSceneTextInfoList = nullptr; } } |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot