xref: /aoo42x/main/offapi/com/sun/star/awt/XMenu.idl (revision cdf0e10c)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_awt_XMenu_idl__
28#define __com_sun_star_awt_XMenu_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34
35//=============================================================================
36
37 module com {  module sun {  module star {  module awt {
38
39 published interface XPopupMenu;
40 published interface XMenuListener;
41
42//=============================================================================
43
44/** specifies a simple menu.
45 */
46published interface XMenu: com::sun::star::uno::XInterface
47{
48	//-------------------------------------------------------------------------
49
50	/** adds the specified menu listener to receive events from this menu.
51	 */
52	[oneway] void addMenuListener( [in] XMenuListener xListener );
53
54	//-------------------------------------------------------------------------
55
56	/** removes the specified menu listener so that it no longer
57		receives events from this menu.
58	 */
59	[oneway] void removeMenuListener( [in] XMenuListener xListener );
60
61	//-------------------------------------------------------------------------
62
63	/** inserts an item into the menu.
64
65		<p>The item is appended if the position is greater than or equal to
66		<code>getItemCount()</code> or if it is negative.</p>
67	 */
68	[oneway] void insertItem( [in] short nItemId,
69			 [in] string aText,
70			 [in] short nItemStyle,
71			 [in] short nPos );
72
73	//-------------------------------------------------------------------------
74
75	/** removes one or more items from the menu.
76	 */
77	[oneway] void removeItem( [in] short nPos,
78			 [in] short nCount );
79
80	//-------------------------------------------------------------------------
81
82	/** returns the number of items in the menu.
83	 */
84	short getItemCount();
85
86	//-------------------------------------------------------------------------
87
88	/** returns the id of the item at the specified position.
89	 */
90	short getItemId( [in] short nPos );
91
92	//-------------------------------------------------------------------------
93
94	/** returns the position of the item with the specified id.
95	 */
96	short getItemPos( [in] short nId );
97
98	//-------------------------------------------------------------------------
99
100	/** enables or disables the menu item.
101	 */
102	[oneway] void enableItem( [in] short nItemId,
103			 [in] boolean bEnable );
104
105	//-------------------------------------------------------------------------
106
107	/** returns the state of the menu item.
108	 */
109	boolean isItemEnabled( [in] short nItemId );
110
111	//-------------------------------------------------------------------------
112
113	/** sets the text for the menu item.
114	 */
115	[oneway] void setItemText( [in] short nItemId,
116			 [in] string aText );
117
118	//-------------------------------------------------------------------------
119
120	/** returns the string for the given item id.
121	 */
122	string getItemText( [in] short nItemId );
123
124	//-------------------------------------------------------------------------
125
126	/** sets the popup menu for a specified menu item.
127	 */
128	[oneway] void setPopupMenu( [in] short nItemId,
129			 [in] XPopupMenu aPopupMenu );
130
131	//-------------------------------------------------------------------------
132
133	/** returns the popup menu from the menu item.
134	 */
135	XPopupMenu getPopupMenu( [in] short nItemId );
136
137};
138
139
140}; }; }; };
141
142#endif
143