|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.KFileView
public class KFileView
This class defines an interface to all file views. Its intent is to allow to switch the view of the files in the selector very easily. It defines some pure functions, that must be implemented to make a file view working. Since this class is not a widget, but it's meant to be added to other widgets, its most important function is widget. This should return a pointer to the implemented widget.
Field Summary | |
---|---|
static int |
All
|
static int |
AutoOpenDirs
Various options for drag and drop support. |
static int |
Directories
|
static int |
Files
|
static int |
VIRTUAL_SET_DROP_OPTIONS
|
Constructor Summary | |
---|---|
protected |
KFileView(java.lang.Class dummy)
|
Method Summary | |
---|---|
KActionCollection |
actionCollection()
|
void |
addItemList(java.util.ArrayList list)
inserts a list of items. |
static int |
autoOpenDelay()
delay before auto opening a directory |
void |
clear()
Clears the view and all item lists. |
void |
clearSelection()
Clears any selection, unhighlights everything. |
void |
clearView()
pure function, that should be implemented to clear the view. |
int |
count()
|
KFileItem |
currentFileItem()
|
int |
dropOptions()
Returns the DND options in effect. |
void |
ensureItemVisible(KFileItem i)
pure function, that should be implemented to make item i visible, i.e. |
KFileItem |
firstFileItem()
|
void |
insertItem(KFileItem i)
The derived view must implement this function to add the file in the widget. |
void |
invertSelection()
Inverts the current selection, i.e. |
boolean |
isReversed()
Tells whether the current items are in reversed order (shortcut to sorting() & QDir.Reversed). |
boolean |
isSelected(KFileItem arg1)
|
java.util.ArrayList |
items()
|
void |
listingCompleted()
This hook is called when all items of the currently listed directory are listed and inserted into the view, i.e. |
KFileItem |
nextItem(KFileItem arg1)
|
int |
numDirs()
|
int |
numFiles()
|
boolean |
onlyDoubleClickSelectsFiles()
|
KFileItem |
prevItem(KFileItem arg1)
|
void |
readConfig(KConfig arg1)
|
void |
readConfig(KConfig arg1,
java.lang.String group)
|
void |
removeItem(KFileItem item)
Removes an item from the list; has to be implemented by the view. |
void |
selectAll()
Selects all items. |
java.util.ArrayList |
selectedItems()
|
void |
setCurrentItem(KFileItem item)
Reimplement this to set item the current item in the view, e.g. |
void |
setCurrentItem(java.lang.String filename)
Sets filename the current item in the view, if available. |
void |
setDropOptions(int options)
Specify DND options. |
void |
setOnlyDoubleClickSelectsFiles(boolean enable)
This is a KFileDialog specific hack: we want to select directories with single click, but not files. |
void |
setParentView(KFileViewInterface parent)
|
void |
setSelected(KFileItem arg1,
boolean enable)
Tells the view that it should highlight the item. |
void |
setSelectionMode(int sm)
|
void |
setSorting(int sort)
Sets the sorting order of the view. |
void |
setViewMode(int vm)
|
void |
setViewName(java.lang.String name)
Sets the name of the view, which could be displayed somewhere. |
KFileViewSignaler |
signaler()
|
int |
sorting()
Returns the sorting order of the internal list. |
static java.lang.String |
sortingKey(long value,
boolean isDir,
int sortSpec)
An overloaded method that takes not a String, but a number as sort criterion. |
static java.lang.String |
sortingKey(java.lang.String value,
boolean isDir,
int sortSpec)
This method calculates a String from the given parameters, that is suitable for sorting with e.g. |
void |
sortReversed()
|
boolean |
updateNumbers(KFileItem i)
increases the number of dirs and files. |
void |
updateView()
|
void |
updateView(boolean f)
does a repaint of the view. |
void |
updateView(KFileItem arg1)
|
int |
viewMode()
|
java.lang.String |
viewName()
|
org.kde.qt.QWidget |
widget()
a pure function to get a QWidget, that can be added to other widgets. |
void |
writeConfig(KConfig arg1)
|
void |
writeConfig(KConfig arg1,
java.lang.String group)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int VIRTUAL_SET_DROP_OPTIONS
public static final int Files
public static final int Directories
public static final int All
public static final int AutoOpenDirs
AutoOpenDirs
Automatically open directory after hovering above it
for a short while while dragging.
Constructor Detail |
---|
protected KFileView(java.lang.Class dummy)
Method Detail |
---|
public void addItemList(java.util.ArrayList list)
addItemList
in interface KFileViewInterface
public org.kde.qt.QWidget widget()
widget
in interface KFileViewInterface
public void setCurrentItem(java.lang.String filename)
filename
the current item in the view, if available.
setCurrentItem
in interface KFileViewInterface
public void setCurrentItem(KFileItem item)
item
the current item in the view, e.g.
the item having focus.
setCurrentItem
in interface KFileViewInterface
public KFileItem currentFileItem()
currentFileItem
in interface KFileViewInterface
public void clear()
clear
in interface KFileViewInterface
public void updateView(boolean f)
widget().repaint(f)
updateView
in interface KFileViewInterface
public void updateView()
updateView
in interface KFileViewInterface
public void updateView(KFileItem arg1)
updateView
in interface KFileViewInterface
public void removeItem(KFileItem item)
removeItem
in interface KFileViewInterface
public void listingCompleted()
listingCompleted
in interface KFileViewInterface
public int sorting()
sorting
in interface KFileViewInterface
public void setSorting(int sort)
setSorting
in interface KFileViewInterface
sortingKey(java.lang.String, boolean, int)
public boolean isReversed()
isReversed
in interface KFileViewInterface
public void sortReversed()
sortReversed
in interface KFileViewInterface
public int count()
count
in interface KFileViewInterface
public int numFiles()
numFiles
in interface KFileViewInterface
public int numDirs()
numDirs
in interface KFileViewInterface
public void setSelectionMode(int sm)
setSelectionMode
in interface KFileViewInterface
public void setViewMode(int vm)
setViewMode
in interface KFileViewInterface
public int viewMode()
viewMode
in interface KFileViewInterface
public java.lang.String viewName()
viewName
in interface KFileViewInterface
setViewName(java.lang.String)
public void setViewName(java.lang.String name)
setViewName
in interface KFileViewInterface
public void setParentView(KFileViewInterface parent)
setParentView
in interface KFileViewInterface
public void insertItem(KFileItem i)
insertItem
in interface KFileViewInterface
public void clearView()
clearView
in interface KFileViewInterface
public void ensureItemVisible(KFileItem i)
ensureItemVisible
in interface KFileViewInterface
public void clearSelection()
clearSelection
in interface KFileViewInterface
public void selectAll()
selectAll
in interface KFileViewInterface
public void invertSelection()
invertSelection
in interface KFileViewInterface
public void setSelected(KFileItem arg1, boolean enable)
setSelected
in interface KFileViewInterface
public boolean isSelected(KFileItem arg1)
isSelected
in interface KFileViewInterface
public java.util.ArrayList selectedItems()
selectedItems
in interface KFileViewInterface
public java.util.ArrayList items()
items
in interface KFileViewInterface
public KFileItem firstFileItem()
firstFileItem
in interface KFileViewInterface
public KFileItem nextItem(KFileItem arg1)
nextItem
in interface KFileViewInterface
public KFileItem prevItem(KFileItem arg1)
prevItem
in interface KFileViewInterface
public void setOnlyDoubleClickSelectsFiles(boolean enable)
setOnlyDoubleClickSelectsFiles
in interface KFileViewInterface
public boolean onlyDoubleClickSelectsFiles()
onlyDoubleClickSelectsFiles
in interface KFileViewInterface
setOnlyDoubleClickSelectsFiles(boolean)
public boolean updateNumbers(KFileItem i)
updateNumbers
in interface KFileViewInterface
public KActionCollection actionCollection()
actionCollection
in interface KFileViewInterface
public KFileViewSignaler signaler()
signaler
in interface KFileViewInterface
public void readConfig(KConfig arg1, java.lang.String group)
readConfig
in interface KFileViewInterface
public void readConfig(KConfig arg1)
readConfig
in interface KFileViewInterface
public void writeConfig(KConfig arg1, java.lang.String group)
writeConfig
in interface KFileViewInterface
public void writeConfig(KConfig arg1)
writeConfig
in interface KFileViewInterface
public void setDropOptions(int options)
setDropOptions
in interface KFileViewInterface
public int dropOptions()
dropOptions
in interface KFileViewInterface
public static java.lang.String sortingKey(java.lang.String value, boolean isDir, int sortSpec)
value
- Any string that should be used as sort criterionisDir
- Tells whether the key is computed for an item representing
a directory (directories are usually sorted before files)sortSpec
- An ORed combination of QDir.SortSpec flags.
Currently, the values IgnoreCase, Reversed and
DirsFirst are taken into account.public static java.lang.String sortingKey(long value, boolean isDir, int sortSpec)
public static int autoOpenDelay()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |