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