]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincolumnview.h
* Use Nepomuk for getting the meta data instead of KFileMetaInfo.
[dolphin.git] / src / dolphincolumnview.h
index 0030c69ce01ba4c6ed8436de7dd785cf60d38c6a..caa54eab84aba56b7d42198e692bda640ea10c56 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef DOLPHINCOLUMNVIEW_H
 #define DOLPHINCOLUMNVIEW_H
 
+#include "dolphinview.h"
+
 #include <kurl.h>
 
 #include <QAbstractItemView>
@@ -48,8 +50,19 @@ public:
     explicit DolphinColumnView(QWidget* parent, DolphinController* controller);
     virtual ~DolphinColumnView();
 
+    /** @see QAbstractItemView::indexAt() */
     virtual QModelIndex indexAt(const QPoint& point) const;
+
+    /**
+     * Returns the item on the position \a pos. The KFileItem instance
+     * is null if no item is below the position.
+     */
+    KFileItem itemAt(const QPoint& point) const;
+
+    /** @see QAbstractItemView::scrollTo() */
     virtual void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible);
+
+    /** @see QAbstractItemView::visualRect() */
     virtual QRect visualRect(const QModelIndex& index) const;
 
     /** Inverts the selection of the currently active column. */
@@ -89,10 +102,34 @@ public:
      */
     void showColumn(const KUrl& url);
 
+    /**
+     * Does an inline editing for the item \a item
+     * inside the active column.
+     */
+    void editItem(const KFileItem& item);
+
+    /**
+     * Returns the selected items of the active column.
+     */
+    KFileItemList selectedItems() const;
+    
+    /**
+     * Returns the MIME data for the selected items
+     * of the active column.
+     */
+    QMimeData* selectionMimeData() const;
+
 public slots:
     /** @see QAbstractItemView::selectAll() */
     virtual void selectAll();
 
+signals:
+    /**
+     * Requests that the given column be deleted at the discretion
+     * of the receiver of the signal.
+     */
+    void requestColumnDeletion(QAbstractItemView* column);
+
 protected:
     virtual bool isIndexHidden(const QModelIndex& index) const;
     virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers);
@@ -103,12 +140,10 @@ protected:
 
     virtual void mousePressEvent(QMouseEvent* event);
     virtual void resizeEvent(QResizeEvent* event);
-    virtual void setSelectionModel ( QItemSelectionModel * selectionModel );
-    virtual void setModel ( QAbstractItemModel * model );
+    virtual void wheelEvent(QWheelEvent* event);
 
 private slots:
-    void zoomIn();
-    void zoomOut();
+    void setZoomLevel(int level);
 
     /**
      * Moves the content of the columns view to represent
@@ -122,7 +157,7 @@ private slots:
      * will get informed about possible zoom in/zoom out
      * operations.
      */
-    void updateDecorationSize();
+    void updateDecorationSize(bool showPreview);
 
     /**
      * Updates the background color of the columns to respect
@@ -130,13 +165,12 @@ private slots:
      */
     void updateColumnsBackground(bool active);
 
+    void slotSortingChanged(DolphinView::Sorting sorting);
+    void slotSortOrderChanged(Qt::SortOrder order);
     void slotShowHiddenFilesChanged();
     void slotShowPreviewChanged();
 
 private:
-    bool isZoomInPossible() const;
-    bool isZoomOutPossible() const;
-
     DolphinColumnWidget* activeColumn() const;
 
     /**
@@ -166,6 +200,18 @@ private:
     /** Removes all columns except of the root column. */
     void removeAllColumns();
 
+    /**
+     * Returns the position of the point \a point relative to the column
+     * \a column.
+     */
+    QPoint columnPosition(DolphinColumnWidget* column, const QPoint& point) const;
+
+    /**
+     * Deletes the column. If the itemview of the controller is set to the column,
+     * the controllers itemview is set to 0.
+     */
+    void deleteColumn(DolphinColumnWidget* column);
+
 private:
     DolphinController* m_controller;
     bool m_active;