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