]> cloud.milkyroute.net Git - dolphin.git/blob - src/views/dolphinview.h
Hide tooltip instantly on filter change
[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 /**
316 * Hides tooltip displayed over element.
317 */
318 void hideToolTip(const ToolTipManager::HideBehavior behavior = ToolTipManager::HideBehavior::Later);
319
320 public slots:
321 /**
322 * Changes the directory to \a url. If the current directory is equal to
323 * \a url, nothing will be done (use DolphinView::reload() instead).
324 */
325 void setUrl(const QUrl& url);
326
327 /**
328 * Selects all items.
329 * @see DolphinView::selectedItems()
330 */
331 void selectAll();
332
333 /**
334 * Inverts the current selection: selected items get unselected,
335 * unselected items get selected.
336 * @see DolphinView::selectedItems()
337 */
338 void invertSelection();
339
340 void clearSelection();
341
342 /**
343 * Triggers the renaming of the currently selected items, where
344 * the user must input a new name for the items.
345 */
346 void renameSelectedItems();
347
348 /**
349 * Moves all selected items to the trash.
350 */
351 void trashSelectedItems();
352
353 /**
354 * Deletes all selected items.
355 */
356 void deleteSelectedItems();
357
358 /**
359 * Copies all selected items to the clipboard and marks
360 * the items as cut.
361 */
362 void cutSelectedItems();
363
364 /** Copies all selected items to the clipboard. */
365 void copySelectedItems();
366
367 /** Pastes the clipboard data to this view. */
368 void paste();
369
370 /**
371 * Pastes the clipboard data into the currently selected
372 * folder. If the current selection is not exactly one folder, no
373 * paste operation is done.
374 */
375 void pasteIntoFolder();
376
377 /**
378 * Handles a drop of @p dropEvent onto widget @p dropWidget and destination @p destUrl
379 */
380 void dropUrls(const QUrl &destUrl, QDropEvent *dropEvent, QWidget *dropWidget);
381
382 void stopLoading();
383
384 /** Activates the view if the item list container gets focus. */
385 bool eventFilter(QObject* watched, QEvent* event) override;
386
387 signals:
388 /**
389 * Is emitted if the view has been activated by e. g. a mouse click.
390 */
391 void activated();
392
393 /** Is emitted if the URL of the view has been changed to \a url. */
394 void urlChanged(const QUrl& url);
395
396 /**
397 * Is emitted when clicking on an item with the left mouse button.
398 */
399 void itemActivated(const KFileItem& item);
400
401 /**
402 * Is emitted when multiple items have been activated by e. g.
403 * context menu open with.
404 */
405 void itemsActivated(const KFileItemList& items);
406
407 /**
408 * Is emitted if items have been added or deleted.
409 */
410 void itemCountChanged();
411
412 /**
413 * Is emitted if a new tab should be opened for the URL \a url.
414 */
415 void tabRequested(const QUrl& url, DolphinTabWidget::TabPlacement tabPlacement);
416
417 /**
418 * Is emitted if the view mode (IconsView, DetailsView,
419 * PreviewsView) has been changed.
420 */
421 void modeChanged(DolphinView::Mode current, DolphinView::Mode previous);
422
423 /** Is emitted if the 'show preview' property has been changed. */
424 void previewsShownChanged(bool shown);
425
426 /** Is emitted if the 'show hidden files' property has been changed. */
427 void hiddenFilesShownChanged(bool shown);
428
429 /** Is emitted if the 'grouped sorting' property has been changed. */
430 void groupedSortingChanged(bool groupedSorting);
431
432 /** Is emitted if the sorting by name, size or date has been changed. */
433 void sortRoleChanged(const QByteArray& role);
434
435 /** Is emitted if the sort order (ascending or descending) has been changed. */
436 void sortOrderChanged(Qt::SortOrder order);
437
438 /**
439 * Is emitted if the sorting of files and folders (separate with folders
440 * first or mixed) has been changed.
441 */
442 void sortFoldersFirstChanged(bool foldersFirst);
443
444 /** Is emitted if the additional information shown for this view has been changed. */
445 void visibleRolesChanged(const QList<QByteArray>& current,
446 const QList<QByteArray>& previous);
447
448 /** Is emitted if the zoom level has been changed by zooming in or out. */
449 void zoomLevelChanged(int current, int previous);
450
451 /**
452 * Is emitted if information of an item is requested to be shown e. g. in the panel.
453 * If item is null, no item information request is pending.
454 */
455 void requestItemInfo(const KFileItem& item);
456
457 /**
458 * Is emitted whenever the selection has been changed.
459 */
460 void selectionChanged(const KFileItemList& selection);
461
462 /**
463 * Is emitted if a context menu is requested for the item \a item,
464 * which is part of \a url. If the item is null, the context menu
465 * for the URL should be shown and the custom actions \a customActions
466 * will be added.
467 */
468 void requestContextMenu(const QPoint& pos,
469 const KFileItem& item,
470 const QUrl& url,
471 const QList<QAction*>& customActions);
472
473 /**
474 * Is emitted if an information message with the content \a msg
475 * should be shown.
476 */
477 void infoMessage(const QString& msg);
478
479 /**
480 * Is emitted if an error message with the content \a msg
481 * should be shown.
482 */
483 void errorMessage(const QString& msg);
484
485 /**
486 * Is emitted if an "operation completed" message with the content \a msg
487 * should be shown.
488 */
489 void operationCompletedMessage(const QString& msg);
490
491 /**
492 * Is emitted after DolphinView::setUrl() has been invoked and
493 * the current directory is loaded. If this signal is emitted,
494 * it is assured that the view contains already the correct root
495 * URL and property settings.
496 */
497 void directoryLoadingStarted();
498
499 /**
500 * Is emitted after the directory triggered by DolphinView::setUrl()
501 * has been loaded.
502 */
503 void directoryLoadingCompleted();
504
505 /**
506 * Is emitted after the directory loading triggered by DolphinView::setUrl()
507 * has been canceled.
508 */
509 void directoryLoadingCanceled();
510
511 /**
512 * Is emitted after DolphinView::setUrl() has been invoked and provides
513 * the information how much percent of the current directory have been loaded.
514 */
515 void directoryLoadingProgress(int percent);
516
517 /**
518 * Is emitted if the sorting is done asynchronously and provides the
519 * progress information of the sorting.
520 */
521 void directorySortingProgress(int percent);
522
523 /**
524 * Emitted when the file-item-model emits redirection.
525 * Testcase: fish://localhost
526 */
527 void redirection(const QUrl& oldUrl, const QUrl& newUrl);
528
529 /**
530 * Is emitted when the URL set by DolphinView::setUrl() represents a file.
531 * In this case no signal errorMessage() will be emitted.
532 */
533 void urlIsFileError(const QUrl& url);
534
535 /**
536 * Is emitted when the write state of the folder has been changed. The application
537 * should disable all actions like "Create New..." that depend on the write
538 * state.
539 */
540 void writeStateChanged(bool isFolderWritable);
541
542 /**
543 * Is emitted if the URL should be changed to the previous URL of the
544 * history (e.g. because the "back"-mousebutton has been pressed).
545 */
546 void goBackRequested();
547
548 /**
549 * Is emitted if the URL should be changed to the next URL of the
550 * history (e.g. because the "next"-mousebutton has been pressed).
551 */
552 void goForwardRequested();
553
554 /**
555 * Is emitted when the user wants to move the focus to another view.
556 */
557 void toggleActiveViewRequested();
558
559 /**
560 * Is emitted when the user clicks a tag or a link
561 * in the metadata widget of a tooltip.
562 */
563 void urlActivated(const QUrl& url);
564
565 protected:
566 /** Changes the zoom level if Control is pressed during a wheel event. */
567 void wheelEvent(QWheelEvent* event) override;
568
569 void hideEvent(QHideEvent* event) override;
570 bool event(QEvent* event) override;
571
572 private slots:
573 /**
574 * Marks the view as active (DolphinView:isActive() will return true)
575 * and emits the 'activated' signal if it is not already active.
576 */
577 void activate();
578
579 void slotItemActivated(int index);
580 void slotItemsActivated(const KItemSet& indexes);
581 void slotItemMiddleClicked(int index);
582 void slotItemContextMenuRequested(int index, const QPointF& pos);
583 void slotViewContextMenuRequested(const QPointF& pos);
584 void slotHeaderContextMenuRequested(const QPointF& pos);
585 void slotHeaderColumnWidthChangeFinished(const QByteArray& role, qreal current);
586 void slotItemHovered(int index);
587 void slotItemUnhovered(int index);
588 void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
589 void slotModelChanged(KItemModelBase* current, KItemModelBase* previous);
590 void slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons);
591 void slotRenameDialogRenamingFinished(const QList<QUrl>& urls);
592 void slotSelectedItemTextPressed(int index);
593
594 /*
595 * Is called when new items get pasted or dropped.
596 */
597 void slotItemCreated(const QUrl &url);
598 /*
599 * Is called after all pasted or dropped items have been copied to destination.
600 */
601 void slotPasteJobResult(KJob *job);
602
603 /**
604 * Emits the signal \a selectionChanged() with a small delay. This is
605 * because getting all file items for the selection can be an expensive
606 * operation. Fast selection changes are collected in this case and
607 * the signal is emitted only after no selection change has been done
608 * within a small delay.
609 */
610 void slotSelectionChanged(const KItemSet& current, const KItemSet& previous);
611
612 /**
613 * Is called by emitDelayedSelectionChangedSignal() and emits the
614 * signal \a selectionChanged() with all selected file items as parameter.
615 */
616 void emitSelectionChangedSignal();
617
618 /**
619 * Updates the view properties of the current URL to the
620 * sorting given by \a role.
621 */
622 void updateSortRole(const QByteArray& role);
623
624 /**
625 * Updates the view properties of the current URL to the
626 * sort order given by \a order.
627 */
628 void updateSortOrder(Qt::SortOrder order);
629
630 /**
631 * Updates the view properties of the current URL to the
632 * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
633 */
634 void updateSortFoldersFirst(bool foldersFirst);
635
636 /**
637 * Indicates in the status bar that the delete operation
638 * of the job \a job has been finished.
639 */
640 void slotDeleteFileFinished(KJob* job);
641
642 /**
643 * Indicates in the status bar that the trash operation
644 * of the job \a job has been finished.
645 */
646 void slotTrashFileFinished(KJob* job);
647
648 /**
649 * Invoked when the rename job is done, for error handling.
650 */
651 void slotRenamingResult(KJob* job);
652
653 /**
654 * Invoked when the file item model has started the loading
655 * of the directory specified by DolphinView::url().
656 */
657 void slotDirectoryLoadingStarted();
658
659 /**
660 * Invoked when the file item model indicates that the loading of a directory has
661 * been completed. Assures that pasted items and renamed items get selected.
662 */
663 void slotDirectoryLoadingCompleted();
664
665 /**
666 * Is invoked when items of KFileItemModel have been changed.
667 */
668 void slotItemsChanged();
669
670 /**
671 * Is invoked when the sort order has been changed by the user by clicking
672 * on a header item. The view properties of the directory will get updated.
673 */
674 void slotSortOrderChangedByHeader(Qt::SortOrder current, Qt::SortOrder previous);
675
676 /**
677 * Is invoked when the sort role has been changed by the user by clicking
678 * on a header item. The view properties of the directory will get updated.
679 */
680 void slotSortRoleChangedByHeader(const QByteArray& current, const QByteArray& previous);
681
682 /**
683 * Is invoked when the visible roles have been changed by the user by dragging
684 * a header item. The view properties of the directory will get updated.
685 */
686 void slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
687 const QList<QByteArray>& previous);
688
689 void slotRoleEditingCanceled();
690 void slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value);
691
692 /**
693 * Observes the item with the URL \a url. As soon as the directory
694 * model indicates that the item is available, the item will
695 * get selected and it is assured that the item stays visible.
696 */
697 void observeCreatedItem(const QUrl &url);
698
699 /**
700 * Called when a redirection happens.
701 * Testcase: fish://localhost
702 */
703 void slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl);
704
705 /**
706 * Applies the state that has been restored by restoreViewState()
707 * to the view.
708 */
709 void updateViewState();
710
711 /**
712 * Calculates the number of currently shown files into
713 * \a fileCount and the number of folders into \a folderCount.
714 * The size of all files is written into \a totalFileSize.
715 * It is recommend using this method instead of asking the
716 * directory lister or the model directly, as it takes
717 * filtering and hierarchical previews into account.
718 */
719 void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
720
721 void slotTwoClicksRenamingTimerTimeout();
722
723 private:
724 void loadDirectory(const QUrl& url, bool reload = false);
725
726 /**
727 * Applies the view properties which are defined by the current URL
728 * to the DolphinView properties. The view properties are read from a
729 * .directory file either in the current directory, or in the
730 * share/apps/dolphin/view_properties/ subfolder of the user's .kde folder.
731 */
732 void applyViewProperties();
733
734 /**
735 * Applies the given view properties to the DolphinView.
736 */
737 void applyViewProperties(const ViewProperties& props);
738
739 /**
740 * Applies the m_mode property to the corresponding
741 * itemlayout-property of the KItemListView.
742 */
743 void applyModeToView();
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