#include <kparts/part.h>
#include <kfileitem.h>
+#include <kfileitemdelegate.h>
#include <kfileiconview.h>
#include <kio/job.h>
class DolphinController;
class FilterBar;
+class KFileItemDelegate;
class KUrl;
class KDirModel;
class UrlNavigator;
*/
void setUrlEditable(bool editable);
- /**
- * Returns the complete URL history. The index 0 indicates the oldest
- * history element.
- * @param index Output parameter which indicates the current
- * index of the location.
- */
- const QLinkedList<UrlNavigator::HistoryElem> urlHistory(int& index) const;
-
- /**
- * Returns true, if at least one item is selected.
- */
+ /** Returns true, if at least one item is selected. */
bool hasSelection() const;
+ void clearSelection();
+
/**
* Returns the selected items. The list is empty if no item has been
* selected.
*/
void rename(const KUrl& source, const QString& newName);
- /** Returns the status bar of the view. */
DolphinStatusBar* statusBar() const;
/**
/** Returns the current used sort order (Qt::Ascending or Qt::Descending). */
Qt::SortOrder sortOrder() const;
+ /** Sets the additional information which should be shown for the items. */
+ void setAdditionalInfo(KFileItemDelegate::AdditionalInformation info);
+
+ /** Returns the additional information which should be shown for the items. */
+ KFileItemDelegate::AdditionalInformation additionalInfo() const;
+
/** Refreshs the view settings by reading out the stored settings. */
void refreshSettings();
*/
void requestActivation();
+ /**
+ * Request of a selection change. The view will do its best to accomodate
+ * the request, but it is not guaranteed that all items in \a selection
+ * will actually get selected. The view will e.g. not select items which
+ * are not in the currently displayed folder.
+ */
+ void changeSelection(const KFileItemList& selection);
+
signals:
/** Is emitted if URL of the view has been changed to \a url. */
void urlChanged(const KUrl& url);
/** Is emitted if the sort order (ascending or descending) has been changed. */
void sortOrderChanged(Qt::SortOrder order);
+ /** Is emitted if the addtional information for an item has been changed. */
+ void additionalInfoChanged(KFileItemDelegate::AdditionalInformation info);
+
/**
* Is emitted if information of an item is requested to be shown e. g. in the sidebar.
* It the URL is empty, no item information request is pending.
void contentsMoved(int x, int y);
/**
- * Is emitted whenever the selection has been changed. The current selection can
- * be retrieved by mainWindow()->activeView()->selectedItems() or by
- * mainWindow()->activeView()->selectedUrls().
+ * Is emitted whenever the selection has been changed.
*/
- void selectionChanged();
+ void selectionChanged(const KFileItemList& selection);
/**
* Is emitted whenever the filter bar has been turned show or hidden.
*/
void updateItemCount();
+ /**
+ * 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);
+
/**
* Restores the x- and y-position of the contents if the
* current view is part of the history.
void openContextMenu(const QPoint& pos);
/**
- * Drops the URLs \a urls at the position \a pos.
- * The position is used to check whether the dropping
- * is done above an item or above the viewport.
+ * Drops the URLs \a urls to the index \a index. \a source
+ * indicates the widget where the dragging has been started from.
*/
void dropUrls(const KUrl::List& urls,
- const QPoint& pos);
+ const QModelIndex& index,
+ QWidget* source);
/**
* Drops the URLs \a urls at the
*/
void updateActivationState();
+ /** Applies an item effect to all cut items of the clipboard. */
+ void updateCutItems();
+
private:
void startDirLister(const KUrl& url, bool reload = false);
QString selectionStatusBarText() const;
/**
- * Creates a new view representing the given view mode (DolphinView::viewMode()).
+ * Creates a new view representing the given view mode (DolphinView::mode()).
* The current view will get deleted.
*/
void createView();
*/
QAbstractItemView* itemView() const;
+ /**
+ * Returns true if the index is valid and represents
+ * the column KDirModel::Name.
+ */
+ bool isValidNameIndex(const QModelIndex& index) const;
+
+ /**
+ * Returns true, if the item \a item has been cut into
+ * the clipboard.
+ */
+ bool isCutItem(const KFileItem& item) const;
+
+ /** Applies an item effect to all cut items. */
+ void applyCutItemEffect();
+
private:
+ /**
+ * Remembers the original pixmap for an item before
+ * the cut effect is applied.
+ */
+ struct CutItem {
+ KUrl url;
+ QPixmap pixmap;
+ };
+
bool m_showProgress;
+ bool m_blockContentsMovedSignal;
Mode m_mode;
int m_iconSize;
DolphinController* m_controller;
DolphinIconsView* m_iconsView;
DolphinDetailsView* m_detailsView;
+ KFileItemDelegate* m_fileItemDelegate;
FilterBar* m_filterBar;
DolphinStatusBar* m_statusBar;
KDirModel* m_dirModel;
DolphinDirLister* m_dirLister;
DolphinSortFilterProxyModel* m_proxyModel;
+
+ QList<CutItem> m_cutItemsCache;
};
#endif // _DOLPHINVIEW_H_