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 .
19 #ifndef __com_sun_star_awt_XMenu_idl__
20 #define __com_sun_star_awt_XMenu_idl__
22 #include
<com
/sun
/star
/uno
/XInterface.idl
>
23 #include
<com
/sun
/star
/awt
/MenuItemType.idl
>
25 module com
{ module sun
{ module star
{ module awt
{
27 published
interface XPopupMenu
;
28 published
interface XMenuListener
;
30 /** specifies a simple menu.
32 published
interface XMenu
: com
::sun
::star
::uno
::XInterface
34 /** adds the specified menu listener to receive events from this menu.
37 the XMenuListener to be added.
39 void addMenuListener
( [in] XMenuListener xListener
);
41 /** removes the specified menu listener so that it no longer
42 receives events from this menu.
45 the XMenuListener to be removed.
47 void removeMenuListener
( [in] XMenuListener xListener
);
49 /** inserts an item into the menu.
50 <p>The item is appended if the position is greater than or equal to
51 getItemCount() or if it is negative.</p>
54 specifies the ID of the menu item to be inserted.
57 specifies the label of the menu item.
60 specifies the style of the menu item, as defined in
64 specifies the position where the menu item will be inserted.
66 void insertItem
( [in] short nItemId
,
68 [in] short nItemStyle
,
69 [in] short nItemPos
);
71 /** removes one or more items from the menu.
74 specifies the position of the (first) menu item to be removed.
77 specifies the number of menu items to remove.
79 void removeItem
( [in] short nItemPos
,
82 /** removes all items from the menu.
86 /** returns the number of items in the menu.
89 the number of items in this XMenu.
93 /** returns the ID of the item at the specified position.
96 specifies the position of the menu item for which the item ID is queried.
99 the ID of the menu item at the given position.
101 short getItemId
( [in] short nItemPos
);
103 /** returns the position of the item with the specified ID.
106 specifies the ID of the menu item for which the item position is queried.
109 the position of the menu item with the specified ID.
111 short getItemPos
( [in] short nItemId
);
113 /** retrieves the type of the menu item.
116 specifies the position of the menu item for which the item type is queried.
119 a MenuItemType indicating the item type.
121 ::com
::sun
::star
::awt
::MenuItemType getItemType
( [in] short nItemPos
);
123 /** enables or disables the menu item.
126 specifies the menu item ID.
129 specifies whether the menu item should be enabled (`TRUE`) or
132 void enableItem
( [in] short nItemId
,
133 [in] boolean bEnable
);
135 /** returns the state of the menu item.
138 specifies the menu item ID.
141 `TRUE` if the item is enabled, `FALSE` otherwise.
143 boolean isItemEnabled
( [in] short nItemId
);
145 /** specifies whether disabled menu entries should be hidden, or not.
148 if `TRUE`, disabled menu entries are hidden.
150 void hideDisabledEntries
( [in] boolean bHide
);
152 /** specifies whether mnemonics are automatically assigned to menu items, or not.
155 if `TRUE`, mnemonics are automatically assigned to menu items.
157 void enableAutoMnemonics
( [in] boolean bEnable
);
159 /** sets the text for the menu item.
162 specifies the ID of the menu item.
165 specifies the label of the menu item.
167 void setItemText
( [in] short nItemId
,
170 /** returns the string for the given item id.
173 specifies the ID of the menu item.
176 the label of the menu item.
178 string getItemText
( [in] short nItemId
);
180 /** sets the command string for the menu item.
183 specifies the menu item ID for which the command should be set.
186 specifies the command for the menu item.
188 void setCommand
( [in] short nItemId
,
189 [in] string aCommand
);
191 /** retrieves the command string for the menu item.
194 specifies the menu item ID for which the command URL should be set.
197 the command of the menu item.
199 string getCommand
( [in] short nItemId
);
201 /** sets the help command string for the menu item.
204 specifies the menu item ID for which the help command URL be set.
207 specifies the help command for the menu item.
209 void setHelpCommand
( [in] short nItemId
,
210 [in] string aCommand
);
212 /** retrieves the help command string for the menu item.
215 specifies the menu item ID for which the help command should be set.
218 the help command of the menu item.
220 string getHelpCommand
( [in] short nItemId
);
222 /** sets the help text for the menu item.
225 specifies the menu item identifier for which the help text should be set.
228 specifies the help text for the menu item.
230 void setHelpText
( [in] short nItemId
,
231 [in] string sHelpText
);
233 /** retrieves the help text for the menu item.
236 specifies the menu item identifier for which the help text should be retrieved.
239 a string with the help text.
241 string getHelpText
( [in] short nItemId
);
243 /** sets the tip help text for the menu item.
246 specifies the menu item identifier for which the tip help text should be set.
249 specifies the tip help text for the menu item.
251 void setTipHelpText
( [in] short nItemId
,
252 [in] string sTipHelpText
);
254 /** retrieves the tip help text for the menu item.
257 specifies the menu item identifier for which the tip help text should be retrieved.
260 a string with the tip help text.
262 string getTipHelpText
( [in] short nItemId
);
264 /** checks whether an XMenu is an XPopupMenu.
267 `TRUE` if the menu is a PopupMenu,
268 `FALSE` if it is a MenuBar.
270 boolean isPopupMenu
();
272 /** sets the popup menu for a specified menu item.
275 specifies the menu item ID for which the XPopupMenu should be set.
278 specifies a XPopupMenu.
280 void setPopupMenu
( [in] short nItemId
,
281 [in] XPopupMenu aPopupMenu
);
283 /** returns the popup menu from the menu item.
286 specifies the menu item ID for which the XPopupMenu should be retrieved.
291 XPopupMenu getPopupMenu
( [in] short nItemId
);
299 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */