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