]> 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 void setSortRole(const QByteArray& role);
200 QByteArray sortRole() const;
201
202 void setSortOrder(Qt::SortOrder order);
203 Qt::SortOrder sortOrder() const;
204
205 /** Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */
206 void setSortFoldersFirst(bool foldersFirst);
207 bool sortFoldersFirst() const;
208
209 /** Sets the additional information which should be shown for the items. */
210 void setVisibleRoles(const QList<QByteArray>& roles);
211
212 /** Returns the additional information which should be shown for the items. */
213 QList<QByteArray> visibleRoles() const;
214
215 void reload();
216
217 /**
218 * Refreshes the view to get synchronized with the settings (e.g. icons size,
219 * font, ...).
220 */
221 void readSettings();
222
223 /**
224 * Saves the current settings (e.g. icons size, font, ..).
225 */
226 void writeSettings();
227
228 /**
229 * Filters the currently shown items by \a nameFilter. All items
230 * which contain the given filter string will be shown.
231 */
232 void setNameFilter(const QString& nameFilter);
233 QString nameFilter() const;
234
235 /**
236 * Filters the currently shown items by \a filters. All items
237 * whose content-type matches those given by the list of filters
238 * will be shown.
239 */
240 void setMimeTypeFilters(const QStringList& filters);
241 QStringList mimeTypeFilters() const;
242
243 /**
244 * Returns a textual representation of the state of the current
245 * folder or selected items, suitable for use in the status bar.
246 */
247 QString statusBarText() const;
248
249 /**
250 * Returns the version control actions that are provided for the items \p items.
251 * Usually the actions are presented in the context menu.
252 */
253 QList<QAction*> versionControlActions(const KFileItemList& items) const;
254
255 /**
256 * Returns the state of the paste action:
257 * first is whether the action should be enabled
258 * second is the text for the action
259 */
260 QPair<bool, QString> pasteInfo() const;
261
262 /**
263 * If \a tabsForFiles is true, the signal tabRequested() will also
264 * emitted also for files. Per default tabs for files is disabled
265 * and hence the signal tabRequested() will only be emitted for
266 * directories.
267 */
268 void setTabsForFilesEnabled(bool tabsForFiles);
269 bool isTabsForFilesEnabled() const;
270
271 /**
272 * Returns true if the current view allows folders to be expanded,
273 * i.e. presents a hierarchical view to the user.
274 */
275 bool itemsExpandable() const;
276
277 /**
278 * Restores the view state (current item, contents position, details view expansion state)
279 */
280 void restoreState(QDataStream& stream);
281
282 /**
283 * Saves the view state (current item, contents position, details view expansion state)
284 */
285 void saveState(QDataStream& stream);
286
287 /**
288 * Returns the root item which represents the current URL.
289 */
290 KFileItem rootItem() const;
291
292 /**
293 * Sets a context that is used for remembering the view-properties.
294 * Per default the context is empty and the path of the currently set URL
295 * is used for remembering the view-properties. Setting a custom context
296 * makes sense if specific types of URLs (e.g. search-URLs) should
297 * share common view-properties.
298 */
299 void setViewPropertiesContext(const QString& context);
300 QString viewPropertiesContext() const;
301
302 /**
303 * Checks if the given \a item can be opened as folder (e.g. archives).
304 * This function will also adjust the \a url (e.g. change the protocol).
305 * @return a valid and adjusted url if the item can be opened as folder,
306 * otherwise return an empty url.
307 */
308 static QUrl openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives = true);
309
310 public slots:
311 /**
312 * Changes the directory to \a url. If the current directory is equal to
313 * \a url, nothing will be done (use DolphinView::reload() instead).
314 */
315 void setUrl(const QUrl& url);
316
317 /**
318 * Selects all items.
319 * @see DolphinView::selectedItems()
320 */
321 void selectAll();
322
323 /**
324 * Inverts the current selection: selected items get unselected,
325 * unselected items get selected.
326 * @see DolphinView::selectedItems()
327 */
328 void invertSelection();
329
330 void clearSelection();
331
332 /**
333 * Triggers the renaming of the currently selected items, where
334 * the user must input a new name for the items.
335 */
336 void renameSelectedItems();
337
338 /**
339 * Moves all selected items to the trash.
340 */
341 void trashSelectedItems();
342
343 /**
344 * Deletes all selected items.
345 */
346 void deleteSelectedItems();
347
348 /**
349 * Copies all selected items to the clipboard and marks
350 * the items as cut.
351 */
352 void cutSelectedItems();
353
354 /** Copies all selected items to the clipboard. */
355 void copySelectedItems();
356
357 /** Pastes the clipboard data to this view. */
358 void paste();
359
360 /**
361 * Pastes the clipboard data into the currently selected
362 * folder. If the current selection is not exactly one folder, no
363 * paste operation is done.
364 */
365 void pasteIntoFolder();
366
367 /**
368 * Handles a drop of @p dropEvent onto widget @p dropWidget and destination @p destUrl
369 */
370 void dropUrls(const QUrl &destUrl, QDropEvent *dropEvent, QWidget *dropWidget);
371
372 void stopLoading();
373
374 /** Activates the view if the item list container gets focus. */
375 bool eventFilter(QObject* watched, QEvent* event) override;
376
377 signals:
378 /**
379 * Is emitted if the view has been activated by e. g. a mouse click.
380 */
381 void activated();
382
383 /** Is emitted if the URL of the view has been changed to \a url. */
384 void urlChanged(const QUrl& url);
385
386 /**
387 * Is emitted when clicking on an item with the left mouse button.
388 */
389 void itemActivated(const KFileItem& item);
390
391 /**
392 * Is emitted when multiple items have been activated by e. g.
393 * context menu open with.
394 */
395 void itemsActivated(const KFileItemList& items);
396
397 /**
398 * Is emitted if items have been added or deleted.
399 */
400 void itemCountChanged();
401
402 /**
403 * Is emitted if a new tab should be opened for the URL \a url.
404 */
405 void tabRequested(const QUrl& url, DolphinTabWidget::TabPlacement tabPlacement);
406
407 /**
408 * Is emitted if the view mode (IconsView, DetailsView,
409 * PreviewsView) has been changed.
410 */
411 void modeChanged(DolphinView::Mode current, DolphinView::Mode previous);
412
413 /** Is emitted if the 'show preview' property has been changed. */
414 void previewsShownChanged(bool shown);
415
416 /** Is emitted if the 'show hidden files' property has been changed. */
417 void hiddenFilesShownChanged(bool shown);
418
419 /** Is emitted if the 'grouped sorting' property has been changed. */
420 void groupedSortingChanged(bool groupedSorting);
421
422 /** Is emitted if the sorting by name, size or date has been changed. */
423 void sortRoleChanged(const QByteArray& role);
424
425 /** Is emitted if the sort order (ascending or descending) has been changed. */
426 void sortOrderChanged(Qt::SortOrder order);
427
428 /**
429 * Is emitted if the sorting of files and folders (separate with folders
430 * first or mixed) has been changed.
431 */
432 void sortFoldersFirstChanged(bool foldersFirst);
433
434 /** Is emitted if the additional information shown for this view has been changed. */
435 void visibleRolesChanged(const QList<QByteArray>& current,
436 const QList<QByteArray>& previous);
437
438 /** Is emitted if the zoom level has been changed by zooming in or out. */
439 void zoomLevelChanged(int current, int previous);
440
441 /**
442 * Is emitted if information of an item is requested to be shown e. g. in the panel.
443 * If item is null, no item information request is pending.
444 */
445 void requestItemInfo(const KFileItem& item);
446
447 /**
448 * Is emitted whenever the selection has been changed.
449 */
450 void selectionChanged(const KFileItemList& selection);
451
452 /**
453 * Is emitted if a context menu is requested for the item \a item,
454 * which is part of \a url. If the item is null, the context menu
455 * for the URL should be shown and the custom actions \a customActions
456 * will be added.
457 */
458 void requestContextMenu(const QPoint& pos,
459 const KFileItem& item,
460 const QUrl& url,
461 const QList<QAction*>& customActions);
462
463 /**
464 * Is emitted if an information message with the content \a msg
465 * should be shown.
466 */
467 void infoMessage(const QString& msg);
468
469 /**
470 * Is emitted if an error message with the content \a msg
471 * should be shown.
472 */
473 void errorMessage(const QString& msg);
474
475 /**
476 * Is emitted if an "operation completed" message with the content \a msg
477 * should be shown.
478 */
479 void operationCompletedMessage(const QString& msg);
480
481 /**
482 * Is emitted after DolphinView::setUrl() has been invoked and
483 * the current directory is loaded. If this signal is emitted,
484 * it is assured that the view contains already the correct root
485 * URL and property settings.
486 */
487 void directoryLoadingStarted();
488
489 /**
490 * Is emitted after the directory triggered by DolphinView::setUrl()
491 * has been loaded.
492 */
493 void directoryLoadingCompleted();
494
495 /**
496 * Is emitted after the directory loading triggered by DolphinView::setUrl()
497 * has been canceled.
498 */
499 void directoryLoadingCanceled();
500
501 /**
502 * Is emitted after DolphinView::setUrl() has been invoked and provides
503 * the information how much percent of the current directory have been loaded.
504 */
505 void directoryLoadingProgress(int percent);
506
507 /**
508 * Is emitted if the sorting is done asynchronously and provides the
509 * progress information of the sorting.
510 */
511 void directorySortingProgress(int percent);
512
513 /**
514 * Emitted when the file-item-model emits redirection.
515 * Testcase: fish://localhost
516 */
517 void redirection(const QUrl& oldUrl, const QUrl& newUrl);
518
519 /**
520 * Is emitted when the URL set by DolphinView::setUrl() represents a file.
521 * In this case no signal errorMessage() will be emitted.
522 */
523 void urlIsFileError(const QUrl& url);
524
525 /**
526 * Is emitted when the write state of the folder has been changed. The application
527 * should disable all actions like "Create New..." that depend on the write
528 * state.
529 */
530 void writeStateChanged(bool isFolderWritable);
531
532 /**
533 * Is emitted if the URL should be changed to the previous URL of the
534 * history (e.g. because the "back"-mousebutton has been pressed).
535 */
536 void goBackRequested();
537
538 /**
539 * Is emitted if the URL should be changed to the next URL of the
540 * history (e.g. because the "next"-mousebutton has been pressed).
541 */
542 void goForwardRequested();
543
544 /**
545 * Is emitted when the user wants to move the focus to another view.
546 */
547 void toggleActiveViewRequested();
548
549 /**
550 * Is emitted when the user clicks a tag or a link
551 * in the metadata widget of a tooltip.
552 */
553 void urlActivated(const QUrl& url);
554
555 protected:
556 /** Changes the zoom level if Control is pressed during a wheel event. */
557 void wheelEvent(QWheelEvent* event) override;
558
559 void hideEvent(QHideEvent* event) override;
560 bool event(QEvent* event) override;
561
562 private slots:
563 /**
564 * Marks the view as active (DolphinView:isActive() will return true)
565 * and emits the 'activated' signal if it is not already active.
566 */
567 void activate();
568
569 void slotItemActivated(int index);
570 void slotItemsActivated(const KItemSet& indexes);
571 void slotItemMiddleClicked(int index);
572 void slotItemContextMenuRequested(int index, const QPointF& pos);
573 void slotViewContextMenuRequested(const QPointF& pos);
574 void slotHeaderContextMenuRequested(const QPointF& pos);
575 void slotHeaderColumnWidthChangeFinished(const QByteArray& role, qreal current);
576 void slotItemHovered(int index);
577 void slotItemUnhovered(int index);
578 void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
579 void slotModelChanged(KItemModelBase* current, KItemModelBase* previous);
580 void slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons);
581 void slotRenameDialogRenamingFinished(const QList<QUrl>& urls);
582 void slotSelectedItemTextPressed(int index);
583
584 /*
585 * Is called when new items get pasted or dropped.
586 */
587 void slotItemCreated(const QUrl &url);
588 /*
589 * Is called after all pasted or dropped items have been copied to destination.
590 */
591 void slotPasteJobResult(KJob *job);
592
593 /**
594 * Emits the signal \a selectionChanged() with a small delay. This is
595 * because getting all file items for the selection can be an expensive
596 * operation. Fast selection changes are collected in this case and
597 * the signal is emitted only after no selection change has been done
598 * within a small delay.
599 */
600 void slotSelectionChanged(const KItemSet& current, const KItemSet& previous);
601
602 /**
603 * Is called by emitDelayedSelectionChangedSignal() and emits the
604 * signal \a selectionChanged() with all selected file items as parameter.
605 */
606 void emitSelectionChangedSignal();
607
608 /**
609 * Updates the view properties of the current URL to the
610 * sorting given by \a role.
611 */
612 void updateSortRole(const QByteArray& role);
613
614 /**
615 * Updates the view properties of the current URL to the
616 * sort order given by \a order.
617 */
618 void updateSortOrder(Qt::SortOrder order);
619
620 /**
621 * Updates the view properties of the current URL to the
622 * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
623 */
624 void updateSortFoldersFirst(bool foldersFirst);
625
626 /**
627 * Indicates in the status bar that the delete operation
628 * of the job \a job has been finished.
629 */
630 void slotDeleteFileFinished(KJob* job);
631
632 /**
633 * Indicates in the status bar that the trash operation
634 * of the job \a job has been finished.
635 */
636 void slotTrashFileFinished(KJob* job);
637
638 /**
639 * Invoked when the rename job is done, for error handling.
640 */
641 void slotRenamingResult(KJob* job);
642
643 /**
644 * Invoked when the file item model has started the loading
645 * of the directory specified by DolphinView::url().
646 */
647 void slotDirectoryLoadingStarted();
648
649 /**
650 * Invoked when the file item model indicates that the loading of a directory has
651 * been completed. Assures that pasted items and renamed items get selected.
652 */
653 void slotDirectoryLoadingCompleted();
654
655 /**
656 * Is invoked when items of KFileItemModel have been changed.
657 */
658 void slotItemsChanged();
659
660 /**
661 * Is invoked when the sort order has been changed by the user by clicking
662 * on a header item. The view properties of the directory will get updated.
663 */
664 void slotSortOrderChangedByHeader(Qt::SortOrder current, Qt::SortOrder previous);
665
666 /**
667 * Is invoked when the sort role has been changed by the user by clicking
668 * on a header item. The view properties of the directory will get updated.
669 */
670 void slotSortRoleChangedByHeader(const QByteArray& current, const QByteArray& previous);
671
672 /**
673 * Is invoked when the visible roles have been changed by the user by dragging
674 * a header item. The view properties of the directory will get updated.
675 */
676 void slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
677 const QList<QByteArray>& previous);
678
679 void slotRoleEditingCanceled();
680 void slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value);
681
682 /**
683 * Observes the item with the URL \a url. As soon as the directory
684 * model indicates that the item is available, the item will
685 * get selected and it is assured that the item stays visible.
686 */
687 void observeCreatedItem(const QUrl &url);
688
689 /**
690 * Called when a redirection happens.
691 * Testcase: fish://localhost
692 */
693 void slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl);
694
695 /**
696 * Applies the state that has been restored by restoreViewState()
697 * to the view.
698 */
699 void updateViewState();
700
701 /**
702 * Calculates the number of currently shown files into
703 * \a fileCount and the number of folders into \a folderCount.
704 * The size of all files is written into \a totalFileSize.
705 * It is recommend using this method instead of asking the
706 * directory lister or the model directly, as it takes
707 * filtering and hierarchical previews into account.
708 */
709 void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
710
711 void slotTwoClicksRenamingTimerTimeout();
712
713 private:
714 void loadDirectory(const QUrl& url, bool reload = false);
715
716 /**
717 * Applies the view properties which are defined by the current URL
718 * to the DolphinView properties. The view properties are read from a
719 * .directory file either in the current directory, or in the
720 * share/apps/dolphin/view_properties/ subfolder of the user's .kde folder.
721 */
722 void applyViewProperties();
723
724 /**
725 * Applies the given view properties to the DolphinView.
726 */
727 void applyViewProperties(const ViewProperties& props);
728
729 /**
730 * Applies the m_mode property to the corresponding
731 * itemlayout-property of the KItemListView.
732 */
733 void applyModeToView();
734
735 /**
736 * Hides tooltip displayed over element.
737 */
738 void hideToolTip(const ToolTipManager::HideBehavior behavior = ToolTipManager::HideBehavior::Later);
739
740 /**
741 * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
742 * Pastes the clipboard data into the URL \a url.
743 */
744 void pasteToUrl(const QUrl& url);
745
746 /**
747 * Returns a list of URLs for all selected items. The list is
748 * simplified, so that when the URLs are part of different tree
749 * levels, only the parent is returned.
750 */
751 QList<QUrl> simplifiedSelectedUrls() const;
752
753 /**
754 * Returns the MIME data for all selected items.
755 */
756 QMimeData* selectionMimeData() const;
757
758 /**
759 * Updates m_isFolderWritable dependent on whether the folder represented by
760 * the current URL is writable. If the state has changed, the signal
761 * writeableStateChanged() will be emitted.
762 */
763 void updateWritableState();
764
765 /**
766 * @return The current URL if no viewproperties-context is given (see
767 * DolphinView::viewPropertiesContext(), otherwise the context
768 * is returned.
769 */
770 QUrl viewPropertiesUrl() const;
771
772 /**
773 * Clears the selection and updates current item and selection according to the parameters
774 *
775 * @param current URL to be set as current
776 * @param selected list of selected items
777 */
778 void forceUrlsSelection(const QUrl& current, const QList<QUrl>& selected);
779
780 void abortTwoClicksRenaming();
781
782 private:
783 void updatePalette();
784
785 bool m_active;
786 bool m_tabsForFiles;
787 bool m_assureVisibleCurrentIndex;
788 bool m_isFolderWritable;
789 bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
790 // tooltip may be shown when hovering an item.
791
792 QUrl m_url;
793 QString m_viewPropertiesContext;
794 Mode m_mode;
795 QList<QByteArray> m_visibleRoles;
796
797 QVBoxLayout* m_topLayout;
798
799 KFileItemModel* m_model;
800 DolphinItemListView* m_view;
801 KItemListContainer* m_container;
802
803 ToolTipManager* m_toolTipManager;
804
805 QTimer* m_selectionChangedTimer;
806
807 QUrl m_currentItemUrl; // Used for making the view to remember the current URL after F5
808 bool m_scrollToCurrentItem; // Used for marking we need to scroll to current item or not
809 QPoint m_restoredContentsPosition;
810
811 QList<QUrl> m_selectedUrls; // Used for making the view to remember selections after F5
812 bool m_clearSelectionBeforeSelectingNewItems;
813 bool m_markFirstNewlySelectedItemAsCurrent;
814
815 VersionControlObserver* m_versionControlObserver;
816
817 QTimer* m_twoClicksRenamingTimer;
818 QUrl m_twoClicksRenamingItemUrl;
819
820 // For unit tests
821 friend class TestBase;
822 friend class DolphinDetailsViewTest;
823 friend class DolphinPart; // Accesses m_model
824 };
825
826 /// Allow using DolphinView::Mode in QVariant
827 Q_DECLARE_METATYPE(DolphinView::Mode)
828
829 #endif // DOLPHINVIEW_H