#include <kfileview.h>
Inheritance diagram for KFileView:

Public Methods | |
| virtual | ~KFileView () |
| void | addItemList (const KFileItemList &list) |
| virtual QWidget * | widget ()=0 |
| QWidget * | widget () const |
| void | setCurrentItem (const QString &filename) |
| virtual void | setCurrentItem (const KFileItem *item)=0 |
| virtual KFileItem * | currentFileItem () const=0 |
| virtual void | clear () |
| virtual void | updateView (bool f=true) |
| virtual void | removeItem (const KFileItem *item) |
| virtual void | listingCompleted () |
| QDir::SortSpec | sorting () const |
| virtual void | setSorting (QDir::SortSpec sort) |
| bool | isReversed () const |
| uint | count () const |
| uint | numFiles () const |
| uint | numDirs () const |
| QString | viewName () const |
| void | setViewName (const QString &name) |
| virtual void | insertItem (KFileItem *i) |
| virtual void | clearView ()=0 |
| virtual void | ensureItemVisible (const KFileItem *i)=0 |
| virtual void | clearSelection ()=0 |
| virtual void | selectAll () |
| virtual void | invertSelection () |
| virtual void | setSelected (const KFileItem *, bool enable)=0 |
| virtual bool | isSelected (const KFileItem *) const=0 |
| const KFileItemList * | selectedItems () const |
| const KFileItemList * | items () const |
| void | setOnlyDoubleClickSelectsFiles (bool enable) |
| bool | onlyDoubleClickSelectsFiles () const |
| bool | updateNumbers (const KFileItem *i) |
| virtual KActionCollection * | actionCollection () const |
Static Public Methods | |
| QString | sortingKey (const QString &value, bool isDir, int sortSpec) |
| QString | sortingKey (KIO::filesize_t value, bool isDir, int sortSpec) |
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 widget. This should return a pointer to the implemented widget.
Definition at line 94 of file kfileview.h.
|
|
Destructor |
|
|
Reimplemented in KCombiView, and KFilePreview. |
|
|
inserts a list of items. |
|
|
Clears the view and all item lists. Reimplemented in KCombiView, and KFilePreview. |
|
|
Clears any selection, unhighlights everything. Must be implemented by the view. Implemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
pure virtual function, that should be implemented to clear the view. At this moment the list is already empty Implemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
Definition at line 200 of file kfileview.h. |
|
|
Implemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
pure virtual function, that should be implemented to make item i visible, i.e. by scrolling the view appropriately. Implemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
The derived view must implement this function to add the file in the widget. Make sure to call this implementation, i.e. KFileView::insertItem( i ); Reimplemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
Inverts the current selection, i.e. selects all items, that were up to now not selected and deselects the other. Reimplemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
Tells whether the current items are in reversed order (shortcut to sorting() & QDir::Reversed). Definition at line 193 of file kfileview.h. |
|
|
Implemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. Referenced by KDirOperator::isSelected(). |
|
|
|
|
|
This hook is called when all items of the currently listed directory are listed and inserted into the view, i.e. there won't come any new items anymore. Reimplemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
Definition at line 210 of file kfileview.h. |
|
|
Definition at line 205 of file kfileview.h. |
|
|
Definition at line 324 of file kfileview.h. |
|
|
Removes an item from the list; has to be implemented by the view. Call KFileView::removeItem( item ) after removing it. Reimplemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
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. Reimplemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
Referenced by KDirOperator::selectedItems(). |
|
|
Reimplement this to set Implemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
Sets |
|
|
This is a KFileDialog specific hack: we want to select directories with single click, but not files. But as a generic class, we have to be able to select files on single click as well. This gives us the opportunity to do both. Every view has to decide when to call select( item ) when a file was single-clicked, based on onlyDoubleClickSelectsFiles(). Definition at line 315 of file kfileview.h. |
|
||||||||||||
|
Tells the view that it should highlight the item. This function must be implemented by the view. Implemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
Sets the sorting order of the view. Default is QDir::Name | QDir::IgnoreCase | QDir::DirsFirst Override this in your subclass and sort accordingly (usually by setting the sorting-key for every item and telling QIconView or QListView to sort. A view may choose to use a different sorting than QDir::Name, Time or Size. E.g. to sort by mimetype or any possible string. Set the sorting to QDir::Unsorted for that and do the rest internally.
Reimplemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
Sets the name of the view, which could be displayed somewhere. E.g. "Image Preview". Definition at line 234 of file kfileview.h. |
|
|
Returns the sorting order of the internal list. Newly added files are added through this sorting. Definition at line 171 of file kfileview.h. |
|
||||||||||||||||
|
An overloaded method that takes not a QString, but a number as sort criterion. You can use this for file-sizes or dates/times for example. If you use a time_t, you need to cast that to KIO::filesize_t because of ambiguity problems. |
|
||||||||||||||||
|
This method calculates a QString from the given parameters, that is suitable for sorting with e.g. QIconView or QListView. Their Item-classes usually have a setKey( const QString& ) method or a virtual method QString key() that is used for sorting.
|
|
|
increases the number of dirs and files.
|
|
|
does a repaint of the view. The default implementation calls widget()->repaint(f) Reimplemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. |
|
|
Definition at line 228 of file kfileview.h. |
|
|
### As const-method, to be fixed in 3.0 Definition at line 119 of file kfileview.h. |
|
|
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. Implemented in KCombiView, KFileDetailView, KFileIconView, and KFilePreview. Referenced by KDirOperator::viewWidget(). |
1.2.18