Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / awt / XMenu.idl
blob08967962e88f4bf65b28f935333ecd1628ad6f3e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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.
36 @param xListener
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.
44 @param xListener
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>
53 @param nItemId
54 specifies the ID of the menu item to be inserted.
56 @param aText
57 specifies the label of the menu item.
59 @param nItemStyle
60 specifies the style of the menu item, as defined in
61 MenuItemStyle.
63 @param nItemPos
64 specifies the position where the menu item will be inserted.
66 void insertItem( [in] short nItemId,
67 [in] string aText,
68 [in] short nItemStyle,
69 [in] short nItemPos );
71 /** removes one or more items from the menu.
73 @param nItemPos
74 specifies the position of the (first) menu item to be removed.
76 @param nCount
77 specifies the number of menu items to remove.
79 void removeItem( [in] short nItemPos,
80 [in] short nCount );
82 /** removes all items from the menu.
84 void clear();
86 /** returns the number of items in the menu.
88 @return
89 the number of items in this XMenu.
91 short getItemCount();
93 /** returns the ID of the item at the specified position.
95 @param nItemPos
96 specifies the position of the menu item for which the item ID is queried.
98 @return
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.
105 @param nItemId
106 specifies the ID of the menu item for which the item position is queried.
108 @return
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.
115 @param nItemPos
116 specifies the position of the menu item for which the item type is queried.
118 @return
119 a MenuItemType indicating the item type.
121 ::com::sun::star::awt::MenuItemType getItemType( [in] short nItemPos );
123 /** enables or disables the menu item.
125 @param nItemId
126 specifies the menu item ID.
128 @param bEnable
129 specifies whether the menu item should be enabled (`TRUE`) or
130 disabled (`FALSE`).
132 void enableItem( [in] short nItemId,
133 [in] boolean bEnable );
135 /** returns the state of the menu item.
137 @param nItemId
138 specifies the menu item ID.
140 @return
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.
147 @param bHide
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.
154 @param bEnable
155 if `TRUE`, mnemonics are automatically assigned to menu items.
157 void enableAutoMnemonics( [in] boolean bEnable );
159 /** sets the text for the menu item.
161 @param nItemId
162 specifies the ID of the menu item.
164 @param aText
165 specifies the label of the menu item.
167 void setItemText( [in] short nItemId,
168 [in] string aText );
170 /** returns the string for the given item id.
172 @param nItemId
173 specifies the ID of the menu item.
175 @return
176 the label of the menu item.
178 string getItemText( [in] short nItemId );
180 /** sets the command string for the menu item.
182 @param nItemId
183 specifies the menu item ID for which the command should be set.
185 @param aCommand
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.
193 @param nItemId
194 specifies the menu item ID for which the command URL should be set.
196 @return
197 the command of the menu item.
199 string getCommand( [in] short nItemId );
201 /** sets the help command string for the menu item.
203 @param nItemId
204 specifies the menu item ID for which the help command URL be set.
206 @param aCommand
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.
214 @param nItemId
215 specifies the menu item ID for which the help command should be set.
217 @return
218 the help command of the menu item.
220 string getHelpCommand( [in] short nItemId );
222 /** sets the help text for the menu item.
224 @param nItemId
225 specifies the menu item identifier for which the help text should be set.
227 @param sHelpText
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.
235 @param nItemId
236 specifies the menu item identifier for which the help text should be retrieved.
238 @return
239 a string with the help text.
241 string getHelpText( [in] short nItemId );
243 /** sets the tip help text for the menu item.
245 @param nItemId
246 specifies the menu item identifier for which the tip help text should be set.
248 @param sTipHelpText
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.
256 @param nItemId
257 specifies the menu item identifier for which the tip help text should be retrieved.
259 @return
260 a string with the tip help text.
262 string getTipHelpText( [in] short nItemId );
264 /** checks whether an XMenu is an XPopupMenu.
266 @return
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.
274 @param nItemId
275 specifies the menu item ID for which the XPopupMenu should be set.
277 @param aPopupMenu
278 specifies a XPopupMenu.
280 void setPopupMenu( [in] short nItemId,
281 [in] XPopupMenu aPopupMenu );
283 /** returns the popup menu from the menu item.
285 @param nItemId
286 specifies the menu item ID for which the XPopupMenu should be retrieved.
288 @return
289 a XPopupMenu.
291 XPopupMenu getPopupMenu( [in] short nItemId );
295 }; }; }; };
297 #endif
299 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */