diff options
Diffstat (limited to 'kdejava/koala/org/kde/koala/KListView.java')
-rw-r--r-- | kdejava/koala/org/kde/koala/KListView.java | 778 |
1 files changed, 778 insertions, 0 deletions
diff --git a/kdejava/koala/org/kde/koala/KListView.java b/kdejava/koala/org/kde/koala/KListView.java new file mode 100644 index 00000000..2cbcdecb --- /dev/null +++ b/kdejava/koala/org/kde/koala/KListView.java @@ -0,0 +1,778 @@ +//Auto-generated by kalyptus. DO NOT EDIT. +package org.kde.koala; + +import org.kde.qt.Qt; +import org.kde.qt.QColor; +import org.kde.qt.QRect; +import org.kde.qt.QListViewItem; +import org.kde.qt.QMetaObject; +import org.kde.qt.QtSupport; +import org.kde.qt.QPaintEvent; +import org.kde.qt.QPoint; +import org.kde.qt.QDragEnterEvent; +import org.kde.qt.QDragMoveEvent; +import org.kde.qt.QPainter; +import org.kde.qt.QDragLeaveEvent; +import org.kde.qt.QFocusEvent; +import org.kde.qt.QKeyEvent; +import org.kde.qt.QMouseEvent; +import org.kde.qt.QDropEvent; +import org.kde.qt.QEvent; +import org.kde.qt.QIconSet; +import org.kde.qt.QWidget; +import org.kde.qt.QResizeEvent; +import org.kde.qt.QDragObject; +import org.kde.qt.QListView; + +/** + + This Widget extends the functionality of QListView to honor the system + wide settings for Single Click/Double Click mode, AutoSelection and + ChangeCursorOverLink (TM). + There is a new signal executed(). It gets connected to either + QListView.clicked() or QListView.doubleClicked() depending on the KDE + wide Single Click/Double Click settings. It is strongly recommended that + you use this signal instead of the above mentioned. This way you don't + need to care about the current settings. + If you want to get informed when the user selects something connect to the + QListView.selectionChanged() signal. + Drag-and-Drop is supported with the signal dropped(), just setAcceptDrops(true) + and connect it to a suitable slot. + To see where you are dropping, setDropVisualizer(true). + And also you'll need acceptDrag(QDropEvent) + KListView is drag-enabled, too: to benefit from that you have to derive from it. + Reimplement dragObject() and (possibly) startDrag(), + and setDragEnabled(true). + See {@link KListViewSignals} for signals emitted by KListView + @short This Widget extends the functionality of QListView to honor the system wide settings for Single Click/Double Click mode, AutoSelection and ChangeCursorOverLink (TM). + +*/ +public class KListView extends QListView { + protected KListView(Class dummy){super((Class) null);} + /** + Possible selection modes. + The first four correspond directly to QListView.SelectionMode, while + the FileManager selection mode is defined as follows: + + <li> + home: move to the first + </li> + + <li> + end: move to the last + </li> + + <li> + PgUp/PgDn: move one page up/down + </li> + + <li> + up/down: move one item up/down + </li> + + <li> + insert: toggle selection of current and move to the next + </li> + + <li> + space: toggle selection of the current + </li> + + <li> + CTRL+up: move to the previous item and toggle selection of this one + </li> + + <li> + CTRL+down: toggle selection of the current item and move to the next + </li> + + <li> + CTRL+end: toggle selection from (including) the current + item to (including) the last item + </li> + + <li> + CTRL+home: toggle selection from (including) the current + item to the (including) the first item + </li> + + <li> + CTRL+PgDn: toggle selection from (including) the current + item to (excluding) the item one page down + </li> + + <li> + CTRL+PgUp: toggle selection from (excluding) the current + item to (including) the item one page up + </li> + The combinations work the same with SHIFT instead of CTRL, except + that if you start selecting something using SHIFT everything selected + before will be deselected first. + Additionally the current item is always selected automatically when + navigating using the keyboard, except other items were selected explicitly. + This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected + @short Possible selection modes. + */ + public static final int Single = QListView.Single; + public static final int Multi = QListView.Multi; + public static final int Extended = QListView.Extended; + public static final int NoSelection = QListView.NoSelection; + public static final int FileManager = 0; + + public native QMetaObject metaObject(); + public native String className(); + /** + Constructor. + The parameters <code>parent</code> and <code>name</code> are handled by + QListView, as usual. + @short Constructor. + */ + public KListView(QWidget parent, String name) { + super((Class) null); + newKListView(parent,name); + } + private native void newKListView(QWidget parent, String name); + public KListView(QWidget parent) { + super((Class) null); + newKListView(parent); + } + private native void newKListView(QWidget parent); + public KListView() { + super((Class) null); + newKListView(); + } + private native void newKListView(); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + public native void setAcceptDrops(boolean arg1); + /** + This function determines whether the given coordinates are within the + execute area. The execute area is the part of a QListViewItem where mouse + clicks or double clicks respectively generate a executed() signal. + Depending on QListView.allColumnsShowFocus() this is either the + whole item or only the first column. + @return true if point is inside execute area of an item, false in all + other cases including the case that it is over the viewport. + + @short This function determines whether the given coordinates are within the execute area. + */ + public native boolean isExecuteArea(QPoint point); + /** + Same thing, but from an x coordinate only. This only checks if x is in + the first column (if all columns don't show focus), without testing if + the y coordinate is over an item or not. + @short Same thing, but from an x coordinate only. + */ + public native boolean isExecuteArea(int x); + /** + @param includeHiddenItems Set to true to return all items regardless of + visibility. Set to false to only return items that are isVisible(). + @return a list of all selected listview items + + @short + */ + // QPtrList<QListViewItem> selectedItems(bool arg1); >>>> NOT CONVERTED + /** + Arbitrarily move <code>item</code> to <code>parent</code>, positioned immediately after item <code>after.</code> + If after is 0, <code>item</code> is made the first child of <code>parent.</code> + (Un-deprecated in kde-3.4) + @short Arbitrarily move <code>item</code> to <code>parent</code>, positioned immediately after item <code>after.</code> + */ + public native void moveItem(QListViewItem item, QListViewItem parent, QListViewItem after); + /** + @return the last item (not child!) of this listview. + + @short + @see #lastChild + */ + public native QListViewItem lastItem(); + /** + @return the last child of this listview. + + @short + @see #lastItem + */ + public native QListViewItem lastChild(); + /** + @return the lineedit used for inline renaming. + Use that to setup a KCompletion or QValidator for the lineedit + + @short + */ + public native KLineEdit renameLineEdit(); + /** + @return if it is legal to move items in the list view. True by default. + + @short + @see #setDragEnabled + @see #setItemsMovable + */ + public native boolean itemsMovable(); + /** + @return whether inplace-renaming has been enabled. False by default. + + @short + @see #setItemsRenameable + */ + public native boolean itemsRenameable(); + /** + @return whether dragging is enabled. False by default. + + @short + @see #setDragEnabled + */ + public native boolean dragEnabled(); + /** + @return true if AutoOpen is enabled (not implemented currently). + + @short + @see #setAutoOpen + */ + public native boolean autoOpen(); + /** + @return true if <code>column</code> is renamable. + + @short + @see #setRenameable + */ + public native boolean isRenameable(int column); + /** + @return true if drawing of the drop-visualizer has been enabled. True by default. + + @short + @see #setDropVisualizer + */ + public native boolean dropVisualizer(); + /** + @return the column for which tooltips are displayed (or -1 if none set). + + @short + @see #setTooltipColumn + */ + public native int tooltipColumn(); + /** + @return true if drawing of the drop-highlighter has been enabled. False by default. + + @short + @see #setDropHighlighter + */ + public native boolean dropHighlighter(); + /** + The dropVisualizerWidth defaults to 4. + @return the current width of the drop-visualizer. + + @short The dropVisualizerWidth defaults to 4. + @see #setDropVisualizerWidth + */ + public native int dropVisualizerWidth(); + /** + @return the "extended" selection mode of this listview. + + @short + @see SelectionModeExt + @see #setSelectionModeExt + */ + public native int selectionModeExt(); + /** + Returns the index of <code>item</code> within the item tree or -1 if + <code>item</code> doesn't exist in this list view. This function takes + all items into account not only the visible ones. + @short Returns the index of <code>item</code> within the item tree or -1 if <code>item</code> doesn't exist in this list view. + */ + public native int itemIndex(QListViewItem item); + /** + Returns the item of <code>index</code> within the item tree or 0 if + <code>index</code> doesn't exist in this list view. This function takes + all items into account not only the visible ones. + @short Returns the item of <code>index</code> within the item tree or 0 if <code>index</code> doesn't exist in this list view. + */ + public native QListViewItem itemAtIndex(int index); + /** + Let the last column fit exactly all the available width. + @short Let the last column fit exactly all the available width. + @see #fullWidth + */ + public native void setFullWidth(boolean fullWidth); + /** + Returns whether the last column is set to fit the available width. + @short Returns whether the last column is set to fit the available width. + @see #setFullWidth + */ + public native boolean fullWidth(); + /** + Reimplemented for full width support + @short Reimplemented for full width support + @see #removeColumn + */ + public native int addColumn(String label, int width); + public native int addColumn(String label); + /** + Reimplemented for full width support + @short Reimplemented for full width support + */ + public native int addColumn(QIconSet iconset, String label, int width); + public native int addColumn(QIconSet iconset, String label); + /** + Reimplemented for full width support + @short Reimplemented for full width support + @see #addColumn + */ + public native void removeColumn(int index); + /** + sets the alternate background background color. + This only has an effect if the items are KListViewItems + @param c the color to use for every other item. Set to an invalid + color to disable alternate colors. + @short sets the alternate background background color. + @see #alternateBackground + */ + public native void setAlternateBackground(QColor c); + /** + @return the alternate background color + + @short + @see #setAlternateBackground + */ + public native QColor alternateBackground(); + /** + Saves the list view's layout (column widtsh, column order, sort column) + to a KConfig group + @param config the KConfig object to write to + @param group the config group to use + @short Saves the list view's layout (column widtsh, column order, sort column) to a KConfig group + */ + public native void saveLayout(KConfig config, String group); + /** + Reads the list view's layout from a KConfig group as stored with + saveLayout + @param config the KConfig object to read from + @param group the config group to use + @short Reads the list view's layout from a KConfig group as stored with saveLayout + */ + public native void restoreLayout(KConfig config, String group); + /** + Reimplemented to remember the current sort column and order. + @param column is the column to be sorted, or -1 to sort in order of + insertion + @param ascending whether to sort ascending (or descending) + @short Reimplemented to remember the current sort column and order. + */ + public native void setSorting(int column, boolean ascending); + public native void setSorting(int column); + /** + @return the currently sorted column, or -1 if none is sorted + + @short + */ + public native int columnSorted(); + /** + @return whether the current sort is ascending (or descending) + + @short + */ + public native boolean ascendingSort(); + /** + Reimplemented for internal reasons. + @short Reimplemented for internal reasons. + */ + public native void takeItem(QListViewItem i); + /** + Set to true if the currently sorted column should be drawn shaded. Defaults to true + @param shadeSortColumn True if sort column should be shaded. + @short Set to true if the currently sorted column should be drawn shaded. + */ + public native void setShadeSortColumn(boolean shadeSortColumn); + /** + See if the sort column should be drawn shaded + @return true if the sort column should be shaded + + @short See if the sort column should be drawn shaded + */ + public native boolean shadeSortColumn(); + /** + Rename column <code>c</code> of <code>item.</code> + @short Rename column <code>c</code> of <code>item.</code> + */ + public native void rename(QListViewItem item, int c); + /** + By default, if you called setItemsRenameable(true), + only the first column is renameable. + Use this function to enable the feature on other columns. + If you want more intelligent (dynamic) selection, + you'll have to derive from KListView, + and override rename() and call only call it + if you want the item to be renamed. + @short By default, if you called setItemsRenameable(true), only the first column is renameable. + */ + public native void setRenameable(int column, boolean yesno); + public native void setRenameable(int column); + /** + Set whether items in the list view can be moved. + It is enabled by default. + @short Set whether items in the list view can be moved. + @see #itemsMovable + */ + public native void setItemsMovable(boolean b); + /** + Enables inplace-renaming of items. + It is disabled by default. + @short Enables inplace-renaming of items. + @see #itemsRenameable + @see #setRenameable + */ + public native void setItemsRenameable(boolean b); + /** + Enable/Disable the dragging of items. + It is disabled by default. + @short Enable/Disable the dragging of items. + */ + public native void setDragEnabled(boolean b); + /** + Enable/Disable AutoOpen (not implemented currently). + @short Enable/Disable AutoOpen (not implemented currently). + */ + public native void setAutoOpen(boolean b); + /** + Enable/Disable the drawing of a drop-visualizer + (a bar that shows where a dropped item would be inserted). + It is enabled by default, if dragging is enabled + @short Enable/Disable the drawing of a drop-visualizer (a bar that shows where a dropped item would be inserted). + */ + public native void setDropVisualizer(boolean b); + /** + Set the width of the (default) drop-visualizer. + If you don't call this method, the width is set to 4. + @short Set the width of the (default) drop-visualizer. + */ + public native void setDropVisualizerWidth(int w); + /** + Set which column should be used for automatic tooltips. + @param column is the column for which tooltips will be shown. + Set -1 to disable this feature. + @short Set which column should be used for automatic tooltips. + */ + public native void setTooltipColumn(int column); + /** + Enable/Disable the drawing of a drop-highlighter + (a rectangle around the item under the mouse cursor). + It is disabled by default. + @short Enable/Disable the drawing of a drop-highlighter (a rectangle around the item under the mouse cursor). + */ + public native void setDropHighlighter(boolean b); + /** + Set the selection mode. + A different name was chosen to avoid API-clashes with QListView.setSelectionMode(). + @short Set the selection mode. + */ + public native void setSelectionModeExt(int mode); + /** + Enable/disable tabbing between editable cells + @short Enable/disable tabbing between editable cells + */ + public native void setTabOrderedRenaming(boolean b); + /** + Returns whether tab ordered renaming is enabled + @short Returns whether tab ordered renaming is enabled + */ + public native boolean tabOrderedRenaming(); + /** + Determine whether a drop on position <code>p</code> would count as + being above or below the QRect <code>rect.</code> + @param rect is the rectangle we examine. + @param p is the point located in the rectangle, p is assumed to be in + viewport coordinates. + @short Determine whether a drop on position <code>p</code> would count as being above or below the QRect <code>rect.</code> + */ + protected native boolean below(QRect rect, QPoint p); + /** + An overloaded version of below(QRect, QPoint). + It differs from the above only in what arguments it takes. + @param i the item whose rect() is passed to the above function. + @param p is translated from contents coordinates to viewport coordinates + before being passed to the above function. + @short An overloaded version of below(QRect, QPoint). + */ + protected native boolean below(QListViewItem i, QPoint p); + /** + Reimplemented to reload the alternate background in palette changes. + @short Reimplemented to reload the alternate background in palette changes. + */ + public native boolean event(QEvent arg1); + /** + Emit signal executed. + @short Emit signal executed. + */ + protected native void emitExecute(QListViewItem item, QPoint pos, int c); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void focusInEvent(QFocusEvent fe); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void focusOutEvent(QFocusEvent fe); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void leaveEvent(QEvent e); + /** + @return the tooltip for <code>column</code> of <code>item.</code> + + @short + */ + protected native String tooltip(QListViewItem item, int column); + /** + @return whether the tooltip for <code>column</code> of <code>item</code> shall be shown at point <code>pos.</code> + + @short + */ + protected native boolean showTooltip(QListViewItem item, QPoint pos, int column); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void contentsDragMoveEvent(QDragMoveEvent event); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void contentsMousePressEvent(QMouseEvent e); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void contentsMouseMoveEvent(QMouseEvent e); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void contentsMouseDoubleClickEvent(QMouseEvent e); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void contentsDragLeaveEvent(QDragLeaveEvent event); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void contentsMouseReleaseEvent(QMouseEvent arg1); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void contentsDropEvent(QDropEvent arg1); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void contentsDragEnterEvent(QDragEnterEvent arg1); + /** + @return a dragobject encoding the current selection. + + @short + @see #setDragEnabled + */ + protected native QDragObject dragObject(); + /** + @return true if the <code>event</code> provides some acceptable + format. + A common mistake is to forget the "const" in your reimplementation + + @short + */ + protected native boolean acceptDrag(QDropEvent event); + /** + Paint the drag line. If painter is null, don't try to :) + If after == 0 then the marker should be drawn at the top. + @return the rectangle that you painted to. + + @short Paint the drag line. + */ + protected native QRect drawDropVisualizer(QPainter p, QListViewItem parent, QListViewItem after); + /** + Paint the drag rectangle. If painter is null, don't try to :) + @return the rectangle that you painted to. + + @short Paint the drag rectangle. + */ + protected native QRect drawItemHighlighter(QPainter painter, QListViewItem item); + /** + This method calls dragObject() and starts the drag. + Reimplement it to do fancy stuff like setting a pixmap or + using a non-default DragMode + @short This method calls dragObject() and starts the drag. + */ + protected native void startDrag(); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void keyPressEvent(QKeyEvent arg1); + /** + Reimplemented for internal reasons. + Further reimplementations should call this function or else + some features may not work correctly. + The API is unaffected. + @short Reimplemented for internal reasons. + */ + protected native void viewportPaintEvent(QPaintEvent arg1); + /** + In FileManager selection mode: explicitly activate the mode + in which the current item is automatically selected. + @short In FileManager selection mode: explicitly activate the mode in which the current item is automatically selected. + */ + protected native void activateAutomaticSelection(); + /** + In FileManager selection mode: explicitly deactivate the mode + in which the current item is automatically selected. + @short In FileManager selection mode: explicitly deactivate the mode in which the current item is automatically selected. + */ + protected native void deactivateAutomaticSelection(); + /** + In FileManager selection mode: return whether it is currently in the mode + where the current item is selected automatically. + Returns false if items were selected explicitly, e.g. using the mouse. + @short In FileManager selection mode: return whether it is currently in the mode where the current item is selected automatically. + */ + protected native boolean automaticSelection(); + /** + Reimplemented for setFullWidth() + @short Reimplemented for setFullWidth() + */ + protected native void viewportResizeEvent(QResizeEvent e); + /** + Disable AutoSelection. This overrides the system wide setting for + AutoSelection. Please don't call this unless you have good reasons to + override the system wide setting for AutoSelection. + @short Disable AutoSelection. + @see #resetAutoSelection + */ + protected native void disableAutoSelection(); + /** + Reset AutoSelection to the system wide setting. + @short Reset AutoSelection to the system wide setting. + @see #disableAutoSelection + */ + protected native void resetAutoSelection(); + /** + Handle dropEvent when itemsMovable() is set to true. + @short Handle dropEvent when itemsMovable() is set to true. + */ + protected native void movableDropEvent(QListViewItem parent, QListViewItem afterme); + /** + Where is the nearest QListViewItem that I'm going to drop? + FIXME KDE 4.0: Make this method const so it can be called from an + acceptDrag method without ugly casts + @short Where is the nearest QListViewItem that I'm going to drop? + */ + protected native void findDrop(QPoint pos, QListViewItem parent, QListViewItem after); + /** + A special keyPressEvent (for FileManager selection mode). + @short A special keyPressEvent (for FileManager selection mode). + */ + protected native void fileManagerKeyPressEvent(QKeyEvent arg1); + /** + Convert the depth of an item into its indentation in pixels + @short Convert the depth of an item into its indentation in pixels + */ + protected native int depthToPixels(int depth); + /** + Update internal settings whenever the global ones change. + @short Update internal settings whenever the global ones change. + */ + protected native void slotSettingsChanged(int arg1); + protected native void slotMouseButtonClicked(int btn, QListViewItem item, QPoint pos, int c); + protected native void doneEditing(QListViewItem item, int row); + /** + Repaint the rect where I was drawing the drop line. + @short Repaint the rect where I was drawing the drop line. + */ + protected native void cleanDropVisualizer(); + /** + Repaint the rect where I was drawing the drop rectangle. + @short Repaint the rect where I was drawing the drop rectangle. + */ + protected native void cleanItemHighlighter(); + /** + Emit the contextMenu signal. This slot is for mouse actions. + @short Emit the contextMenu signal. + */ + protected native void emitContextMenu(QListViewItem arg1, QPoint arg2, int arg3); + /** + Emit the contextMenu signal. This slot is for key presses. + @short Emit the contextMenu signal. + */ + protected native void emitContextMenu(KListView arg1, QListViewItem arg2); + /** + Accessory slot for AutoSelect + @short Accessory slot for AutoSelect + */ + protected native void slotOnItem(QListViewItem item); + /** + Accessory slot for AutoSelect/ChangeCursorOverItem + @short Accessory slot for AutoSelect/ChangeCursorOverItem + */ + protected native void slotOnViewport(); + /** + Process AutoSelection. + @short Process AutoSelection. + */ + protected native void slotAutoSelect(); + protected native void slotDragExpand(); + /** + Reacts to header changes in full width mode + @short Reacts to header changes in full width mode + */ + protected native void slotHeaderChanged(); + /** 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(); +} |