]> cloud.milkyroute.net Git - dolphin.git/blob - src/views/dolphinview.h
Merge branch 'Applications/19.08'
[dolphin.git] / src / views / dolphinview.h
1 /***************************************************************************
2 * Copyright (C) 2006-2009 by Peter Penz <peter.penz19@gmail.com> *
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 #ifndef DOLPHINVIEW_H
22 #define DOLPHINVIEW_H
23
24 #include "dolphintabwidget.h"
25 #include "dolphin_export.h"
26 #include "tooltips/tooltipmanager.h"
27
28 #include <KFileItem>
29 #include <KIO/Job>
30 #include <config-baloo.h>
31 #include <kio/fileundomanager.h>
32 #include <kparts/part.h>
33
34 #include <QMimeData>
35 #include <QUrl>
36 #include <QWidget>
37
38 typedef KIO::FileUndoManager::CommandType CommandType;
39 class QVBoxLayout;
40 class DolphinItemListView;
41 class KFileItemModel;
42 class KItemListContainer;
43 class KItemModelBase;
44 class KItemSet;
45 class ToolTipManager;
46 class VersionControlObserver;
47 class ViewProperties;
48 class QGraphicsSceneDragDropEvent;
49 class QRegExp;
50
51 /**
52 * @short Represents a view for the directory content.
53 *
54 * View modes for icons, compact and details are supported. It's
55 * possible to adjust:
56 * - sort order
57 * - sort type
58 * - show hidden files
59 * - show previews
60 * - enable grouping
61 */
62 class DOLPHIN_EXPORT DolphinView : public QWidget
63 {
64 Q_OBJECT
65
66 public:
67 /**
68 * Defines the view mode for a directory. The
69 * view mode is automatically updated if the directory itself
70 * defines a view mode (see class ViewProperties for details).
71 */
72 enum Mode
73 {
74 /**
75 * The items are shown as icons with a name-label below.
76 */
77 IconsView = 0,
78
79 /**
80 * The icon, the name and the size of the items are
81 * shown per default as a table.
82 */
83 DetailsView,
84
85 /**
86 * The items are shown as icons with the name-label aligned
87 * to the right side.
88 */
89 CompactView
90 };
91
92 /**
93 * @param url Specifies the content which should be shown.
94 * @param parent Parent widget of the view.
95 */
96 DolphinView(const QUrl& url, QWidget* parent);
97
98 ~DolphinView() override;
99
100 /**
101 * Returns the current active URL, where all actions are applied.
102 * The URL navigator is synchronized with this URL.
103 */
104 QUrl url() const;
105
106 /**
107 * If \a active is true, the view will marked as active. The active
108 * view is defined as view where all actions are applied to.
109 */
110 void setActive(bool active);
111 bool isActive() const;
112
113 /**
114 * Changes the view mode for the current directory to \a mode.
115 * If the view properties should be remembered for each directory
116 * (GeneralSettings::globalViewProps() returns false), then the
117 * changed view mode will be stored automatically.
118 */
119 void setMode(Mode mode);
120 Mode mode() const;
121
122 /**
123 * Turns on the file preview for the all files of the current directory,
124 * if \a show is true.
125 * If the view properties should be remembered for each directory
126 * (GeneralSettings::globalViewProps() returns false), then the
127 * preview setting will be stored automatically.
128 */
129 void setPreviewsShown(bool show);
130 bool previewsShown() const;
131
132 /**
133 * Shows all hidden files of the current directory,
134 * if \a show is true.
135 * If the view properties should be remembered for each directory
136 * (GeneralSettings::globalViewProps() returns false), then the
137 * show hidden file setting will be stored automatically.
138 */
139 void setHiddenFilesShown(bool show);
140 bool hiddenFilesShown() const;
141
142 /**
143 * Turns on sorting by groups if \a enable is true.
144 */
145 void setGroupedSorting(bool grouped);
146 bool groupedSorting() const;
147
148 /**
149 * Returns the items of the view.
150 */
151 KFileItemList items() const;
152
153 /**
154 * @return The number of items. itemsCount() is faster in comparison
155 * to items().count().
156 */
157 int itemsCount() const;
158
159 /**
160 * Returns the selected items. The list is empty if no item has been
161 * selected.
162 */
163 KFileItemList selectedItems() const;
164
165 /**
166 * Returns the number of selected items (this is faster than
167 * invoking selectedItems().count()).
168 */
169 int selectedItemsCount() const;
170
171 /**
172 * Marks the items indicated by \p urls to get selected after the
173 * directory DolphinView::url() has been loaded. Note that nothing
174 * gets selected if no loading of a directory has been triggered
175 * by DolphinView::setUrl() or DolphinView::reload().
176 */
177 void markUrlsAsSelected(const QList<QUrl> &urls);
178
179 /**
180 * Marks the item indicated by \p url to be scrolled to and as the
181 * current item after directory DolphinView::url() has been loaded.
182 */
183 void markUrlAsCurrent(const QUrl& url);
184
185 /**
186 * All items that match to the pattern \a pattern will get selected
187 * if \a enabled is true and deselected if \a enabled is false.
188 */
189 void selectItems(const QRegExp& pattern, bool enabled);
190
191 /**
192 * Sets the zoom level to \a level. It is assured that the used
193 * level is adjusted to be inside the range ZoomLevelInfo::minimumLevel() and
194 * ZoomLevelInfo::maximumLevel().
195 */
196 void setZoomLevel(int level);
197 int zoomLevel() const;
198
199 /**
200 * Resets the view's icon size to the default value
201 */
202 void resetZoomLevel();
203
204 void setSortRole(const QByteArray& role);
205 QByteArray sortRole() const;
206
207 void setSortOrder(Qt::SortOrder order);
208 Qt::SortOrder sortOrder() const;
209
210 /** Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */
211 void setSortFoldersFirst(bool foldersFirst);
212 bool sortFoldersFirst() const;
213
214 /** Sets the additional information which should be shown for the items. */
215 void setVisibleRoles(const QList<QByteArray>& roles);
216
217 /** Returns the additional information which should be shown for the items. */
218 QList<QByteArray> visibleRoles() const;
219
220 void reload();
221
222 /**
223 * Refreshes the view to get synchronized with the settings (e.g. icons size,
224 * font, ...).
225 */
226 void readSettings();
227
228 /**
229 * Saves the current settings (e.g. icons size, font, ..).
230 */
231 void writeSettings();
232
233 /**
234 * Filters the currently shown items by \a nameFilter. All items
235 * which contain the given filter string will be shown.
236 */
237 void setNameFilter(const QString& nameFilter);
238 QString nameFilter() const;
239
240 /**
241 * Filters the currently shown items by \a filters. All items
242 * whose content-type matches those given by the list of filters
243 * will be shown.
244 */
245 void setMimeTypeFilters(const QStringList& filters);
246 QStringList mimeTypeFilters() const;
247
248 /**
249 * Returns a textual representation of the state of the current
250 * folder or selected items, suitable for use in the status bar.
251 */
252 QString statusBarText() const;
253
254 /**
255 * Returns the version control actions that are provided for the items \p items.
256 * Usually the actions are presented in the context menu.
257 */
258 QList<QAction*> versionControlActions(const KFileItemList& items) const;
259
260 /**
261 * Returns the state of the paste action:
262 * first is whether the action should be enabled
263 * second is the text for the action
264 */
265 QPair<bool, QString> pasteInfo() const;
266
267 /**
268 * If \a tabsForFiles is true, the signal tabRequested() will also
269 * emitted also for files. Per default tabs for files is disabled
270 * and hence the signal tabRequested() will only be emitted for
271 * directories.
272 */
273 void setTabsForFilesEnabled(bool tabsForFiles);
274 bool isTabsForFilesEnabled() const;
275
276 /**
277 * Returns true if the current view allows folders to be expanded,
278 * i.e. presents a hierarchical view to the user.
279 */
280 bool itemsExpandable() const;
281
282 /**
283 * Restores the view state (current item, contents position, details view expansion state)
284 */
285 void restoreState(QDataStream& stream);
286
287 /**
288 * Saves the view state (current item, contents position, details view expansion state)
289 */
290 void saveState(QDataStream& stream);
291
292 /**
293 * Returns the root item which represents the current URL.
294 */
295 KFileItem rootItem() const;
296
297 /**
298 * Sets a context that is used for remembering the view-properties.
299 * Per default the context is empty and the path of the currently set URL
300 * is used for remembering the view-properties. Setting a custom context
301 * makes sense if specific types of URLs (e.g. search-URLs) should
302 * share common view-properties.
303 */
304 void setViewPropertiesContext(const QString& context);
305 QString viewPropertiesContext() const;
306
307 /**
308 * Checks if the given \a item can be opened as folder (e.g. archives).
309 * This function will also adjust the \a url (e.g. change the protocol).
310 * @return a valid and adjusted url if the item can be opened as folder,
311 * otherwise return an empty url.
312 */
313 static QUrl openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives = true);
314
315 public slots:
316 /**
317 * Changes the directory to \a url. If the current directory is equal to
318 * \a url, nothing will be done (use DolphinView::reload() instead).
319 */
320 void setUrl(const QUrl& url);
321
322 /**
323 * Selects all items.
324 * @see DolphinView::selectedItems()
325 */
326 void selectAll();
327
328 /**
329 * Inverts the current selection: selected items get unselected,
330 * unselected items get selected.
331 * @see DolphinView::selectedItems()
332 */
333 void invertSelection();
334
335 void clearSelection();
336
337 /**
338 * Triggers the renaming of the currently selected items, where
339 * the user must input a new name for the items.
340 */
341 void renameSelectedItems();
342
343 /**
344 * Moves all selected items to the trash.
345 */
346 void trashSelectedItems();
347
348 /**
349 * Deletes all selected items.
350 */
351 void deleteSelectedItems();
352
353 /**
354 * Copies all selected items to the clipboard and marks
355 * the items as cut.
356 */
357 void cutSelectedItems();
358
359 /** Copies all selected items to the clipboard. */
360 void copySelectedItems();
361
362 /** Pastes the clipboard data to this view. */
363 void paste();
364
365 /**
366 * Pastes the clipboard data into the currently selected
367 * folder. If the current selection is not exactly one folder, no
368 * paste operation is done.
369 */
370 void pasteIntoFolder();
371
372 /**
373 * Handles a drop of @p dropEvent onto widget @p dropWidget and destination @p destUrl
374 */
375 void dropUrls(const QUrl &destUrl, QDropEvent *dropEvent, QWidget *dropWidget);
376
377 void stopLoading();
378
379 /** Activates the view if the item list container gets focus. */
380 bool eventFilter(QObject* watched, QEvent* event) override;
381
382 signals:
383 /**
384 * Is emitted if the view has been activated by e. g. a mouse click.
385 */
386 void activated();
387
388 /** Is emitted if the URL of the view has been changed to \a url. */
389 void urlChanged(const QUrl& url);
390
391 /**
392 * Is emitted when clicking on an item with the left mouse button.
393 */
394 void itemActivated(const KFileItem& item);
395
396 /**
397 * Is emitted when multiple items have been activated by e. g.
398 * context menu open with.
399 */
400 void itemsActivated(const KFileItemList& items);
401
402 /**
403 * Is emitted if items have been added or deleted.
404 */
405 void itemCountChanged();
406
407 /**
408 * Is emitted if a new tab should be opened for the URL \a url.
409 */
410 void tabRequested(const QUrl& url, DolphinTabWidget::TabPlacement tabPlacement);
411
412 /**
413 * Is emitted if the view mode (IconsView, DetailsView,
414 * PreviewsView) has been changed.
415 */
416 void modeChanged(DolphinView::Mode current, DolphinView::Mode previous);
417
418 /** Is emitted if the 'show preview' property has been changed. */
419 void previewsShownChanged(bool shown);
420
421 /** Is emitted if the 'show hidden files' property has been changed. */
422 void hiddenFilesShownChanged(bool shown);
423
424 /** Is emitted if the 'grouped sorting' property has been changed. */
425 void groupedSortingChanged(bool groupedSorting);
426
427 /** Is emitted if the sorting by name, size or date has been changed. */
428 void sortRoleChanged(const QByteArray& role);
429
430 /** Is emitted if the sort order (ascending or descending) has been changed. */
431 void sortOrderChanged(Qt::SortOrder order);
432
433 /**
434 * Is emitted if the sorting of files and folders (separate with folders
435 * first or mixed) has been changed.
436 */
437 void sortFoldersFirstChanged(bool foldersFirst);
438
439 /** Is emitted if the additional information shown for this view has been changed. */
440 void visibleRolesChanged(const QList<QByteArray>& current,
441 const QList<QByteArray>& previous);
442
443 /** Is emitted if the zoom level has been changed by zooming in or out. */
444 void zoomLevelChanged(int current, int previous);
445
446 /**
447 * Is emitted if information of an item is requested to be shown e. g. in the panel.
448 * If item is null, no item information request is pending.
449 */
450 void requestItemInfo(const KFileItem& item);
451
452 /**
453 * Is emitted whenever the selection has been changed.
454 */
455 void selectionChanged(const KFileItemList& selection);
456
457 /**
458 * Is emitted if a context menu is requested for the item \a item,
459 * which is part of \a url. If the item is null, the context menu
460 * for the URL should be shown and the custom actions \a customActions
461 * will be added.
462 */
463 void requestContextMenu(const QPoint& pos,
464 const KFileItem& item,
465 const QUrl& url,
466 const QList<QAction*>& customActions);
467
468 /**
469 * Is emitted if an information message with the content \a msg
470 * should be shown.
471 */
472 void infoMessage(const QString& msg);
473
474 /**
475 * Is emitted if an error message with the content \a msg
476 * should be shown.
477 */
478 void errorMessage(const QString& msg);
479
480 /**
481 * Is emitted if an "operation completed" message with the content \a msg
482 * should be shown.
483 */
484 void operationCompletedMessage(const QString& msg);
485
486 /**
487 * Is emitted after DolphinView::setUrl() has been invoked and
488 * the current directory is loaded. If this signal is emitted,
489 * it is assured that the view contains already the correct root
490 * URL and property settings.
491 */
492 void directoryLoadingStarted();
493
494 /**
495 * Is emitted after the directory triggered by DolphinView::setUrl()
496 * has been loaded.
497 */
498 void directoryLoadingCompleted();
499
500 /**
501 * Is emitted after the directory loading triggered by DolphinView::setUrl()
502 * has been canceled.
503 */
504 void directoryLoadingCanceled();
505
506 /**
507 * Is emitted after DolphinView::setUrl() has been invoked and provides
508 * the information how much percent of the current directory have been loaded.
509 */
510 void directoryLoadingProgress(int percent);
511
512 /**
513 * Is emitted if the sorting is done asynchronously and provides the
514 * progress information of the sorting.
515 */
516 void directorySortingProgress(int percent);
517
518 /**
519 * Emitted when the file-item-model emits redirection.
520 * Testcase: fish://localhost
521 */
522 void redirection(const QUrl& oldUrl, const QUrl& newUrl);
523
524 /**
525 * Is emitted when the URL set by DolphinView::setUrl() represents a file.
526 * In this case no signal errorMessage() will be emitted.
527 */
528 void urlIsFileError(const QUrl& url);
529
530 /**
531 * Is emitted when the write state of the folder has been changed. The application
532 * should disable all actions like "Create New..." that depend on the write
533 * state.
534 */
535 void writeStateChanged(bool isFolderWritable);
536
537 /**
538 * Is emitted if the URL should be changed to the previous URL of the
539 * history (e.g. because the "back"-mousebutton has been pressed).
540 */
541 void goBackRequested();
542
543 /**
544 * Is emitted if the URL should be changed to the next URL of the
545 * history (e.g. because the "next"-mousebutton has been pressed).
546 */
547 void goForwardRequested();
548
549 /**
550 * Is emitted when the user wants to move the focus to another view.
551 */
552 void toggleActiveViewRequested();
553
554 /**
555 * Is emitted when the user clicks a tag or a link
556 * in the metadata widget of a tooltip.
557 */
558 void urlActivated(const QUrl& url);
559
560 protected:
561 /** Changes the zoom level if Control is pressed during a wheel event. */
562 void wheelEvent(QWheelEvent* event) override;
563
564 void hideEvent(QHideEvent* event) override;
565 bool event(QEvent* event) override;
566
567 private slots:
568 /**
569 * Marks the view as active (DolphinView:isActive() will return true)
570 * and emits the 'activated' signal if it is not already active.
571 */
572 void activate();
573
574 void slotItemActivated(int index);
575 void slotItemsActivated(const KItemSet& indexes);
576 void slotItemMiddleClicked(int index);
577 void slotItemContextMenuRequested(int index, const QPointF& pos);
578 void slotViewContextMenuRequested(const QPointF& pos);
579 void slotHeaderContextMenuRequested(const QPointF& pos);
580 void slotHeaderColumnWidthChangeFinished(const QByteArray& role, qreal current);
581 void slotItemHovered(int index);
582 void slotItemUnhovered(int index);
583 void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
584 void slotModelChanged(KItemModelBase* current, KItemModelBase* previous);
585 void slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons);
586 void slotRenameDialogRenamingFinished(const QList<QUrl>& urls);
587 void slotSelectedItemTextPressed(int index);
588
589 /*
590 * Is called when new items get pasted or dropped.
591 */
592 void slotItemCreated(const QUrl &url);
593 /*
594 * Is called after all pasted or dropped items have been copied to destination.
595 */
596 void slotPasteJobResult(KJob *job);
597
598 /**
599 * Emits the signal \a selectionChanged() with a small delay. This is
600 * because getting all file items for the selection can be an expensive
601 * operation. Fast selection changes are collected in this case and
602 * the signal is emitted only after no selection change has been done
603 * within a small delay.
604 */
605 void slotSelectionChanged(const KItemSet& current, const KItemSet& previous);
606
607 /**
608 * Is called by emitDelayedSelectionChangedSignal() and emits the
609 * signal \a selectionChanged() with all selected file items as parameter.
610 */
611 void emitSelectionChangedSignal();
612
613 /**
614 * Updates the view properties of the current URL to the
615 * sorting given by \a role.
616 */
617 void updateSortRole(const QByteArray& role);
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 * Indicates in the status bar that the delete operation
633 * of the job \a job has been finished.
634 */
635 void slotDeleteFileFinished(KJob* job);
636
637 /**
638 * Indicates in the status bar that the trash operation
639 * of the job \a job has been finished.
640 */
641 void slotTrashFileFinished(KJob* job);
642
643 /**
644 * Invoked when the rename job is done, for error handling.
645 */
646 void slotRenamingResult(KJob* job);
647
648 /**
649 * Invoked when the file item model has started the loading
650 * of the directory specified by DolphinView::url().
651 */
652 void slotDirectoryLoadingStarted();
653
654 /**
655 * Invoked when the file item model indicates that the loading of a directory has
656 * been completed. Assures that pasted items and renamed items get selected.
657 */
658 void slotDirectoryLoadingCompleted();
659
660 /**
661 * Is invoked when items of KFileItemModel have been changed.
662 */
663 void slotItemsChanged();
664
665 /**
666 * Is invoked when the sort order has been changed by the user by clicking
667 * on a header item. The view properties of the directory will get updated.
668 */
669 void slotSortOrderChangedByHeader(Qt::SortOrder current, Qt::SortOrder previous);
670
671 /**
672 * Is invoked when the sort role has been changed by the user by clicking
673 * on a header item. The view properties of the directory will get updated.
674 */
675 void slotSortRoleChangedByHeader(const QByteArray& current, const QByteArray& previous);
676
677 /**
678 * Is invoked when the visible roles have been changed by the user by dragging
679 * a header item. The view properties of the directory will get updated.
680 */
681 void slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
682 const QList<QByteArray>& previous);
683
684 void slotRoleEditingCanceled();
685 void slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value);
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 assured that the item stays visible.
691 */
692 void observeCreatedItem(const QUrl &url);
693
694 /**
695 * Called when a redirection happens.
696 * Testcase: fish://localhost
697 */
698 void slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl);
699
700 /**
701 * Applies the state that has been restored by restoreViewState()
702 * to the view.
703 */
704 void updateViewState();
705
706 /**
707 * Calculates the number of currently shown files into
708 * \a fileCount and the number of folders into \a folderCount.
709 * The size of all files is written into \a totalFileSize.
710 * It is recommend using this method instead of asking the
711 * directory lister or the model directly, as it takes
712 * filtering and hierarchical previews into account.
713 */
714 void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
715
716 void slotTwoClicksRenamingTimerTimeout();
717
718 private:
719 void loadDirectory(const QUrl& url, bool reload = false);
720
721 /**
722 * Applies the view properties which are defined by the current URL
723 * to the DolphinView properties. The view properties are read from a
724 * .directory file either in the current directory, or in the
725 * share/apps/dolphin/view_properties/ subfolder of the user's .kde folder.
726 */
727 void applyViewProperties();
728
729 /**
730 * Applies the given view properties to the DolphinView.
731 */
732 void applyViewProperties(const ViewProperties& props);
733
734 /**
735 * Applies the m_mode property to the corresponding
736 * itemlayout-property of the KItemListView.
737 */
738 void applyModeToView();
739
740 /**
741 * Hides tooltip displayed over element.
742 */
743 void hideToolTip(const ToolTipManager::HideBehavior behavior = ToolTipManager::HideBehavior::Later);
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 QUrl& url);
750
751 /**
752 * Returns a list of URLs for all selected items. The list is
753 * simplified, so that when the URLs are part of different tree
754 * levels, only the parent is returned.
755 */
756 QList<QUrl> simplifiedSelectedUrls() const;
757
758 /**
759 * Returns the MIME data for all selected items.
760 */
761 QMimeData* selectionMimeData() const;
762
763 /**
764 * Updates m_isFolderWritable dependent on whether the folder represented by
765 * the current URL is writable. If the state has changed, the signal
766 * writeableStateChanged() will be emitted.
767 */
768 void updateWritableState();
769
770 /**
771 * @return The current URL if no viewproperties-context is given (see
772 * DolphinView::viewPropertiesContext(), otherwise the context
773 * is returned.
774 */
775 QUrl viewPropertiesUrl() const;
776
777 /**
778 * Clears the selection and updates current item and selection according to the parameters
779 *
780 * @param current URL to be set as current
781 * @param selected list of selected items
782 */
783 void forceUrlsSelection(const QUrl& current, const QList<QUrl>& selected);
784
785 void abortTwoClicksRenaming();
786
787 private:
788 void updatePalette();
789
790 bool m_active;
791 bool m_tabsForFiles;
792 bool m_assureVisibleCurrentIndex;
793 bool m_isFolderWritable;
794 bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
795 // tooltip may be shown when hovering an item.
796
797 QUrl m_url;
798 QString m_viewPropertiesContext;
799 Mode m_mode;
800 QList<QByteArray> m_visibleRoles;
801
802 QVBoxLayout* m_topLayout;
803
804 KFileItemModel* m_model;
805 DolphinItemListView* m_view;
806 KItemListContainer* m_container;
807
808 ToolTipManager* m_toolTipManager;
809
810 QTimer* m_selectionChangedTimer;
811
812 QUrl m_currentItemUrl; // Used for making the view to remember the current URL after F5
813 bool m_scrollToCurrentItem; // Used for marking we need to scroll to current item or not
814 QPoint m_restoredContentsPosition;
815
816 QList<QUrl> m_selectedUrls; // Used for making the view to remember selections after F5
817 bool m_clearSelectionBeforeSelectingNewItems;
818 bool m_markFirstNewlySelectedItemAsCurrent;
819
820 VersionControlObserver* m_versionControlObserver;
821
822 QTimer* m_twoClicksRenamingTimer;
823 QUrl m_twoClicksRenamingItemUrl;
824
825 // For unit tests
826 friend class TestBase;
827 friend class DolphinDetailsViewTest;
828 friend class DolphinPart; // Accesses m_model
829 };
830
831 /// Allow using DolphinView::Mode in QVariant
832 Q_DECLARE_METATYPE(DolphinView::Mode)
833
834 #endif // DOLPHINVIEW_H