merge the formfield patch from ooo-build
[ooovba.git] / offapi / com / sun / star / awt / XMenu.idl
blob6254818e1a6a65a272b25ffc2e2b96e44a2aa048
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XMenu.idl,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_awt_XMenu_idl__
31 #define __com_sun_star_awt_XMenu_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include <com/sun/star/uno/XInterface.idl>
35 #endif
38 //=============================================================================
40 module com { module sun { module star { module awt {
42 published interface XPopupMenu;
43 published interface XMenuListener;
45 //=============================================================================
47 /** specifies a simple menu.
49 published interface XMenu: com::sun::star::uno::XInterface
51 //-------------------------------------------------------------------------
53 /** adds the specified menu listener to receive events from this menu.
55 [oneway] void addMenuListener( [in] XMenuListener xListener );
57 //-------------------------------------------------------------------------
59 /** removes the specified menu listener so that it no longer
60 receives events from this menu.
62 [oneway] void removeMenuListener( [in] XMenuListener xListener );
64 //-------------------------------------------------------------------------
66 /** inserts an item into the menu.
68 <p>The item is appended if the position is greater than or equal to
69 <code>getItemCount()</code> or if it is negative.</p>
71 [oneway] void insertItem( [in] short nItemId,
72 [in] string aText,
73 [in] short nItemStyle,
74 [in] short nPos );
76 //-------------------------------------------------------------------------
78 /** removes one or more items from the menu.
80 [oneway] void removeItem( [in] short nPos,
81 [in] short nCount );
83 //-------------------------------------------------------------------------
85 /** returns the number of items in the menu.
87 short getItemCount();
89 //-------------------------------------------------------------------------
91 /** returns the id of the item at the specified position.
93 short getItemId( [in] short nPos );
95 //-------------------------------------------------------------------------
97 /** returns the position of the item with the specified id.
99 short getItemPos( [in] short nId );
101 //-------------------------------------------------------------------------
103 /** enables or disables the menu item.
105 [oneway] void enableItem( [in] short nItemId,
106 [in] boolean bEnable );
108 //-------------------------------------------------------------------------
110 /** returns the state of the menu item.
112 boolean isItemEnabled( [in] short nItemId );
114 //-------------------------------------------------------------------------
116 /** sets the text for the menu item.
118 [oneway] void setItemText( [in] short nItemId,
119 [in] string aText );
121 //-------------------------------------------------------------------------
123 /** returns the string for the given item id.
125 string getItemText( [in] short nItemId );
127 //-------------------------------------------------------------------------
129 /** sets the popup menu for a specified menu item.
131 [oneway] void setPopupMenu( [in] short nItemId,
132 [in] XPopupMenu aPopupMenu );
134 //-------------------------------------------------------------------------
136 /** returns the popup menu from the menu item.
138 XPopupMenu getPopupMenu( [in] short nItemId );
143 }; }; }; };
145 #endif