1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XPopupMenuExtended.idl,v $
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_XPopupMenuExtended_idl__
31 #define __com_sun_star_awt_XPopupMenuExtended_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_awt_XPopupMenu_idl__
38 #include
<com
/sun
/star
/awt
/XPopupMenu.idl
>
41 #ifndef __com_sun_star_awt_XMenuExtended2_idl__
42 #include
<com
/sun
/star
/awt
/XMenuExtended2.idl
>
45 #ifndef __com_sun_star_awt_MenuLogo_idl__
46 #include
<com
/sun
/star
/awt
/MenuLogo.idl
>
49 #ifndef __com_sun_star_container_NoSuchElementException_idl__
50 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
53 #ifndef __com_sun_star_awt_KeyEvent_idl__
54 #include
<com
/sun
/star
/awt
/KeyEvent.idl
>
57 #ifndef com_sun_star_graphic_XGraphic_idl
58 #include
<com
/sun
/star
/graphic
/XGraphic.idl
>
61 //=============================================================================
63 module com
{ module sun
{ module star
{ module awt
{
65 /** specifies extended functions for a <type scope="com::sun::star::awt">PopupMenu</type>.
69 interface XPopupMenuExtended
71 /** specifies basic functions for a popup menu.
73 interface ::com
::sun
::star
::awt
::XPopupMenu
;
75 /** specifies extended menu functions, available for both
76 <type scope="com::sun::star::awt">MenuBar</type> and
77 <type scope="com::sun::star::awt">PopupMenu</type>.
79 interface ::com
::sun
::star
::awt
::XMenuExtended2
;
81 //=========================================================================
83 /** queries if the <type scope="com::sun::star::awt">PopupMenu</type>
84 is being executed as a result of invoking
85 <member scope="com::sun::star::awt">XPopupMenu::execute()</member>; that is,
86 for a <type>PopupMenu</type> activated by a <type>MenuBar</type> item,
87 this methods returns <FALSE/>.
90 <TRUE/> if the <type scope="com::sun::star::awt">PopupMenu</type>
91 is being executed, <FALSE/> otherwise.
93 @see <member scope="com::sun::star::awt">XPopupMenu::execute()</member>
97 boolean isInExecute
();
99 /** ends the execution of the <type scope="com::sun::star::awt">PopupMenu</type>.
100 <member scope="com::sun::star::awt">XPopupMenu::execute()</member> will then return 0.
102 @see <member scope="com::sun::star::awt">XPopupMenu::execute()</member>
108 //=============================================================================
110 /** sets the <type>MenuLogo</type> for this <type>PopupMenu</type>.
113 the <type>MenuLogo</type>.
117 void setLogo
( [in] ::com
::sun
::star
::awt
::MenuLogo aMenuLogo
);
119 /** retrieves the <type>MenuLogo</type> for this <type>PopupMenu</type>.
122 the <type>MenuLogo</type>.
126 ::com
::sun
::star
::awt
::MenuLogo getLogo
();
129 //=========================================================================
132 /** specifies whether mnemonics are automatically assigned to menu items, or not.
135 if <TRUE/>, mnemonics are automatically assigned to menu items.
137 void enableAutoMnemonics
( [in] boolean bEnable
);
140 //=========================================================================
142 /** sets the <type>KeyEvent</type> for the menu item.
144 <p>The <type>KeyEvent</type> is <b>only</b> used as a container to transport
145 the shortcut information, this methods only draws the text corresponding to
146 this keyboard shortcut. The client code is responsible for listening to
147 keyboard events (typicaly done via <type>XUserInputInterception</type>),
148 and dispatch the respective command.</p>
151 specifies the menu item identifier for which the <type>KeyEvent</type> should be set.
154 specifies the <type>KeyEvent</type> for the menu item.
156 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
157 if there is no menu item with the identifier specified in <var>nItemId</var>.
161 void setAcceleratorKeyEvent
( [in] short nItemId
, [in] ::com
::sun
::star
::awt
::KeyEvent aKeyEvent
)
162 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
164 /** retrieves the <type>KeyEvent</type> for the menu item.
166 <p>The <type>KeyEvent</type> is <b>only</b> used as a container to transport
167 the shortcut information, so that in this case
168 <member scope="::com::sun::star::lang::">EventObject::Source</member> is <NULL/>.</p>
171 specifies the menu item identifier for which the <type>KeyEvent</type> should be retrieved.
174 the <type>KeyEvent</type> struct assigned to the requested menu item.
176 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
177 if there is no menu item with the identifier specified in <var>nItemId</var>.
181 ::com
::sun
::star
::awt
::KeyEvent getAcceleratorKeyEvent
( [in] short nItemId
)
182 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
184 //=============================================================================
186 /** sets the help text for the menu item.
189 specifies the menu item identifier for which the help text should be set.
192 specifies the help text for the menu item.
194 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
195 if there is no menu item with the identifier specified in <var>nItemId</var>.
199 void setHelpText
( [in] short nItemId
, [in] string sHelpText
)
200 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
202 /** retrieves the help text for the menu item.
205 specifies the menu item identifier for which the help text should be retrieved.
208 a string with the help text.
210 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
211 if there is no menu item with the identifier specified in <var>nItemId</var>.
215 string getHelpText
( [in] short nItemId
)
216 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
218 //=============================================================================
220 /** sets the tip help text for the menu item.
223 specifies the menu item identifier for which the tip help text should be set.
226 specifies the tip help text for the menu item.
228 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
229 if there is no menu item with the identifier specified in <var>nItemId</var>.
233 void setTipHelpText
( [in] short nItemId
, [in] string sTipHelpText
)
234 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
236 /** retrieves the tip help text for the menu item.
239 specifies the menu item identifier for which the tip help text should be retrieved.
242 a string with the tip help text.
244 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
245 if there is no menu item with the identifier specified in <var>nItemId</var>.
249 string getTipHelpText
( [in] short nItemId
)
250 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
252 //=============================================================================
254 /** sets the image for the menu item.
257 specifies the menu item identifier for which the image should be set.
260 specifies the image for the menu item.
263 if <TRUE/>, the image will be scaled to the standard size used internally by
266 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
267 if there is no menu item with the identifier specified in <var>nItemId</var>.
271 void setItemImage
( [in] short nItemId
,
272 [in] ::com
::sun
::star
::graphic
::XGraphic xGraphic
,
273 [in] boolean bScale
)
274 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
276 /** retrieves the image for the menu item.
279 specifies the menu item identifier for which the image should be retrieved.
282 a <type scope="::com::sun::star::graphic::">XGraphic</type> reference
283 to the current image for the requested menu item.
285 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
286 if there is no menu item with the identifier specified in <var>nItemId</var>.
290 ::com
::sun
::star
::graphic
::XGraphic getItemImage
( [in] short nItemId
)
291 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
293 //.............................................................................
296 /** sets the rotation angle of a menu item image.
299 specifies the menu item identifier for which the image angle should be set.
302 specifies the rotation angle for the menu item image.
304 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
305 if there is no menu item with the identifier specified in <var>nItemId</var>.
309 void setItemImageAngle
( [in] short nItemId
, [in] long nAngle
)
310 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
312 /** retrieves the rotation angle of a menu item image.
315 specifies the menu item identifier for which the rotation angle should be retrieved.
317 @return the rotation angle of the menu item image, or 0 if it has no rotation.
319 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
320 if there is no menu item with the identifier specified in <var>nItemId</var>.
324 long getItemImageAngle
( [in] short nItemId
)
325 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
327 //.............................................................................
329 /** sets the mirror mode of a menu item image.
332 specifies the menu item identifier for which the mirror mode should be set.
335 if <TRUE/>, the item image is mirrored.
337 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
338 if there is no menu item with the identifier specified in <var>nItemId</var>.
342 void setItemImageMirrorMode
( [in] short nItemId
, [in] boolean bMirror
)
343 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);
345 /** indicates whether the menu item image is mirrored.
348 specifies the menu item identifier for which the image mirror mode should be checked.
350 @return <TRUE/> if the item image is mirrored, <FALSE/> otherwise.
352 @throws <type scope="com::sun::star::container">NoSuchElementException</type>
353 if there is no menu item with the identifier specified in <var>nItemId</var>.
357 boolean isItemImageInMirrorMode
( [in] short nItemId
)
358 raises
( ::com
::sun
::star
::container
::NoSuchElementException
);