X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/e46003aca365ca66ce7c7cccd47fb52d1da2fb91..b1c9b5126d:/src/dolphincolumnwidget.h diff --git a/src/dolphincolumnwidget.h b/src/dolphincolumnwidget.h index e8fea3bf5..916bfac2e 100644 --- a/src/dolphincolumnwidget.h +++ b/src/dolphincolumnwidget.h @@ -20,7 +20,11 @@ #ifndef DOLPHINCOLUMNWIDGET_H #define DOLPHINCOLUMNWIDGET_H +#include "dolphinview.h" + +#include #include +#include #include #include @@ -28,9 +32,14 @@ class DolphinColumnView; class DolphinModel; class DolphinSortFilterProxyModel; -class KDirLister; +class DolphinDirLister; +class DolphinViewAutoScroller; +class KFilePreviewGenerator; +class KJob; class KFileItem; class KFileItemList; +class SelectionManager; +class ToolTipManager; class QPixmap; /** @@ -75,6 +84,8 @@ public: /** Reloads the directory DolphinColumnWidget::url(). */ void reload(); + void setSorting(DolphinView::Sorting sorting); + void setSortOrder(Qt::SortOrder order); void setShowHiddenFiles(bool show); void setShowPreview(bool show); @@ -90,6 +101,24 @@ public: */ void setNameFilter(const QString& nameFilter); + /** + * Does an inline editing for the item \a item. + */ + void editItem(const KFileItem& item); + + /** + * Returns the item on the position \a pos. The KFileItem instance + * is null if no item is below the position. + */ + KFileItem itemAt(const QPoint& pos) const; + + KFileItemList selectedItems() const; + + /** + * Returns the MIME data for the selected items. + */ + QMimeData* selectionMimeData() const; + protected: virtual QStyleOptionViewItem viewOptions() const; virtual void startDrag(Qt::DropActions supportedActions); @@ -101,30 +130,17 @@ protected: virtual void mousePressEvent(QMouseEvent* event); virtual void keyPressEvent(QKeyEvent* event); virtual void contextMenuEvent(QContextMenuEvent* event); + virtual void wheelEvent(QWheelEvent* event); + virtual void leaveEvent(QEvent* event); virtual void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected); + virtual void currentChanged(const QModelIndex& current, const QModelIndex& previous); private slots: - /** - * If the item specified by \a index is a directory, then this - * directory will be loaded in a new column. If the item is a - * file, the corresponding application will get started. - */ - void triggerItem(const QModelIndex& index); - - /** - * Generates a preview image for each file item in \a items. - * The current preview settings (maximum size, 'Show Preview' menu) - * are respected. - */ - void generatePreviews(const KFileItemList& items); - - /** - * Replaces the icon of the item \a item by the preview pixmap - * \a pixmap. - */ - void showPreview(const KFileItem& item, const QPixmap& pixmap); - void slotEntered(const QModelIndex& index); + void slotClicked(const QModelIndex& index); + void slotDoubleClicked(const QModelIndex& index); + void requestActivation(); + void updateFont(); private: /** Used by DolphinColumnWidget::setActive(). */ @@ -133,27 +149,28 @@ private: /** Used by DolphinColumnWidget::setActive(). */ void deactivate(); - /** - * Returns true, if the item \a item has been cut into - * the clipboard. - */ - bool isCutItem(const KFileItem& item) const; - - KFileItem itemForIndex(const QModelIndex& index) const; - private: bool m_active; - bool m_showPreview; DolphinColumnView* m_view; + SelectionManager* m_selectionManager; + DolphinViewAutoScroller* m_autoScroller; KUrl m_url; // URL of the directory that is shown KUrl m_childUrl; // URL of the next column that is shown - QStyleOptionViewItem m_viewOptions; - KDirLister* m_dirLister; + + QFont m_font; + QSize m_decorationSize; + + DolphinDirLister* m_dirLister; DolphinModel* m_dolphinModel; DolphinSortFilterProxyModel* m_proxyModel; - bool m_dragging; // TODO: remove this property when the issue #160611 is solved in Qt 4.4 - QRect m_dropRect; // TODO: remove this property when the issue #160611 is solved in Qt 4.4 + KFilePreviewGenerator* m_previewGenerator; + + ToolTipManager* m_toolTipManager; + + QRect m_dropRect; + + friend class DolphinColumnView; }; inline bool DolphinColumnWidget::isActive() const @@ -184,9 +201,4 @@ inline const KUrl& DolphinColumnWidget::url() const return m_url; } -inline QStyleOptionViewItem DolphinColumnWidget::viewOptions() const -{ - return m_viewOptions; -} - #endif