diff options
Diffstat (limited to 'kdejava/koala/org/kde/koala/KCursor.java')
-rw-r--r-- | kdejava/koala/org/kde/koala/KCursor.java | 200 |
1 files changed, 200 insertions, 0 deletions
diff --git a/kdejava/koala/org/kde/koala/KCursor.java b/kdejava/koala/org/kde/koala/KCursor.java new file mode 100644 index 00000000..d54f24b3 --- /dev/null +++ b/kdejava/koala/org/kde/koala/KCursor.java @@ -0,0 +1,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.QObject; +import org.kde.qt.QCursor; +import org.kde.qt.QEvent; +import org.kde.qt.QWidget; +import org.kde.qt.Qt; + +/** + + A wrapper around QCursor 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 QCursor 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 QCursor 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 QCursor 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 QCursor 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 QCursor 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 QCursor 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 QCursor 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 QCursor 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 QCursor 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 QCursor 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 QCursor 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 QCursor 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 QCursor sizeAllCursor(); + /** + Returns a blank or invisible cursor (static function). + @short Returns a blank or invisible cursor (static function). + */ + public static native QCursor blankCursor(); + /** + Returns a WhatsThis cursor (static function). + @short Returns a WhatsThis cursor (static function). + */ + public static native QCursor 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 QCanvasView, 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(QWidget 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(QWidget 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( QObject o, QEvent 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(QObject arg1, QEvent 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(); +} |