@ohos.selectionInput.SelectionPanel (Word Selection Panel)

This module provides the properties and types of the word selection panel.

NOTE

  • The initial APIs of this module are supported since API version 24. Newly added APIs will be marked with a superscript to indicate their earliest API version.
  • This module is supported only on PCs/2-in-1 devices.

Modules to Import

import { PanelInfo, PanelType } from '@kit.BasicServicesKit';

PanelInfo

Describes the properties of the word selection panel.

System capability: SystemCapability.SelectionInput.Selection

Model constraint: This API can be used only in the stage model.

Name Type Read-Only Optional Description
panelType PanelType No No Type of the word selection panel.
x number No No X-coordinate of the upper left corner of the word selection panel, in px.
y number No No Y-coordinate of the upper left corner of the word selection panel, in px.
width number No No Width of the word selection panel, in px.
height number No No Height of the word selection panel, in px.

PanelType

Enumerates the word selection panel types.

System capability: SystemCapability.SelectionInput.Selection

Model constraint: This API can be used only in the stage model.

Name Value Description
MENU_PANEL 1 The menu panel can serve as a primary panel to display the functions that the current application can provide, such as translation and search.
MAIN_PANEL 2 The main panel can serve as a secondary panel that pops up when the user clicks on the function buttons on the menu panel, displaying specific translation or search results.