summaryrefslogtreecommitdiffstats
path: root/offapi/com/sun/star/awt/XMenu.idl
blob: 08967962e88f4bf65b28f935333ecd1628ad6f3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */
#ifndef __com_sun_star_awt_XMenu_idl__
#define __com_sun_star_awt_XMenu_idl__

#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/awt/MenuItemType.idl>

module com {  module sun {  module star {  module awt {

published interface XPopupMenu;
published interface XMenuListener;

/** specifies a simple menu.
 */
published interface XMenu: com::sun::star::uno::XInterface
{
    /** adds the specified menu listener to receive events from this menu.

        @param xListener
            the XMenuListener to be added.
     */
    void addMenuListener( [in] XMenuListener xListener );

    /** removes the specified menu listener so that it no longer
        receives events from this menu.

        @param xListener
            the XMenuListener to be removed.
     */
    void removeMenuListener( [in] XMenuListener xListener );

    /** inserts an item into the menu.
        <p>The item is appended if the position is greater than or equal to
        getItemCount() or if it is negative.</p>

        @param nItemId
            specifies the ID of the menu item to be inserted.

        @param aText
            specifies the label of the menu item.

        @param nItemStyle
            specifies the style of the menu item, as defined in
            MenuItemStyle.

        @param nItemPos
            specifies the position where the menu item will be inserted.
     */
    void insertItem( [in] short nItemId,
                     [in] string aText,
                     [in] short nItemStyle,
                     [in] short nItemPos );

    /** removes one or more items from the menu.

        @param nItemPos
            specifies the position of the (first) menu item to be removed.

        @param nCount
            specifies the number of menu items to remove.
     */
    void removeItem( [in] short nItemPos,
                     [in] short nCount );

    /** removes all items from the menu.
     */
    void clear();

    /** returns the number of items in the menu.

        @return
            the number of items in this XMenu.
     */
    short getItemCount();

    /** returns the ID of the item at the specified position.

        @param nItemPos
            specifies the position of the menu item for which the item ID is queried.

        @return
            the ID of the menu item at the given position.
     */
    short getItemId( [in] short nItemPos );

    /** returns the position of the item with the specified ID.

        @param nItemId
            specifies the ID of the menu item for which the item position is queried.

        @return
            the position of the menu item with the specified ID.
     */
    short getItemPos( [in] short nItemId );

    /** retrieves the type of the menu item.

        @param nItemPos
            specifies the position of the menu item for which the item type is queried.

        @return
            a MenuItemType indicating the item type.
    */
    ::com::sun::star::awt::MenuItemType getItemType( [in] short nItemPos );

    /** enables or disables the menu item.

        @param nItemId
            specifies the menu item ID.

        @param bEnable
            specifies whether the menu item should be enabled (`TRUE`) or
            disabled (`FALSE`).
     */
    void enableItem( [in] short nItemId,
                     [in] boolean bEnable );

    /** returns the state of the menu item.

        @param nItemId
            specifies the menu item ID.

        @return
            `TRUE` if the item is enabled, `FALSE` otherwise.
     */
    boolean isItemEnabled( [in] short nItemId );

    /** specifies whether disabled menu entries should be hidden, or not.

        @param bHide
            if `TRUE`, disabled menu entries are hidden.
    */
    void hideDisabledEntries( [in] boolean bHide );

    /** specifies whether mnemonics are automatically assigned to menu items, or not.

        @param bEnable
            if `TRUE`, mnemonics are automatically assigned to menu items.
    */
    void enableAutoMnemonics( [in] boolean bEnable );

    /** sets the text for the menu item.

        @param nItemId
            specifies the ID of the menu item.

        @param aText
            specifies the label of the menu item.
     */
    void setItemText( [in] short nItemId,
                      [in] string aText );

    /** returns the string for the given item id.

        @param nItemId
            specifies the ID of the menu item.

        @return
            the label of the menu item.
     */
    string getItemText( [in] short nItemId );

    /** sets the command string for the menu item.

        @param nItemId
            specifies the menu item ID for which the command should be set.

        @param aCommand
            specifies the command for the menu item.
    */
    void setCommand( [in] short nItemId,
                     [in] string aCommand );

    /** retrieves the command string for the menu item.

        @param nItemId
            specifies the menu item ID for which the command URL should be set.

        @return
            the command of the menu item.
    */
    string getCommand( [in] short nItemId );

    /** sets the help command string for the menu item.

        @param nItemId
            specifies the menu item ID for which the help command URL be set.

        @param aCommand
            specifies the help command for the menu item.
    */
    void setHelpCommand( [in] short nItemId,
                         [in] string aCommand );

    /** retrieves the help command string for the menu item.

        @param nItemId
            specifies the menu item ID for which the help command should be set.

        @return
            the help command of the menu item.
    */
    string getHelpCommand( [in] short nItemId );

    /** sets the help text for the menu item.

        @param nItemId
            specifies the menu item identifier for which the help text should be set.

        @param sHelpText
            specifies the help text for the menu item.
    */
    void setHelpText( [in] short nItemId,
                      [in] string sHelpText );

    /** retrieves the help text for the menu item.

        @param nItemId
            specifies the menu item identifier for which the help text should be retrieved.

        @return
            a string with the help text.
    */
    string getHelpText( [in] short nItemId );

    /** sets the tip help text for the menu item.

        @param nItemId
            specifies the menu item identifier for which the tip help text should be set.

        @param sTipHelpText
            specifies the tip help text for the menu item.
    */
    void setTipHelpText( [in] short nItemId,
                         [in] string sTipHelpText );

    /** retrieves the tip help text for the menu item.

        @param nItemId
            specifies the menu item identifier for which the tip help text should be retrieved.

        @return
            a string with the tip help text.
    */
    string getTipHelpText( [in] short nItemId );

    /** checks whether an XMenu is an XPopupMenu.

        @return
                `TRUE` if the menu is a PopupMenu,
                `FALSE` if it is a MenuBar.
    */
    boolean isPopupMenu();

    /** sets the popup menu for a specified menu item.

        @param nItemId
            specifies the menu item ID for which the XPopupMenu should be set.

        @param aPopupMenu
            specifies a XPopupMenu.
     */
    void setPopupMenu( [in] short nItemId,
                       [in] XPopupMenu aPopupMenu );

    /** returns the popup menu from the menu item.

        @param nItemId
            specifies the menu item ID for which the XPopupMenu should be retrieved.

        @return
            a XPopupMenu.
     */
    XPopupMenu getPopupMenu( [in] short nItemId );

};

}; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */