tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / offapi / com / sun / star / awt / XMenu.idl
blob1d5958f4a241e9ffa7f7000327ea418070992311
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 .
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.
31 @param xListener
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.
39 @param xListener
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>
48 @param nItemId
49 specifies the ID of the menu item to be inserted.
51 @param aText
52 specifies the label of the menu item.
54 @param nItemStyle
55 specifies the style of the menu item, as defined in
56 MenuItemStyle.
58 @param nItemPos
59 specifies the position where the menu item will be inserted.
61 void insertItem( [in] short nItemId,
62 [in] string aText,
63 [in] short nItemStyle,
64 [in] short nItemPos );
66 /** removes one or more items from the menu.
68 @param nItemPos
69 specifies the position of the (first) menu item to be removed.
71 @param nCount
72 specifies the number of menu items to remove.
74 void removeItem( [in] short nItemPos,
75 [in] short nCount );
77 /** removes all items from the menu.
79 void clear();
81 /** returns the number of items in the menu.
83 @return
84 the number of items in this XMenu.
86 short getItemCount();
88 /** returns the ID of the item at the specified position.
90 @param nItemPos
91 specifies the position of the menu item for which the item ID is queried.
93 @return
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.
100 @param nItemId
101 specifies the ID of the menu item for which the item position is queried.
103 @return
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.
110 @param nItemPos
111 specifies the position of the menu item for which the item type is queried.
113 @return
114 a MenuItemType indicating the item type.
116 ::com::sun::star::awt::MenuItemType getItemType( [in] short nItemPos );
118 /** enables or disables the menu item.
120 @param nItemId
121 specifies the menu item ID.
123 @param bEnable
124 specifies whether the menu item should be enabled (`TRUE`) or
125 disabled (`FALSE`).
127 void enableItem( [in] short nItemId,
128 [in] boolean bEnable );
130 /** returns the state of the menu item.
132 @param nItemId
133 specifies the menu item ID.
135 @return
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.
142 @param bHide
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.
149 @param bEnable
150 if `TRUE`, mnemonics are automatically assigned to menu items.
152 void enableAutoMnemonics( [in] boolean bEnable );
154 /** sets the text for the menu item.
156 @param nItemId
157 specifies the ID of the menu item.
159 @param aText
160 specifies the label of the menu item.
162 void setItemText( [in] short nItemId,
163 [in] string aText );
165 /** returns the string for the given item id.
167 @param nItemId
168 specifies the ID of the menu item.
170 @return
171 the label of the menu item.
173 string getItemText( [in] short nItemId );
175 /** sets the command string for the menu item.
177 @param nItemId
178 specifies the menu item ID for which the command should be set.
180 @param aCommand
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.
188 @param nItemId
189 specifies the menu item ID for which the command URL should be set.
191 @return
192 the command of the menu item.
194 string getCommand( [in] short nItemId );
196 /** sets the help command string for the menu item.
198 @param nItemId
199 specifies the menu item ID for which the help command URL be set.
201 @param aCommand
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.
209 @param nItemId
210 specifies the menu item ID for which the help command should be set.
212 @return
213 the help command of the menu item.
215 string getHelpCommand( [in] short nItemId );
217 /** sets the help text for the menu item.
219 @param nItemId
220 specifies the menu item identifier for which the help text should be set.
222 @param sHelpText
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.
230 @param nItemId
231 specifies the menu item identifier for which the help text should be retrieved.
233 @return
234 a string with the help text.
236 string getHelpText( [in] short nItemId );
238 /** sets the tip help text for the menu item.
240 @param nItemId
241 specifies the menu item identifier for which the tip help text should be set.
243 @param sTipHelpText
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.
251 @param nItemId
252 specifies the menu item identifier for which the tip help text should be retrieved.
254 @return
255 a string with the tip help text.
257 string getTipHelpText( [in] short nItemId );
259 /** checks whether an XMenu is an XPopupMenu.
261 @return
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.
269 @param nItemId
270 specifies the menu item ID for which the XPopupMenu should be set.
272 @param aPopupMenu
273 specifies a XPopupMenu.
275 void setPopupMenu( [in] short nItemId,
276 [in] XPopupMenu aPopupMenu );
278 /** returns the popup menu from the menu item.
280 @param nItemId
281 specifies the menu item ID for which the XPopupMenu should be retrieved.
283 @return
284 a XPopupMenu.
286 XPopupMenu getPopupMenu( [in] short nItemId );
290 }; }; }; };
292 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */