summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KPopupMenu.java
blob: c3fff51a85625f77939b4dd6da41b1b1504806d8 (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
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QHideEvent;
import org.kde.qt.QMetaObject;
import org.kde.qt.QtSupport;
import org.kde.qt.QCloseEvent;
import org.kde.qt.QPopupMenu;
import org.kde.qt.QPixmap;
import org.kde.qt.QPoint;
import org.kde.qt.QContextMenuEvent;
import org.kde.qt.QMouseEvent;
import org.kde.qt.QKeyEvent;
import org.kde.qt.QWidget;
import org.kde.qt.QPopupMenu;

/**

 KPopupMenu is a class for menus with standard title items and keyboard
 accessibility for popups with many options and/or varying options. It acts
 identically to QPopupMenu, with the addition of insertTitle(),
 changeTitle(), setKeyboardShortcutsEnabled() and
 setKeyboardShortcutsExecute() methods.
 The titles support a text string, an icon, plus user defined gradients,
 colors, and background pixmaps.
 The keyboard search algorithm is incremental with additional underlining
 for user feedback.
 See {@link KPopupMenuSignals} for signals emitted by KPopupMenu
		@author Hamish Rodda <rodda@kde.org>
 
		@short A menu with title items.

*/
public class KPopupMenu extends QPopupMenu  {
	protected KPopupMenu(Class dummy){super((Class) null);}
	public native QMetaObject metaObject();
	public native String className();
	/**	
		 Constructs a KPopupMenu.
		     		@short    Constructs a KPopupMenu.
	*/
	public KPopupMenu(QWidget parent, String name) {
		super((Class) null);
		newKPopupMenu(parent,name);
	}
	private native void newKPopupMenu(QWidget parent, String name);
	public KPopupMenu(QWidget parent) {
		super((Class) null);
		newKPopupMenu(parent);
	}
	private native void newKPopupMenu(QWidget parent);
	public KPopupMenu() {
		super((Class) null);
		newKPopupMenu();
	}
	private native void newKPopupMenu();
	/**	
		 Inserts a title item with no icon.
		     		@short    Inserts a title item with no icon.
	*/
	public native int insertTitle(String text, int id, int index);
	public native int insertTitle(String text, int id);
	public native int insertTitle(String text);
	/**	
		 Inserts a title item with the given icon and title.
		     		@short    Inserts a title item with the given icon and title.
	*/
	public native int insertTitle(QPixmap icon, String text, int id, int index);
	public native int insertTitle(QPixmap icon, String text, int id);
	public native int insertTitle(QPixmap icon, String text);
	/**	
		 Changes the title of the item at the specified id. If a icon was
		 previously set it is cleared.
		     		@short    Changes the title of the item at the specified id.
	*/
	public native void changeTitle(int id, String text);
	/**	
		 Changes the title and icon of the title item at the specified id.
		     		@short    Changes the title and icon of the title item at the specified id.
	*/
	public native void changeTitle(int id, QPixmap icon, String text);
	/**	
		 Returns the title of the title item at the specified id. The default
		 id of -1 is for backwards compatibility only, you should always specify
		 the id.
		     		@short    Returns the title of the title item at the specified id.
	*/
	public native String title(int id);
	public native String title();
	/**	
		 Returns the icon of the title item at the specified id.
		     		@short    Returns the icon of the title item at the specified id.
	*/
	public native QPixmap titlePixmap(int id);
	/**	
		 Enables keyboard navigation by searching for the entered key sequence.
		 Also underlines the currently selected item, providing feedback on the search.
			 Defaults to off.
			 WARNING: calls to text() of currently keyboard-selected items will
		 contain additional ampersand characters.
			 WARNING: though pre-existing keyboard shortcuts will not interfere with the
		 operation of this feature, they may be confusing to the user as the existing
		 shortcuts will not work.
				@short    Enables keyboard navigation by searching for the entered key sequence.
	*/
	public native void setKeyboardShortcutsEnabled(boolean enable);
	/**	
		 Enables execution of the menu item once it is uniquely specified.
		 Defaults to off.
				@short    Enables execution of the menu item once it is uniquely specified.
	*/
	public native void setKeyboardShortcutsExecute(boolean enable);
	/**	
		 Returns the context menu associated with this menu
				@short    Returns the context menu associated with this menu
	*/
	public native QPopupMenu contextMenu();
	/**	
		 Hides the context menu if shown
				@short    Hides the context menu if shown
	*/
	public native void hideContextMenu();
	/**	
		 Reimplemented for internal purposes
				@short    Reimplemented for internal purposes
	*/
	public native void activateItemAt(int index);
	/**	
		 Return the state of the mouse button and keyboard modifiers
		 when the last menuitem was activated.
				@short    Return the state of the mouse button and keyboard modifiers  when the last menuitem was activated.
	*/
	public native int state();
	/**	
		 Returns the KPopupMenu associated with the current context menu
				@short    Returns the KPopupMenu associated with the current context menu
	*/
	public static native KPopupMenu contextMenuFocus();
	/**	
		 returns the ID of the menuitem associated with the current context menu
				@short    returns the ID of the menuitem associated with the current context menu
	*/
	public static native int contextMenuFocusItem();
	protected native void closeEvent(QCloseEvent arg1);
	protected native void keyPressEvent(QKeyEvent e);
	protected native void mouseReleaseEvent(QMouseEvent e);
	protected native void mousePressEvent(QMouseEvent e);
	protected native boolean focusNextPrevChild(boolean next);
	protected native void contextMenuEvent(QContextMenuEvent e);
	protected native void hideEvent(QHideEvent arg1);
	protected native String underlineText(String text, int length);
	protected native void resetKeyboardVars(boolean noMatches);
	protected native void resetKeyboardVars();
	protected native void itemHighlighted(int whichItem);
	protected native void showCtxMenu(QPoint pos);
	protected native void ctxMenuHiding();
	protected native void ctxMenuHideShowingMenu();
	/** Deletes the wrapped C++ instance */
	protected native void finalize() throws InternalError;
	/** Delete the wrapped C++ instance ahead of finalize() */
	public native void dispose();
	/** Has the wrapped C++ instance been deleted? */
	public native boolean isDisposed();
}