Updated on 2023-03-23 GMT+08:00

Updating Custom Button Configurations

UpdateCustomButtonInfo

API Description

This API is used to update the configurations related to customized buttons. The bottom toolbar and shared toolbar are supported.

Precautions

  1. Used to update the customized button configuration during a meeting.
  2. Valid only for customized buttons that have been configured in Config.

Method Definition

1
HWM_SDK_AGENT_API hwmsdk::HwmErrCode UpdateCustomButtonInfo(const HwmCustomButtonInfo *btnInfo);

Callback Function

1
virtual void OnUpdateCustomButtonInfoResult(hwmsdk::HwmErrCode ret, const char* reason) {};

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

btnInfo

Yes

HwmCustomButtonInfo

Custom button information.

Table 2 HwmCustomButtonInfo parameters

Parameter

Mandatory

Type

Description

HwmCustomButtonPos

Yes

HwmCustomButtonPos

Position of a customized button

buttonKey

Yes

char[]

Customized button ID, which must be the same as that configured in the config file.

buttonTitle

Yes

char[]

Customized button name

buttonImg

Yes

char[]

Icon path of a customized button. Use an absolute path.

Table 3 HwmCustomButtonPos parameters

Parameter

Description

CUSTOM_BUTTON_POS_TOOL_BAR

Bottom toolbar

CUSTOM_BUTTON_POS_SHARE_TOOL_BAR

Sharing toolbar

Return Values

Table 4 Return values

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.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
/**
* Update customized button configurations.
*/
int hwmSDKConfigUI::hwmSDKConfigUI()
{
    hwmsdkagent::HwmCustomButtonInfo btnInfo{};
    btnInfo.buttonPos = hwmsdkagent::CUSTOM_BUTTON_POS_TOOL_BAR;
    string buttonKey = CTools::UNICODE2UTF(CString("customMenu"));
    strcpy_s(btnInfo.buttonKey, sizeof(btnInfo.buttonKey), buttonKey.c_str());
    string buttonTitle = CTools::UNICODE2UTF(CString("update"));
    strcpy_s(btnInfo.buttonTitle, sizeof(btnInfo.buttonTitle), buttonTitle.c_str());
    string buttonIconPath = CTools::UNICODE2UTF(CString("path/to/image"));
    strcpy_s(btnInfo.buttonImg, sizeof(btnInfo.buttonImg), buttonIconPath.c_str());
     //Update the customized button configurations.
    int ret = hwmsdkagent::UpdateCustomButtonInfo(&btnInfo);
    LOG_INFO("Call hwmsdkagent::UpdateCustomButtonInfo ret is " << ret);
}