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