LibreOffice: XMenu Interface Reference

LibreOffice LibreOffice 25.2 SDK API Reference |

Loading...
Searching...
No Matches
Public Member Functions | List of all members
XMenu Interface Referencepublished

specifies a simple menu. More...

`import "XMenu.idl";`

Inheritance diagram for XMenu:

## Public Member Functions
void | addMenuListener ([in] XMenuListener xListener)
| adds the specified menu listener to receive events from this menu.
void | removeMenuListener ([in] XMenuListener xListener)
| removes the specified menu listener so that it no longer receives events from this menu.
void | insertItem ([in] short nItemId, [in] string aText, [in] short nItemStyle, [in] short nItemPos)
| inserts an item into the menu.
void | removeItem ([in] short nItemPos, [in] short nCount)
| removes one or more items from the menu.
void | clear ()
| removes all items from the menu.
short | getItemCount ()
| returns the number of items in the menu.
short | getItemId ([in] short nItemPos)
| returns the ID of the item at the specified position.
short | getItemPos ([in] short nItemId)
| returns the position of the item with the specified ID.
::com::sun::star::awt::MenuItemType | getItemType ([in] short nItemPos)
| retrieves the type of the menu item.
void | enableItem ([in] short nItemId, [in] boolean bEnable)
| enables or disables the menu item.
boolean | isItemEnabled ([in] short nItemId)
| returns the state of the menu item.
void | hideDisabledEntries ([in] boolean bHide)
| specifies whether disabled menu entries should be hidden, or not.
void | enableAutoMnemonics ([in] boolean bEnable)
| specifies whether mnemonics are automatically assigned to menu items, or not.
void | setItemText ([in] short nItemId, [in] string aText)
| sets the text for the menu item.
string | getItemText ([in] short nItemId)
| returns the string for the given item id.
void | setCommand ([in] short nItemId, [in] string aCommand)
| sets the command string for the menu item.
string | getCommand ([in] short nItemId)
| retrieves the command string for the menu item.
void | setHelpCommand ([in] short nItemId, [in] string aCommand)
| sets the help command string for the menu item.
string | getHelpCommand ([in] short nItemId)
| retrieves the help command string for the menu item.
void | setHelpText ([in] short nItemId, [in] string sHelpText)
| sets the help text for the menu item.
string | getHelpText ([in] short nItemId)
| retrieves the help text for the menu item.
void | setTipHelpText ([in] short nItemId, [in] string sTipHelpText)
| sets the tip help text for the menu item.
string | getTipHelpText ([in] short nItemId)
| retrieves the tip help text for the menu item.
boolean | isPopupMenu ()
| checks whether an XMenu is an XPopupMenu.
void | setPopupMenu ([in] short nItemId, [in] XPopupMenu aPopupMenu)
| sets the popup menu for a specified menu item.
XPopupMenu | getPopupMenu ([in] short nItemId)
| returns the popup menu from the menu item.
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.

## Detailed Description

specifies a simple menu.

## Member Function Documentation

## ◆ addMenuListener()

void addMenuListener | ( | [in] XMenuListener | xListener | ) |

adds the specified menu listener to receive events from this menu.

Parameters

  xListener | the XMenuListener to be added.

## ◆ clear()

void clear | ( |  | ) |

removes all items from the menu.

## ◆ enableAutoMnemonics()

void enableAutoMnemonics | ( | [in] boolean | bEnable | ) |

specifies whether mnemonics are automatically assigned to menu items, or not.

Parameters

  bEnable | if `TRUE`, mnemonics are automatically assigned to menu items.

## ◆ enableItem()

void enableItem | ( | [in] short | nItemId,
|  | [in] boolean | bEnable )

enables or disables the menu item.

Parameters

  nItemId | specifies the menu item ID.
  bEnable | specifies whether the menu item should be enabled (`TRUE`) or disabled (`FALSE`).

## ◆ getCommand()

string getCommand | ( | [in] short | nItemId | ) |

retrieves the command string for the menu item.

Parameters

  nItemId | specifies the menu item ID for which the command URL should be set.

Returns
  the command of the menu item.

## ◆ getHelpCommand()

string getHelpCommand | ( | [in] short | nItemId | ) |

retrieves the help command string for the menu item.

Parameters

  nItemId | specifies the menu item ID for which the help command should be set.

Returns
  the help command of the menu item.

## ◆ getHelpText()

string getHelpText | ( | [in] short | nItemId | ) |

retrieves the help text for the menu item.

Parameters

  nItemId | specifies the menu item identifier for which the help text should be retrieved.

Returns
  a string with the help text.

## ◆ getItemCount()

short getItemCount | ( |  | ) |

returns the number of items in the menu.

Returns
  the number of items in this XMenu.

## ◆ getItemId()

short getItemId | ( | [in] short | nItemPos | ) |

returns the ID of the item at the specified position.

Parameters

  nItemPos | specifies the position of the menu item for which the item ID is queried.

Returns
  the ID of the menu item at the given position.

## ◆ getItemPos()

short getItemPos | ( | [in] short | nItemId | ) |

returns the position of the item with the specified ID.

Parameters

  nItemId | specifies the ID of the menu item for which the item position is queried.

Returns
  the position of the menu item with the specified ID.

## ◆ getItemText()

string getItemText | ( | [in] short | nItemId | ) |

returns the string for the given item id.

Parameters

  nItemId | specifies the ID of the menu item.

Returns
  the label of the menu item.

## ◆ getItemType()

::com::sun::star::awt::MenuItemType getItemType | ( | [in] short | nItemPos | ) |

retrieves the type of the menu item.

Parameters

  nItemPos | specifies the position of the menu item for which the item type is queried.

Returns
  a MenuItemType indicating the item type.

## ◆ getPopupMenu()

XPopupMenu getPopupMenu | ( | [in] short | nItemId | ) |

returns the popup menu from the menu item.

Parameters

  nItemId | specifies the menu item ID for which the XPopupMenu should be retrieved.

Returns
  a XPopupMenu.

## ◆ getTipHelpText()

string getTipHelpText | ( | [in] short | nItemId | ) |

retrieves the tip help text for the menu item.

Parameters

  nItemId | specifies the menu item identifier for which the tip help text should be retrieved.

Returns
  a string with the tip help text.

## ◆ hideDisabledEntries()

void hideDisabledEntries | ( | [in] boolean | bHide | ) |

specifies whether disabled menu entries should be hidden, or not.

Parameters

  bHide | if `TRUE`, disabled menu entries are hidden.

## ◆ insertItem()

void insertItem | ( | [in] short | nItemId,
|  | [in] string | aText,
|  | [in] short | nItemStyle,
|  | [in] short | nItemPos )

inserts an item into the menu.

The item is appended if the position is greater than or equal to getItemCount() or if it is negative.

Parameters

  nItemId | specifies the ID of the menu item to be inserted.
  aText | specifies the label of the menu item.
  nItemStyle | specifies the style of the menu item, as defined in MenuItemStyle.
  nItemPos | specifies the position where the menu item will be inserted.

## ◆ isItemEnabled()

boolean isItemEnabled | ( | [in] short | nItemId | ) |

returns the state of the menu item.

Parameters

  nItemId | specifies the menu item ID.

Returns
  `TRUE` if the item is enabled, `FALSE` otherwise.

## ◆ isPopupMenu()

boolean isPopupMenu | ( |  | ) |

checks whether an XMenu is an XPopupMenu.

Returns
  `TRUE` if the menu is a PopupMenu, `FALSE` if it is a MenuBar.

## ◆ removeItem()

void removeItem | ( | [in] short | nItemPos,
|  | [in] short | nCount )

removes one or more items from the menu.

Parameters

  nItemPos | specifies the position of the (first) menu item to be removed.
  nCount | specifies the number of menu items to remove.

## ◆ removeMenuListener()

void removeMenuListener | ( | [in] XMenuListener | xListener | ) |

removes the specified menu listener so that it no longer receives events from this menu.

Parameters

  xListener | the XMenuListener to be removed.

## ◆ setCommand()

void setCommand | ( | [in] short | nItemId,
|  | [in] string | aCommand )

sets the command string for the menu item.

Parameters

  nItemId | specifies the menu item ID for which the command should be set.
  aCommand | specifies the command for the menu item.

## ◆ setHelpCommand()

void setHelpCommand | ( | [in] short | nItemId,
|  | [in] string | aCommand )

sets the help command string for the menu item.

Parameters

  nItemId | specifies the menu item ID for which the help command URL be set.
  aCommand | specifies the help command for the menu item.

## ◆ setHelpText()

void setHelpText | ( | [in] short | nItemId,
|  | [in] string | sHelpText )

sets the help text for the menu item.

Parameters

  nItemId | specifies the menu item identifier for which the help text should be set.
  sHelpText | specifies the help text for the menu item.

## ◆ setItemText()

void setItemText | ( | [in] short | nItemId,
|  | [in] string | aText )

sets the text for the menu item.

Parameters

  nItemId | specifies the ID of the menu item.
  aText | specifies the label of the menu item.

## ◆ setPopupMenu()

void setPopupMenu | ( | [in] short | nItemId,
|  | [in] XPopupMenu | aPopupMenu )

sets the popup menu for a specified menu item.

Parameters

  nItemId | specifies the menu item ID for which the XPopupMenu should be set.
  aPopupMenu | specifies a XPopupMenu.

## ◆ setTipHelpText()

void setTipHelpText | ( | [in] short | nItemId,
|  | [in] string | sTipHelpText )

sets the tip help text for the menu item.

Parameters

  nItemId | specifies the menu item identifier for which the tip help text should be set.
  sTipHelpText | specifies the tip help text for the menu item.

The documentation for this interface was generated from the following file:

- com/sun/star/awt/XMenu.idl