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

import org.kde.qt.Qt;
import org.kde.qt.QtSupport;
import org.kde.qt.TQObject;
import org.kde.qt.TQCursor;
import org.kde.qt.TQEvent;
import org.kde.qt.TQWidget;
import org.kde.qt.Qt;

/**

 A wrapper around TQCursor that allows for "themed" cursors.
 Currently, the only themed cursor is a hand shaped cursor.
 A typical usage would be
 <pre>
 setCursor(KCursor.handCursor());
 </pre>
		@author Kurt Granroth <granroth@kde.org>
 
		@short A TQCursor wrapper allowing "themed" cursors and auto-hiding cursors.

*/
public class KCursor extends Qt  {
	protected KCursor(Class dummy){super((Class) null);}
	/**	
		 Constructor.
			 Does not do anything so far.
				@short    Constructor.
	*/
	public KCursor() {
		super((Class) null);
		newKCursor();
	}
	private native void newKCursor();
	/**	
		 Returns the proper hand cursor according to
		 the current GUI style (static function).
		     		@short    Returns the proper hand cursor according to  the current GUI style (static function).
	*/
	public static native TQCursor handCursor();
	/**	
		 Returns the proper arrow+hourglass cursor according to
		 the current GUI style (static function).
		     		@short    Returns the proper arrow+hourglass cursor according to  the current GUI style (static function).
	*/
	public static native TQCursor workingCursor();
	/**	
		 Returns the proper arrow cursor according to
		 the current GUI style (static function).
		     		@short    Returns the proper arrow cursor according to  the current GUI style (static function).
	*/
	public static native TQCursor arrowCursor();
	/**	
		 Returns the proper up arrow cursor according to
		 the current GUI style (static function).
		     		@short    Returns the proper up arrow cursor according to  the current GUI style (static function).
	*/
	public static native TQCursor upArrowCursor();
	/**	
		 Returns the proper cross-hair cursor according to
		 the current GUI style (static function).
		     		@short    Returns the proper cross-hair cursor according to  the current GUI style (static function).
	*/
	public static native TQCursor crossCursor();
	/**	
		 Returns the proper hourglass cursor according to
		 the current GUI style (static function).
		     		@short    Returns the proper hourglass cursor according to  the current GUI style (static function).
	*/
	public static native TQCursor waitCursor();
	/**	
		 Returns the proper text cursor according to
		 the current GUI style (static function).
		     		@short    Returns the proper text cursor according to  the current GUI style (static function).
	*/
	public static native TQCursor ibeamCursor();
	/**	
		 Returns the proper vertical resize cursor
		 according to the current GUI style (static function).
		     		@short    Returns the proper vertical resize cursor  according to the current GUI style (static function).
	*/
	public static native TQCursor sizeVerCursor();
	/**	
		 Returns the proper horizontal resize cursor
		 according to the current GUI style (static function).
		     		@short    Returns the proper horizontal resize cursor  according to the current GUI style (static function).
	*/
	public static native TQCursor sizeHorCursor();
	/**	
		 Returns the proper diagonal resize (/) cursor
		 according to the current GUI style (static function).
		     		@short    Returns the proper diagonal resize (/) cursor  according to the current GUI style (static function).
	*/
	public static native TQCursor sizeBDiagCursor();
	/**	
		 Returns the proper diagonal resize (\) cursor
		 according to the current GUI style (static function).
		     		@short    Returns the proper diagonal resize (\) cursor  according to the current GUI style (static function).
	*/
	public static native TQCursor sizeFDiagCursor();
	/**	
		 Returns the proper all-directions resize cursor
		 according to the current GUI style (static function).
		     		@short    Returns the proper all-directions resize cursor  according to the current GUI style (static function).
	*/
	public static native TQCursor sizeAllCursor();
	/**	
		 Returns a blank or invisible cursor (static function).
		     		@short    Returns a blank or invisible cursor (static function).
	*/
	public static native TQCursor blankCursor();
	/**	
		 Returns a WhatsThis cursor (static function).
		     		@short    Returns a WhatsThis cursor (static function).
	*/
	public static native TQCursor whatsThisCursor();
	/**	
		 Sets auto-hiding the cursor for widget <code>w.</code> Enabling it will result in
		 the cursor being hidden when
		
			<li>
			a key-event happens
			</li>
			
			<li>
			there are no key-events for a configured time-frame (see
			 setHideCursorDelay())
			</li>
				 The cursor will be shown again when the focus is lost or a mouse-event
		 happens.
			 Side effect: when enabling auto-hide, mouseTracking is enabled for the
		 specified widget, because it's needed to get mouse-move-events. So
		 don't disable mouseTracking for a widget while using auto-hide for it.
			 When disabling auto-hide, mouseTracking will be disabled, so if you need
		 mouseTracking after disabling auto-hide, you have to reenable
		 mouseTracking.
			 If you want to use auto-hiding for widgets that don't take focus, e.g.
		 a TQCanvasView, then you have to pass all key-events that should trigger
		 auto-hiding to autoHideEventFilter().
		     		@short    Sets auto-hiding the cursor for widget <code>w.</code>
	*/
	public static native void setAutoHideCursor(TQWidget w, boolean enable);
	/**	
		 Overloaded method for the case where you have an event-filter installed
		 on the widget you want to enable auto-cursor-hiding.
			 In this case set <code>customEventFilter</code> to true and call
		 autoHideEventFilter() from the beginning of your eventFilter().
				@short    Overloaded method for the case where you have an event-filter installed  on the widget you want to enable auto-cursor-hiding.
		@see #autoHideEventFilter
	*/
	public static native void setAutoHideCursor(TQWidget w, boolean enable, boolean customEventFilter);
	/**	
		 Sets the delay time in milliseconds for auto-hiding. When no keyboard
		 events arrive for that time-frame, the cursor will be hidden.
			 Default is 5000, i.e. 5 seconds.
		     		@short    Sets the delay time in milliseconds for auto-hiding.
	*/
	public static native void setHideCursorDelay(int ms);
	/**	
			 Default is 5000, i.e. 5 seconds.
		     		@return the current auto-hide delay time.

		@short
	*/
	public static native int hideCursorDelay();
	/**	
		 KCursor has to install an eventFilter over the widget you want to
		 auto-hide. If you have an own eventFilter() on that widget and stop
		 some events by returning true, you might break auto-hiding, because
		 KCursor doesn't get those events.
			 In this case, you need to call setAutoHideCursor( widget, true, true );
		 to tell KCursor not to install an eventFilter. Then you call this method
		 from the beginning of your eventFilter, for example:
		 <pre>
		 edit = new KEdit( this, "some edit widget" );
		 edit.installEventFilter( this );
		 KCursor.setAutoHideCursor( edit, true, true );
			 [...]
			 boolean YourClass.eventFilter( TQObject o, TQEvent e )
		 {
		     if ( o == edit ) // only that widget where you enabled auto-hide!
		         KCursor.autoHideEventFilter( o, e );
			     // now you can do your own event-processing
		     [...]
		 }
		 </pre>
			 Note that you must not call KCursor.autoHideEventFilter() when you
		 didn't enable or after disabling auto-hiding.
		     		@short    KCursor has to install an eventFilter over the widget you want to  auto-hide.
	*/
	public static native void autoHideEventFilter(TQObject arg1, TQEvent arg2);
	/** 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();
}