1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23#ifndef __com_sun_star_awt_XMenu_idl__ 24#define __com_sun_star_awt_XMenu_idl__ 25 26#ifndef __com_sun_star_uno_XInterface_idl__ 27#include <com/sun/star/uno/XInterface.idl> 28#endif 29 30 31//============================================================================= 32 33 module com { module sun { module star { module awt { 34 35 published interface XPopupMenu; 36 published interface XMenuListener; 37 38//============================================================================= 39 40/** specifies a simple menu. 41 */ 42published interface XMenu: com::sun::star::uno::XInterface 43{ 44 //------------------------------------------------------------------------- 45 46 /** adds the specified menu listener to receive events from this menu. 47 */ 48 [oneway] void addMenuListener( [in] XMenuListener xListener ); 49 50 //------------------------------------------------------------------------- 51 52 /** removes the specified menu listener so that it no longer 53 receives events from this menu. 54 */ 55 [oneway] void removeMenuListener( [in] XMenuListener xListener ); 56 57 //------------------------------------------------------------------------- 58 59 /** inserts an item into the menu. 60 61 <p>The item is appended if the position is greater than or equal to 62 <code>getItemCount()</code> or if it is negative.</p> 63 */ 64 [oneway] void insertItem( [in] short nItemId, 65 [in] string aText, 66 [in] short nItemStyle, 67 [in] short nPos ); 68 69 //------------------------------------------------------------------------- 70 71 /** removes one or more items from the menu. 72 */ 73 [oneway] void removeItem( [in] short nPos, 74 [in] short nCount ); 75 76 //------------------------------------------------------------------------- 77 78 /** returns the number of items in the menu. 79 */ 80 short getItemCount(); 81 82 //------------------------------------------------------------------------- 83 84 /** returns the id of the item at the specified position. 85 */ 86 short getItemId( [in] short nPos ); 87 88 //------------------------------------------------------------------------- 89 90 /** returns the position of the item with the specified id. 91 */ 92 short getItemPos( [in] short nId ); 93 94 //------------------------------------------------------------------------- 95 96 /** enables or disables the menu item. 97 */ 98 [oneway] void enableItem( [in] short nItemId, 99 [in] boolean bEnable ); 100 101 //------------------------------------------------------------------------- 102 103 /** returns the state of the menu item. 104 */ 105 boolean isItemEnabled( [in] short nItemId ); 106 107 //------------------------------------------------------------------------- 108 109 /** sets the text for the menu item. 110 */ 111 [oneway] void setItemText( [in] short nItemId, 112 [in] string aText ); 113 114 //------------------------------------------------------------------------- 115 116 /** returns the string for the given item id. 117 */ 118 string getItemText( [in] short nItemId ); 119 120 //------------------------------------------------------------------------- 121 122 /** sets the popup menu for a specified menu item. 123 */ 124 [oneway] void setPopupMenu( [in] short nItemId, 125 [in] XPopupMenu aPopupMenu ); 126 127 //------------------------------------------------------------------------- 128 129 /** returns the popup menu from the menu item. 130 */ 131 XPopupMenu getPopupMenu( [in] short nItemId ); 132 133}; 134 135 136}; }; }; }; 137 138#endif 139