]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinview.h
Same change as in r995015, but for usage in konq: Don't connect to KDirLister::itemDe...
[dolphin.git] / src / dolphinview.h
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
3 * Copyright (C) 2006 by Gregor Kališnik <gregor@podnapisi.net> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
20
21
22 #ifndef DOLPHINVIEW_H
23 #define DOLPHINVIEW_H
24
25 #include <config-nepomuk.h>
26
27 #include "libdolphin_export.h"
28
29 #include <kparts/part.h>
30 #include <kfileitem.h>
31 #include <kfileitemdelegate.h>
32 #include <kio/fileundomanager.h>
33 #include <kio/job.h>
34
35 #include <QBoxLayout>
36 #include <QKeyEvent>
37 #include <QLinkedList>
38 #include <QListView>
39 #include <QSet>
40 #include <QWidget>
41
42 typedef KIO::FileUndoManager::CommandType CommandType;
43
44 class DolphinController;
45 class DolphinColumnView;
46 class DolphinDetailsView;
47 class DolphinFileItemDelegate;
48 class DolphinIconsView;
49 class DolphinMainWindow;
50 class DolphinModel;
51 class DolphinSortFilterProxyModel;
52 class KFilePreviewGenerator;
53 class KAction;
54 class KActionCollection;
55 class KDirLister;
56 class KUrl;
57 class KToggleAction;
58 class ToolTipManager;
59 class QModelIndex;
60 class ViewProperties;
61
62 /**
63 * @short Represents a view for the directory content.
64 *
65 * View modes for icons, details and columns are supported. It's
66 * possible to adjust:
67 * - sort order
68 * - sort type
69 * - show hidden files
70 * - show previews
71 *
72 * @see DolphinIconsView
73 * @see DolphinDetailsView
74 * @see DolphinColumnView
75 */
76 class LIBDOLPHINPRIVATE_EXPORT DolphinView : public QWidget
77 {
78 Q_OBJECT
79
80 public:
81 /**
82 * Defines the view mode for a directory. The view mode
83 * can be defined when constructing a DolphinView. The
84 * view mode is automatically updated if the directory itself
85 * defines a view mode (see class ViewProperties for details).
86 */
87 enum Mode
88 {
89 /**
90 * The directory items are shown as icons including an
91 * icon name.
92 */
93 IconsView = 0,
94
95 /**
96 * The icon, the name and at least the size of the directory
97 * items are shown in a table. It is possible to add columns
98 * for date, group and permissions.
99 */
100 DetailsView = 1,
101
102 /**
103 * Each folder is shown in a separate column.
104 */
105 ColumnView = 2,
106 MaxModeEnum = ColumnView
107 };
108
109 /** Defines the sort order for the items of a directory. */
110 enum Sorting
111 {
112 SortByName = 0,
113 SortBySize,
114 SortByDate,
115 SortByPermissions,
116 SortByOwner,
117 SortByGroup,
118 SortByType,
119 SortByRating,
120 SortByTags,
121 MaxSortEnum = SortByTags
122 };
123
124 /**
125 * @param parent Parent widget of the view.
126 * @param url Specifies the content which should be shown.
127 * @param dirLister Used directory lister. The lister is not owned
128 * by the view and won't get deleted.
129 * @param dolphinModel Used directory model. The model is not owned
130 * by the view and won't get deleted.
131 * @param proxyModel Used proxy model which specifies the sorting. The
132 * model is not owned by the view and won't get
133 * deleted.
134 */
135 DolphinView(QWidget* parent,
136 const KUrl& url,
137 KDirLister* dirLister,
138 DolphinModel* dolphinModel,
139 DolphinSortFilterProxyModel* proxyModel);
140
141 virtual ~DolphinView();
142
143 /**
144 * Returns the current active URL, where all actions are applied.
145 * The URL navigator is synchronized with this URL.
146 */
147 const KUrl& url() const;
148
149 /**
150 * Returns the root URL of the view, which is defined as the first
151 * visible path of DolphinView::url(). Usually the root URL is
152 * equal to DolphinView::url(), but in the case of the column view
153 * when 2 columns are shown, the root URL might be:
154 * /home/peter/Documents
155 * and DolphinView::url() might return
156 * /home/peter/Documents/Music/
157 */
158 KUrl rootUrl() const;
159
160 /**
161 * If \a active is true, the view will marked as active. The active
162 * view is defined as view where all actions are applied to.
163 */
164 void setActive(bool active);
165 bool isActive() const;
166
167 /**
168 * Changes the view mode for the current directory to \a mode.
169 * If the view properties should be remembered for each directory
170 * (GeneralSettings::globalViewProps() returns false), then the
171 * changed view mode will be stored automatically.
172 */
173 void setMode(Mode mode);
174 Mode mode() const;
175
176 /** See setShowPreview */
177 bool showPreview() const;
178
179 /** See setShowHiddenFiles */
180 bool showHiddenFiles() const;
181
182 /** See setCategorizedSorting */
183 bool categorizedSorting() const;
184
185 /**
186 * Returns true, if the categorized sorting is supported by the current
187 * used mode (see DolphinView::setMode()). Currently only DolphinView::IconsView
188 * supports categorizations. To check whether the categorized
189 * sorting is set, use DolphinView::categorizedSorting().
190 */
191 bool supportsCategorizedSorting() const;
192
193 /**
194 * Selects all items.
195 * @see DolphinView::selectedItems()
196 */
197 void selectAll();
198
199 /**
200 * Inverts the current selection: selected items get unselected,
201 * unselected items get selected.
202 * @see DolphinView::selectedItems()
203 */
204 void invertSelection();
205
206 /** Returns true, if at least one item is selected. */
207 bool hasSelection() const;
208
209 void clearSelection();
210
211 /**
212 * Returns the selected items. The list is empty if no item has been
213 * selected.
214 * @see DolphinView::selectedUrls()
215 */
216 KFileItemList selectedItems() const;
217
218 /**
219 * Returns a list of URLs for all selected items. An empty list
220 * is returned, if no item is selected.
221 * @see DolphinView::selectedItems()
222 */
223 KUrl::List selectedUrls() const;
224
225 /**
226 * Returns the number of selected items (this is faster than
227 * invoking selectedItems().count()).
228 */
229 int selectedItemsCount() const;
230
231 /**
232 * Sets the upper left position of the view content
233 * to (x,y). The content of the view might be larger than the visible area
234 * and hence a scrolling must be done.
235 */
236 void setContentsPosition(int x, int y);
237
238 /** Returns the upper left position of the view content. */
239 QPoint contentsPosition() const;
240
241 /**
242 * Sets the zoom level to \a level. It is assured that the used
243 * level is adjusted to be inside the range ZoomLevelInfo::minimumLevel() and
244 * ZoomLevelInfo::maximumLevel().
245 */
246 void setZoomLevel(int level);
247 int zoomLevel() const;
248
249 /**
250 * Returns true, if zooming in is possible. If false is returned,
251 * the maximum zooming level has been reached.
252 */
253 bool isZoomInPossible() const;
254
255 /**
256 * Returns true, if zooming out is possible. If false is returned,
257 * the minimum zooming level has been reached.
258 */
259 bool isZoomOutPossible() const;
260
261 /** Sets the sort order of the items inside a directory (see DolphinView::Sorting). */
262 void setSorting(Sorting sorting);
263
264 /** Returns the sort order of the items inside a directory (see DolphinView::Sorting). */
265 Sorting sorting() const;
266
267 /** Sets the sort order (Qt::Ascending or Qt::Descending) for the items. */
268 void setSortOrder(Qt::SortOrder order);
269
270 /** Returns the current used sort order (Qt::Ascending or Qt::Descending). */
271 Qt::SortOrder sortOrder() const;
272
273 /** Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */
274 void setSortFoldersFirst(bool foldersFirst);
275
276 /** Returns if files and folders are sorted separately or not. */
277 bool sortFoldersFirst() const;
278
279 /** Sets the additional information which should be shown for the items. */
280 void setAdditionalInfo(KFileItemDelegate::InformationList info);
281
282 /** Returns the additional information which should be shown for the items. */
283 KFileItemDelegate::InformationList additionalInfo() const;
284
285 /** Reloads the current directory. */
286 void reload();
287
288 /**
289 * Refreshes the view to get synchronized with the (updated) Dolphin settings.
290 * This method only needs to get invoked if the view settings for the Icons View,
291 * Details View or Columns View have been changed.
292 */
293 void refresh();
294
295 /**
296 * Changes the directory of the view to \a url. If \a rootUrl is empty, the view
297 * properties from \a url are used for adjusting the view mode and the other properties.
298 * If \a rootUrl is not empty, the view properties from the root URL are considered
299 * instead. Specifying a root URL is only required if a view having a different root URL
300 * (e. g. the column view) should be restored. Usually using DolphinView::setUrl()
301 * is enough for changing the current URL.
302 */
303 void updateView(const KUrl& url, const KUrl& rootUrl);
304
305 /**
306 * Filters the currently shown items by \a nameFilter. All items
307 * which contain the given filter string will be shown.
308 */
309 void setNameFilter(const QString& nameFilter);
310
311 /**
312 * Calculates the number of currently shown files into
313 * \a fileCount and the number of folders into \a folderCount.
314 * The size of all files is written into \a totalFileSize.
315 * It is recommend using this method instead of asking the
316 * directory lister or the model directly, as it takes
317 * filtering and hierarchical previews into account.
318 */
319 void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
320
321 /**
322 * Returns a textual representation of the state of the current
323 * folder or selected items, suitable for use in the status bar.
324 */
325 QString statusBarText() const;
326
327 /**
328 * Updates the state of the 'Additional Information' actions in \a collection.
329 */
330 void updateAdditionalInfoActions(KActionCollection* collection);
331
332 /**
333 * Returns the state of the paste action:
334 * first is whether the action should be enabled
335 * second is the text for the action
336 */
337 QPair<bool, QString> pasteInfo() const;
338
339 /**
340 * If \a tabsForFiles is true, the signal tabRequested() will also
341 * emitted also for files. Per default tabs for files is disabled
342 * and hence the signal tabRequested() will only be emitted for
343 * directories.
344 */
345 void setTabsForFilesEnabled(bool tabsForFiles);
346 bool isTabsForFilesEnabled() const;
347
348 /**
349 * Marks the item \a url as active item as soon as it has
350 * been loaded by the directory lister. This is useful mark
351 * the previously visited directory as active when going
352 * back in history (the URL is known, but the item is not
353 * loaded yet).
354 */
355 void activateItem(const KUrl& url);
356
357 /**
358 * Returns true if the current view allows folders to be expanded,
359 * i.e. presents a hierarchical view to the user.
360 */
361 bool itemsExpandable() const;
362
363 public slots:
364 /**
365 * Changes the directory to \a url. If the current directory is equal to
366 * \a url, nothing will be done (use DolphinView::reload() instead).
367 */
368 void setUrl(const KUrl& url);
369
370 /**
371 * Request of a selection change. The view will do its best to accommodate
372 * the request, but it is not guaranteed that all items in \a selection
373 * will actually get selected. The view will e.g. not select items which
374 * are not in the currently displayed folder.
375 */
376 void changeSelection(const KFileItemList& selection);
377
378 /**
379 * Triggers the renaming of the currently selected items, where
380 * the user must input a new name for the items.
381 */
382 void renameSelectedItems();
383
384 /**
385 * Moves all selected items to the trash.
386 */
387 void trashSelectedItems();
388
389 /**
390 * Deletes all selected items.
391 */
392 void deleteSelectedItems();
393
394 /**
395 * Copies all selected items to the clipboard and marks
396 * the items as cutted.
397 */
398 void cutSelectedItems();
399
400 /** Copies all selected items to the clipboard. */
401 void copySelectedItems();
402
403 /** Pastes the clipboard data to this view. */
404 void paste();
405
406 /**
407 * Pastes the clipboard data into the currently selected
408 * folder. If the current selection is not exactly one folder, no
409 * paste operation is done.
410 */
411 void pasteIntoFolder();
412
413 /**
414 * Turns on the file preview for the all files of the current directory,
415 * if \a show is true.
416 * If the view properties should be remembered for each directory
417 * (GeneralSettings::globalViewProps() returns false), then the
418 * preview setting will be stored automatically.
419 */
420 void setShowPreview(bool show);
421
422 /**
423 * Shows all hidden files of the current directory,
424 * if \a show is true.
425 * If the view properties should be remembered for each directory
426 * (GeneralSettings::globalViewProps() returns false), then the
427 * show hidden file setting will be stored automatically.
428 */
429 void setShowHiddenFiles(bool show);
430
431 /**
432 * Summarizes all sorted items by their category \a categorized
433 * is true.
434 * If the view properties should be remembered for each directory
435 * (GeneralSettings::globalViewProps() returns false), then the
436 * categorized sorting setting will be stored automatically.
437 */
438 void setCategorizedSorting(bool categorized);
439
440 /** Switches between an ascending and descending sorting order. */
441 void toggleSortOrder();
442
443 /** Switches between a separate sorting (with folders first) and a mixed sorting of files and folders. */
444 void toggleSortFoldersFirst();
445
446 /**
447 * Switches on or off the displaying of additional information
448 * as specified by \a action.
449 */
450 void toggleAdditionalInfo(QAction* action);
451
452 signals:
453 /**
454 * Is emitted if the view has been activated by e. g. a mouse click.
455 */
456 void activated();
457
458 /** Is emitted if URL of the view has been changed to \a url. */
459 void urlChanged(const KUrl& url);
460
461 /**
462 * Is emitted if the view requests a changing of the current
463 * URL to \a url (see DolphinController::triggerUrlChangeRequest()).
464 */
465 void requestUrlChange(const KUrl& url);
466
467 /**
468 * Is emitted when clicking on an item with the left mouse button.
469 */
470 void itemTriggered(const KFileItem& item);
471
472 /**
473 * Is emitted if a new tab should be opened for the URL \a url.
474 */
475 void tabRequested(const KUrl& url);
476
477 /**
478 * Is emitted if the view mode (IconsView, DetailsView,
479 * PreviewsView) has been changed.
480 */
481 void modeChanged();
482
483 /** Is emitted if the 'show preview' property has been changed. */
484 void showPreviewChanged();
485
486 /** Is emitted if the 'show hidden files' property has been changed. */
487 void showHiddenFilesChanged();
488
489 /** Is emitted if the 'categorized sorting' property has been changed. */
490 void categorizedSortingChanged();
491
492 /** Is emitted if the sorting by name, size or date has been changed. */
493 void sortingChanged(DolphinView::Sorting sorting);
494
495 /** Is emitted if the sort order (ascending or descending) has been changed. */
496 void sortOrderChanged(Qt::SortOrder order);
497
498 /** Is emitted if the sorting of files and folders (separate with folders first or mixed) has been changed. */
499 void sortFoldersFirstChanged(bool foldersFirst);
500
501 /** Is emitted if the additional information shown for this view has been changed. */
502 void additionalInfoChanged();
503
504 /** Is emitted if the zoom level has been changed by zooming in or out. */
505 void zoomLevelChanged(int level);
506
507 /**
508 * Is emitted if information of an item is requested to be shown e. g. in the panel.
509 * If item is null, no item information request is pending.
510 */
511 void requestItemInfo(const KFileItem& item);
512
513 /** Is emitted if the contents has been moved to \a x, \a y. */
514 void contentsMoved(int x, int y);
515
516 /**
517 * Is emitted whenever the selection has been changed.
518 */
519 void selectionChanged(const KFileItemList& selection);
520
521 /**
522 * Is emitted if a context menu is requested for the item \a item,
523 * which is part of \a url. If the item is null, the context menu
524 * for the URL should be shown and the custom actions \a customActions
525 * will be added.
526 */
527 void requestContextMenu(const KFileItem& item,
528 const KUrl& url,
529 const QList<QAction*>& customActions);
530
531 /**
532 * Is emitted if an information message with the content \a msg
533 * should be shown.
534 */
535 void infoMessage(const QString& msg);
536
537 /**
538 * Is emitted if an error message with the content \a msg
539 * should be shown.
540 */
541 void errorMessage(const QString& msg);
542
543 /**
544 * Is emitted if an "operation completed" message with the content \a msg
545 * should be shown.
546 */
547 void operationCompletedMessage(const QString& msg);
548
549 /**
550 * Is emitted after DolphinView::setUrl() has been invoked and
551 * the path \a url is currently loaded. If this signal is emitted,
552 * it is assured that the view contains already the correct root
553 * URL and property settings.
554 */
555 void startedPathLoading(const KUrl& url);
556
557 /**
558 * Emitted when KDirLister emits redirection.
559 * Testcase: fish://localhost
560 */
561 void redirection(const KUrl& oldUrl, const KUrl& newUrl);
562
563 protected:
564 /** @see QWidget::mouseReleaseEvent */
565 virtual void mouseReleaseEvent(QMouseEvent* event);
566 virtual void wheelEvent(QWheelEvent* event);
567 virtual bool eventFilter(QObject* watched, QEvent* event);
568
569 private slots:
570 /**
571 * Marks the view as active (DolphinView:isActive() will return true)
572 * and emits the 'activated' signal if it is not already active.
573 */
574 void activate();
575
576 /**
577 * If the item \a item is a directory, then this
578 * directory will be loaded. If the item is a file, the corresponding
579 * application will get started.
580 */
581 void triggerItem(const KFileItem& index);
582
583 /**
584 * Emits the signal \a selectionChanged() with a small delay. This is
585 * because getting all file items for the signal can be an expensive
586 * operation. Fast selection changes are collected in this case and
587 * the signal is emitted only after no selection change has been done
588 * within a small delay.
589 */
590 void emitDelayedSelectionChangedSignal();
591
592 /**
593 * Is called by emitDelayedSelectionChangedSignal() and emits the
594 * signal \a selectionChanged() with all selected file items as parameter.
595 */
596 void emitSelectionChangedSignal();
597
598 /**
599 * Opens the context menu on position \a pos. The position
600 * is used to check whether the context menu is related to an
601 * item or to the viewport.
602 */
603 void openContextMenu(const QPoint& pos, const QList<QAction*>& customActions);
604
605 /**
606 * Drops dragged URLs to the destination path \a destPath. If
607 * the URLs are dropped above an item inside the destination path,
608 * the item is indicated by \a destItem.
609 */
610 void dropUrls(const KFileItem& destItem,
611 const KUrl& destPath,
612 QDropEvent* event);
613
614 /**
615 * Updates the view properties of the current URL to the
616 * sorting given by \a sorting.
617 */
618 void updateSorting(DolphinView::Sorting sorting);
619
620 /**
621 * Updates the view properties of the current URL to the
622 * sort order given by \a order.
623 */
624 void updateSortOrder(Qt::SortOrder order);
625
626 /**
627 * Updates the view properties of the current URL to the
628 * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
629 */
630 void updateSortFoldersFirst(bool foldersFirst);
631
632 /**
633 * Updates the view properties of the current URL to the
634 * additional information given by \a info.
635 */
636 void updateAdditionalInfo(const KFileItemDelegate::InformationList& info);
637
638 /**
639 * Emits the signal contentsMoved with the current coordinates
640 * of the viewport as parameters.
641 */
642 void emitContentsMoved();
643
644 /**
645 * Updates the status bar to show hover information for the
646 * item \a item. If currently other items are selected,
647 * no hover information is shown.
648 * @see DolphinView::clearHoverInformation()
649 */
650 void showHoverInformation(const KFileItem& item);
651
652 /**
653 * Clears the hover information shown in the status bar.
654 * @see DolphinView::showHoverInformation().
655 */
656 void clearHoverInformation();
657
658 /**
659 * Indicates in the status bar that the delete operation
660 * of the job \a job has been finished.
661 */
662 void slotDeleteFileFinished(KJob* job);
663
664 /**
665 * Is emitted if the controller requests a changing of the current
666 * URL to \a url
667 */
668 void slotRequestUrlChange(const KUrl& url);
669
670 /**
671 * Invoked when the directory lister has completed the loading of
672 * items. Assures that pasted items and renamed items get seleced.
673 */
674 void slotDirListerCompleted();
675
676 /**
677 * Is invoked when the KDirLister indicates refreshed items.
678 */
679 void slotRefreshItems();
680
681 /**
682 * If \a view can be positively identified as not being the source for the
683 * current drag operation, deleteLater() it immediately. Else stores
684 * it for later deletion.
685 */
686 void deleteWhenNotDragSource(QAbstractItemView* view);
687
688 /**
689 * Observes the item with the URL \a url. As soon as the directory
690 * model indicates that the item is available, the item will
691 * get selected and it is assure that the item stays visible.
692 *
693 * @see selectAndScrollToCreatedItem()
694 */
695 void observeCreatedItem(const KUrl& url);
696
697 /**
698 * Selects and scrolls to the item that got observed
699 * by observeCreatedItem().
700 */
701 void selectAndScrollToCreatedItem();
702
703 /**
704 * Restore selection after view refresh.
705 */
706 void restoreSelection();
707
708 private:
709 void loadDirectory(const KUrl& url, bool reload = false);
710
711 /**
712 * Returns the URL where the view properties should be stored. Usually
713 * DolphinView::url() is returned, but in the case of a Column View the
714 * view properties are always stored in the directory represented by the
715 * first column. It is recommendend whenever using the ViewProperties class
716 * to use DolphinView::viewPropertiesUrl() as URL.
717 */
718 KUrl viewPropertiesUrl() const;
719
720 /**
721 * Applies the view properties which are defined by the current URL
722 * m_url to the DolphinView properties.
723 */
724 void applyViewProperties(const KUrl& url);
725
726 /**
727 * Creates a new view representing the given view mode (DolphinView::mode()).
728 * The current view will get deleted.
729 */
730 void createView();
731
732 void deleteView();
733
734 /**
735 * Returns a pointer to the currently used item view, which is either
736 * a ListView or a TreeView.
737 */
738 QAbstractItemView* itemView() const;
739
740 /**
741 * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
742 * Pastes the clipboard data into the URL \a url.
743 */
744 void pasteToUrl(const KUrl& url);
745
746 /**
747 * Checks whether the current item view has the same zoom level
748 * as \a oldZoomLevel. If this is not the case, the zoom level
749 * of the controller is updated and a zoomLevelChanged() signal
750 * is emitted.
751 */
752 void updateZoomLevel(int oldZoomLevel);
753
754 /**
755 * Returns a list of URLs for all selected items. The list is
756 * simplified, so that when the URLs are part of different tree
757 * levels, only the parent is returned.
758 */
759 KUrl::List simplifiedSelectedUrls() const;
760
761 /**
762 * Returns true, if the ColumnView is activated. As the column view
763 * requires some special handling for iterating through directories,
764 * this method has been introduced for convenience.
765 */
766 bool isColumnViewActive() const;
767
768 /**
769 * Returns the MIME data for all selected items.
770 */
771 QMimeData* selectionMimeData() const;
772
773 /**
774 * Is invoked after a paste operation or a drag & drop
775 * operation and adds the filenames of all URLs from \a mimeData to
776 * m_newFileNames. This allows to select all newly added
777 * items in slotDirListerCompleted().
778 */
779 void addNewFileNames(const QMimeData* mimeData);
780
781 private:
782 bool m_active : 1;
783 bool m_showPreview : 1;
784 bool m_loadingDirectory : 1;
785 bool m_storedCategorizedSorting : 1;
786 bool m_tabsForFiles : 1;
787 bool m_isContextMenuOpen : 1; // TODO: workaround for Qt-issue 207192
788 bool m_ignoreViewProperties : 1;
789 bool m_assureVisibleCurrentIndex : 1;
790
791 Mode m_mode;
792
793 DolphinMainWindow* m_mainWindow;
794 QVBoxLayout* m_topLayout;
795
796 DolphinController* m_controller;
797 DolphinIconsView* m_iconsView;
798 DolphinDetailsView* m_detailsView;
799 DolphinColumnView* m_columnView;
800 DolphinFileItemDelegate* m_fileItemDelegate;
801
802 QItemSelectionModel* m_selectionModel;
803 QTimer* m_selectionChangedTimer;
804
805 DolphinModel* m_dolphinModel;
806 KDirLister* m_dirLister;
807 DolphinSortFilterProxyModel* m_proxyModel;
808
809 KFilePreviewGenerator* m_previewGenerator;
810 ToolTipManager* m_toolTipManager;
811
812 KUrl m_rootUrl;
813 KUrl m_activeItemUrl;
814 KUrl m_createdItemUrl; // URL for a new item that got created by the "Create New..." menu
815 KFileItemList m_selectedItems; // this is used for making the View to remember selections after F5
816
817 /**
818 * Remembers the filenames that have been added by a paste operation
819 * or a drag & drop operation. Allows to select the items in
820 * slotDirListerCompleted().
821 */
822 QSet<QString> m_newFileNames;
823
824 QAbstractItemView* m_expandedDragSource;
825 };
826
827 inline bool DolphinView::isColumnViewActive() const
828 {
829 return m_columnView != 0;
830 }
831
832 /// Allow using DolphinView::Mode in QVariant
833 Q_DECLARE_METATYPE(DolphinView::Mode)
834
835 #endif // DOLPHINVIEW_H