|
|
A base class for views of the KDE file selector
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 virtual 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 @code widget. This should return a pointer to the implemented widget.
~ |
[virtual]
Destructor
void |
[virtual]
inserts a list of items.
QWidget * |
[pure virtual]
a pure virtual function to get a QWidget, that can be added to other widgets. This function is needed to make it possible for derived classes to derive from other widgets.
void |
[virtual]
set the current item in the view.
the normal use of this function is to use the parameter filename to set the highlight on this file.
the extend use of this function is to set filename to 0. In this case the @see KFileViewItem is used to find out the position of the file. Since this is faster, this way is used in case a view has other child views.
void |
[virtual]
clears the view and all item lists
void |
[virtual]
does a repaint of the view.
The default implementation calls
widget()->repaint(f)</pre>
QDir::SortSpec |
[const]
specifies the sorting of the internal list. Newly added files are added through this sorting.
void |
[virtual]
set the sorting of the view
Default is QDir::Name | QDir::IgnoreCase | QDir::DirsFirst Don't use QDir::Reversed, use sortReversed() if you want to reverse the sort order. Calling this method keeps the reversed-setting If your view wants to get notified about sorting-changes (e.g. to show a sorting indicator), override this method and call this implementation in the beginning of your method.
void |
set the sorting mode. Default mode is Increasing. Affects only newly added items.
KFile::SortMode |
[const]
Returns: the current sort mode
See also: setSortMode, setSorting
void |
[virtual]
Toggles the current sort order, i.e. the order is reversed.
bool |
[const]
Tells whether the current items are in reversed order (= contrary to sortMode).
uint |
[const]
Returns: the number of dirs and files
uint |
[const]
Returns: the number of files.
uint |
[const]
Returns: the number of directories
QString |
Returns: the localized name of the view, which could be displayed somewhere, e.g. in a menu, where the user can choose between views.
void |
Sets the name of the view, which could be displayed somewhere. E.g. "Image Preview".
void |
[pure virtual]
The derived view must implement this function to add the file in the widget.
void |
[pure virtual]
pure virtual function, that should be implemented to clear the view. At this moment the list is already empty
void |
[pure virtual]
pure virtual function, that should be implemented to make item i visible, i.e. by scrolling the view appropriately.
void |
[pure virtual]
Clear any selection, unhighlight everything. Must be implemented by the view.
void |
[virtual]
Selects all items. You may want to override this, if you can implement it more efficiently than calling setSelected() with every item. This works only in Multiselection mode of course.
void |
[virtual]
Inverts the current selection, i.e. selects all items, that were up to now not selected and deselects the other.
void |
[pure virtual]
Tells the view that it should highlight the item. This function must be implemented by the view
bool |
[const pure virtual]
Returns: whether the given item is currently selected. Must be implemented by the view.
const KFileViewItemList * |
[const]
Returns: all currently highlighted items.
const KFileViewItemList * |
[const]
Returns: all items currently available in the current sort-order
void |
[virtual]
Inserts "counter" KFileViewItems and sorts them conforming to the current sort-order. If you override this method, you have to call setFirstItem() afterwards, to set the first item of your newly sorted items.
KFileViewItem * |
[const]
Returns: the first (depending on sort order) item. It forms sort of a list, as each item holds a pointer to the next item. This is only public for internal reasons, DON'T call it unless you implement a View yourself and really need to.
void |
[protected]
Call this method when an item is selected (depends on single click / double click configuration). Emits the appropriate signal.
void |
[protected]
emits the highlighted signal for item. Call this in your subclass, whenever the selection changes.
int |
[protected const]
compares two items in the current context (sortMode and others) returns -1, if i1 is before i2 and 1, if the other case is true in case, both are equal (in current context), the behaviour is undefined!
void |
[protected const]
this is a help function for sorting, since I can't use the libc version (because I have a variable sort function)
KFileViewSignaler * |
[protected]
class to distribute the signals
void |
[protected]
Call this method to set the first item after you call your own insertSorted(). You only need to call it when you override insertSorted().
void |
[protected]
Call this if you changed the sort order and want to perform the actual sorting and show the new items.