1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef __com_sun_star_awt_XMenu_idl__
29 #define __com_sun_star_awt_XMenu_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
34 //=============================================================================
36 module com
{ module sun
{ module star
{ module awt
{
38 published
interface XPopupMenu
;
39 published
interface XMenuListener
;
41 //=============================================================================
43 /** specifies a simple menu.
45 published
interface XMenu
: com
::sun
::star
::uno
::XInterface
47 //-------------------------------------------------------------------------
49 /** adds the specified menu listener to receive events from this menu.
51 [oneway
] void addMenuListener
( [in] XMenuListener xListener
);
53 //-------------------------------------------------------------------------
55 /** removes the specified menu listener so that it no longer
56 receives events from this menu.
58 [oneway
] void removeMenuListener
( [in] XMenuListener xListener
);
60 //-------------------------------------------------------------------------
62 /** inserts an item into the menu.
64 <p>The item is appended if the position is greater than or equal to
65 <code>getItemCount()</code> or if it is negative.</p>
67 [oneway
] void insertItem
( [in] short nItemId
,
69 [in] short nItemStyle
,
72 //-------------------------------------------------------------------------
74 /** removes one or more items from the menu.
76 [oneway
] void removeItem
( [in] short nPos
,
79 //-------------------------------------------------------------------------
81 /** returns the number of items in the menu.
85 //-------------------------------------------------------------------------
87 /** returns the id of the item at the specified position.
89 short getItemId
( [in] short nPos
);
91 //-------------------------------------------------------------------------
93 /** returns the position of the item with the specified id.
95 short getItemPos
( [in] short nId
);
97 //-------------------------------------------------------------------------
99 /** enables or disables the menu item.
101 [oneway
] void enableItem
( [in] short nItemId
,
102 [in] boolean bEnable
);
104 //-------------------------------------------------------------------------
106 /** returns the state of the menu item.
108 boolean isItemEnabled
( [in] short nItemId
);
110 //-------------------------------------------------------------------------
112 /** sets the text for the menu item.
114 [oneway
] void setItemText
( [in] short nItemId
,
117 //-------------------------------------------------------------------------
119 /** returns the string for the given item id.
121 string getItemText
( [in] short nItemId
);
123 //-------------------------------------------------------------------------
125 /** sets the pop-up menu for a specified menu item.
127 [oneway
] void setPopupMenu
( [in] short nItemId
,
128 [in] XPopupMenu aPopupMenu
);
130 //-------------------------------------------------------------------------
132 /** returns the pop-up menu from the menu item.
134 XPopupMenu getPopupMenu
( [in] short nItemId
);
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */