1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 module com
{ module sun
{ module star
{ module awt
{
22 published
interface XPopupMenu
;
23 published
interface XMenuListener
;
25 /** specifies a simple menu.
27 published
interface XMenu
: com
::sun
::star
::uno
::XInterface
29 /** adds the specified menu listener to receive events from this menu.
32 the XMenuListener to be added.
34 void addMenuListener
( [in] XMenuListener xListener
);
36 /** removes the specified menu listener so that it no longer
37 receives events from this menu.
40 the XMenuListener to be removed.
42 void removeMenuListener
( [in] XMenuListener xListener
);
44 /** inserts an item into the menu.
45 <p>The item is appended if the position is greater than or equal to
46 getItemCount() or if it is negative.</p>
49 specifies the ID of the menu item to be inserted.
52 specifies the label of the menu item.
55 specifies the style of the menu item, as defined in
59 specifies the position where the menu item will be inserted.
61 void insertItem
( [in] short nItemId
,
63 [in] short nItemStyle
,
64 [in] short nItemPos
);
66 /** removes one or more items from the menu.
69 specifies the position of the (first) menu item to be removed.
72 specifies the number of menu items to remove.
74 void removeItem
( [in] short nItemPos
,
77 /** removes all items from the menu.
81 /** returns the number of items in the menu.
84 the number of items in this XMenu.
88 /** returns the ID of the item at the specified position.
91 specifies the position of the menu item for which the item ID is queried.
94 the ID of the menu item at the given position.
96 short getItemId
( [in] short nItemPos
);
98 /** returns the position of the item with the specified ID.
101 specifies the ID of the menu item for which the item position is queried.
104 the position of the menu item with the specified ID.
106 short getItemPos
( [in] short nItemId
);
108 /** retrieves the type of the menu item.
111 specifies the position of the menu item for which the item type is queried.
114 a MenuItemType indicating the item type.
116 ::com
::sun
::star
::awt
::MenuItemType getItemType
( [in] short nItemPos
);
118 /** enables or disables the menu item.
121 specifies the menu item ID.
124 specifies whether the menu item should be enabled (`TRUE`) or
127 void enableItem
( [in] short nItemId
,
128 [in] boolean bEnable
);
130 /** returns the state of the menu item.
133 specifies the menu item ID.
136 `TRUE` if the item is enabled, `FALSE` otherwise.
138 boolean isItemEnabled
( [in] short nItemId
);
140 /** specifies whether disabled menu entries should be hidden, or not.
143 if `TRUE`, disabled menu entries are hidden.
145 void hideDisabledEntries
( [in] boolean bHide
);
147 /** specifies whether mnemonics are automatically assigned to menu items, or not.
150 if `TRUE`, mnemonics are automatically assigned to menu items.
152 void enableAutoMnemonics
( [in] boolean bEnable
);
154 /** sets the text for the menu item.
157 specifies the ID of the menu item.
160 specifies the label of the menu item.
162 void setItemText
( [in] short nItemId
,
165 /** returns the string for the given item id.
168 specifies the ID of the menu item.
171 the label of the menu item.
173 string getItemText
( [in] short nItemId
);
175 /** sets the command string for the menu item.
178 specifies the menu item ID for which the command should be set.
181 specifies the command for the menu item.
183 void setCommand
( [in] short nItemId
,
184 [in] string aCommand
);
186 /** retrieves the command string for the menu item.
189 specifies the menu item ID for which the command URL should be set.
192 the command of the menu item.
194 string getCommand
( [in] short nItemId
);
196 /** sets the help command string for the menu item.
199 specifies the menu item ID for which the help command URL be set.
202 specifies the help command for the menu item.
204 void setHelpCommand
( [in] short nItemId
,
205 [in] string aCommand
);
207 /** retrieves the help command string for the menu item.
210 specifies the menu item ID for which the help command should be set.
213 the help command of the menu item.
215 string getHelpCommand
( [in] short nItemId
);
217 /** sets the help text for the menu item.
220 specifies the menu item identifier for which the help text should be set.
223 specifies the help text for the menu item.
225 void setHelpText
( [in] short nItemId
,
226 [in] string sHelpText
);
228 /** retrieves the help text for the menu item.
231 specifies the menu item identifier for which the help text should be retrieved.
234 a string with the help text.
236 string getHelpText
( [in] short nItemId
);
238 /** sets the tip help text for the menu item.
241 specifies the menu item identifier for which the tip help text should be set.
244 specifies the tip help text for the menu item.
246 void setTipHelpText
( [in] short nItemId
,
247 [in] string sTipHelpText
);
249 /** retrieves the tip help text for the menu item.
252 specifies the menu item identifier for which the tip help text should be retrieved.
255 a string with the tip help text.
257 string getTipHelpText
( [in] short nItemId
);
259 /** checks whether an XMenu is an XPopupMenu.
262 `TRUE` if the menu is a PopupMenu,
263 `FALSE` if it is a MenuBar.
265 boolean isPopupMenu
();
267 /** sets the popup menu for a specified menu item.
270 specifies the menu item ID for which the XPopupMenu should be set.
273 specifies a XPopupMenu.
275 void setPopupMenu
( [in] short nItemId
,
276 [in] XPopupMenu aPopupMenu
);
278 /** returns the popup menu from the menu item.
281 specifies the menu item ID for which the XPopupMenu should be retrieved.
286 XPopupMenu getPopupMenu
( [in] short nItemId
);
292 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */