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