┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-11-04 17:27:11 +0000
committerPeter Penz <[email protected]>2010-11-04 17:27:11 +0000
commit7e311509a4ac89ebe95f3d81928fe78a9f398aa9 (patch)
tree5a906b0f4df2e2bb37dcd31c80dc97285fba131d /src/views/dolphinview.h
parentbd7416d0af9d498d0f2b6611fabd16e8e508f094 (diff)
Interface cleanup: The DolphinView should not expose QAbstractItemView-specific things like QItemSelectionModel. Just providing interfaces for KFileItem and KUrl will make it easier in future to change the view-implementations internally to QML-specific itemviews or whatever.
svn path=/trunk/KDE/kdebase/apps/; revision=1193113
Diffstat (limited to 'src/views/dolphinview.h')
-rw-r--r--src/views/dolphinview.h39
1 files changed, 25 insertions, 14 deletions
diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h
index a06105cf3..5fcf1ab4d 100644
--- a/src/views/dolphinview.h
+++ b/src/views/dolphinview.h
@@ -43,6 +43,7 @@ typedef KIO::FileUndoManager::CommandType CommandType;
class DolphinColumnViewContainer;
class DolphinDetailsView;
+class DolphinDetailsViewExpander;
class DolphinIconsView;
class DolphinModel;
class DolphinSortFilterProxyModel;
@@ -53,7 +54,7 @@ class KDirLister;
class KUrl;
class ViewModeController;
class ViewProperties;
-class DolphinDetailsViewExpander;
+class QRegExp;
/**
* @short Represents a view for the directory content.
@@ -181,12 +182,9 @@ public:
bool supportsCategorizedSorting() const;
/**
- * Marks the items indicated by \p urls to get selected after the
- * directory DolphinView::url() has been loaded. Note that nothing
- * gets selected if no loading of a directory has been triggered
- * by DolphinView::setUrl() or DolphinView::reload().
+ * Returns the items of the view.
*/
- void markUrlsAsSelected(const QList<KUrl>& urls);
+ KFileItemList items() const;
/**
* Returns the selected items. The list is empty if no item has been
@@ -201,7 +199,19 @@ public:
*/
int selectedItemsCount() const;
- QItemSelectionModel* selectionModel() const;
+ /**
+ * Marks the items indicated by \p urls to get selected after the
+ * directory DolphinView::url() has been loaded. Note that nothing
+ * gets selected if no loading of a directory has been triggered
+ * by DolphinView::setUrl() or DolphinView::reload().
+ */
+ void markUrlsAsSelected(const QList<KUrl>& urls);
+
+ /**
+ * All items that match to the pattern \a pattern will get selected
+ * if \a enabled is true and deselected if \a enabled is false.
+ */
+ void setItemSelectionEnabled(const QRegExp& pattern, bool enabled);
/**
* Sets the zoom level to \a level. It is assured that the used
@@ -324,10 +334,8 @@ public:
*/
void saveState(QDataStream& stream);
- /**
- * Returns all the items in the current view.
- */
- KFileItemList allItems() const;
+ /** Returns true, if at least one item is selected. */
+ bool hasSelection() const;
public slots:
/**
@@ -349,9 +357,6 @@ public slots:
*/
void invertSelection();
- /** Returns true, if at least one item is selected. */
- bool hasSelection() const;
-
void clearSelection();
/**
@@ -712,6 +717,12 @@ private:
*/
void addNewFileNames(const QMimeData* mimeData);
+ /**
+ * Helper method for DolphinView::setItemSelectionEnabled(): Returns the selection for
+ * all items of \p parent that match with the regular expression defined by \p pattern.
+ */
+ QItemSelection childrenMatchingPattern(const QModelIndex& parent, const QRegExp& pattern) const;
+
private:
/**
* Abstracts the access to the different view implementations