]> cloud.milkyroute.net Git - dolphin.git/blob - src/views/dolphinview.h
83c5f92a4dbdd01040ba28155bf2a8930ce5fb27
[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 * Creates duplicates of selected items, appending "copy"
379 * to the end.
380 */
381 void duplicateSelectedItems();
382
383 /**
384 * Handles a drop of @p dropEvent onto widget @p dropWidget and destination @p destUrl
385 */
386 void dropUrls(const QUrl &destUrl, QDropEvent *dropEvent, QWidget *dropWidget);
387
388 void stopLoading();
389
390 /**
391 * Applies the state that has been restored by restoreViewState()
392 * to the view.
393 */
394 void updateViewState();
395
396 /** Activates the view if the item list container gets focus. */
397 bool eventFilter(QObject* watched, QEvent* event) override;
398
399 signals:
400 /**
401 * Is emitted if the view has been activated by e. g. a mouse click.
402 */
403 void activated();
404
405 /** Is emitted if the URL of the view has been changed to \a url. */
406 void urlChanged(const QUrl& url);
407
408 /**
409 * Is emitted when clicking on an item with the left mouse button.
410 */
411 void itemActivated(const KFileItem& item);
412
413 /**
414 * Is emitted when multiple items have been activated by e. g.
415 * context menu open with.
416 */
417 void itemsActivated(const KFileItemList& items);
418
419 /**
420 * Is emitted if items have been added or deleted.
421 */
422 void itemCountChanged();
423
424 /**
425 * Is emitted if a new tab should be opened for the URL \a url.
426 */
427 void tabRequested(const QUrl& url, DolphinTabWidget::TabPlacement tabPlacement);
428
429 /**
430 * Is emitted if the view mode (IconsView, DetailsView,
431 * PreviewsView) has been changed.
432 */
433 void modeChanged(DolphinView::Mode current, DolphinView::Mode previous);
434
435 /** Is emitted if the 'show preview' property has been changed. */
436 void previewsShownChanged(bool shown);
437
438 /** Is emitted if the 'show hidden files' property has been changed. */
439 void hiddenFilesShownChanged(bool shown);
440
441 /** Is emitted if the 'grouped sorting' property has been changed. */
442 void groupedSortingChanged(bool groupedSorting);
443
444 /** Is emitted if the sorting by name, size or date has been changed. */
445 void sortRoleChanged(const QByteArray& role);
446
447 /** Is emitted if the sort order (ascending or descending) has been changed. */
448 void sortOrderChanged(Qt::SortOrder order);
449
450 /**
451 * Is emitted if the sorting of files and folders (separate with folders
452 * first or mixed) has been changed.
453 */
454 void sortFoldersFirstChanged(bool foldersFirst);
455
456 /** Is emitted if the additional information shown for this view has been changed. */
457 void visibleRolesChanged(const QList<QByteArray>& current,
458 const QList<QByteArray>& previous);
459
460 /** Is emitted if the zoom level has been changed by zooming in or out. */
461 void zoomLevelChanged(int current, int previous);
462
463 /**
464 * Is emitted if information of an item is requested to be shown e. g. in the panel.
465 * If item is null, no item information request is pending.
466 */
467 void requestItemInfo(const KFileItem& item);
468
469 /**
470 * Is emitted whenever the selection has been changed.
471 */
472 void selectionChanged(const KFileItemList& selection);
473
474 /**
475 * Is emitted if a context menu is requested for the item \a item,
476 * which is part of \a url. If the item is null, the context menu
477 * for the URL should be shown and the custom actions \a customActions
478 * will be added.
479 */
480 void requestContextMenu(const QPoint& pos,
481 const KFileItem& item,
482 const QUrl& url,
483 const QList<QAction*>& customActions);
484
485 /**
486 * Is emitted if an information message with the content \a msg
487 * should be shown.
488 */
489 void infoMessage(const QString& msg);
490
491 /**
492 * Is emitted if an error message with the content \a msg
493 * should be shown.
494 */
495 void errorMessage(const QString& msg);
496
497 /**
498 * Is emitted if an "operation completed" message with the content \a msg
499 * should be shown.
500 */
501 void operationCompletedMessage(const QString& msg);
502
503 /**
504 * Is emitted after DolphinView::setUrl() has been invoked and
505 * the current directory is loaded. If this signal is emitted,
506 * it is assured that the view contains already the correct root
507 * URL and property settings.
508 */
509 void directoryLoadingStarted();
510
511 /**
512 * Is emitted after the directory triggered by DolphinView::setUrl()
513 * has been loaded.
514 */
515 void directoryLoadingCompleted();
516
517 /**
518 * Is emitted after the directory loading triggered by DolphinView::setUrl()
519 * has been canceled.
520 */
521 void directoryLoadingCanceled();
522
523 /**
524 * Is emitted after DolphinView::setUrl() has been invoked and provides
525 * the information how much percent of the current directory have been loaded.
526 */
527 void directoryLoadingProgress(int percent);
528
529 /**
530 * Is emitted if the sorting is done asynchronously and provides the
531 * progress information of the sorting.
532 */
533 void directorySortingProgress(int percent);
534
535 /**
536 * Emitted when the file-item-model emits redirection.
537 * Testcase: fish://localhost
538 */
539 void redirection(const QUrl& oldUrl, const QUrl& newUrl);
540
541 /**
542 * Is emitted when the URL set by DolphinView::setUrl() represents a file.
543 * In this case no signal errorMessage() will be emitted.
544 */
545 void urlIsFileError(const QUrl& url);
546
547 /**
548 * Is emitted when the write state of the folder has been changed. The application
549 * should disable all actions like "Create New..." that depend on the write
550 * state.
551 */
552 void writeStateChanged(bool isFolderWritable);
553
554 /**
555 * Is emitted if the URL should be changed to the previous URL of the
556 * history (e.g. because the "back"-mousebutton has been pressed).
557 */
558 void goBackRequested();
559
560 /**
561 * Is emitted if the URL should be changed to the next URL of the
562 * history (e.g. because the "next"-mousebutton has been pressed).
563 */
564 void goForwardRequested();
565
566 /**
567 * Is emitted when the user wants to move the focus to another view.
568 */
569 void toggleActiveViewRequested();
570
571 /**
572 * Is emitted when the user clicks a tag or a link
573 * in the metadata widget of a tooltip.
574 */
575 void urlActivated(const QUrl& url);
576
577 protected:
578 /** Changes the zoom level if Control is pressed during a wheel event. */
579 void wheelEvent(QWheelEvent* event) override;
580
581 void hideEvent(QHideEvent* event) override;
582 bool event(QEvent* event) override;
583
584 private slots:
585 /**
586 * Marks the view as active (DolphinView:isActive() will return true)
587 * and emits the 'activated' signal if it is not already active.
588 */
589 void activate();
590
591 void slotItemActivated(int index);
592 void slotItemsActivated(const KItemSet& indexes);
593 void slotItemMiddleClicked(int index);
594 void slotItemContextMenuRequested(int index, const QPointF& pos);
595 void slotViewContextMenuRequested(const QPointF& pos);
596 void slotHeaderContextMenuRequested(const QPointF& pos);
597 void slotHeaderColumnWidthChangeFinished(const QByteArray& role, qreal current);
598 void slotItemHovered(int index);
599 void slotItemUnhovered(int index);
600 void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
601 void slotModelChanged(KItemModelBase* current, KItemModelBase* previous);
602 void slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons);
603 void slotRenameDialogRenamingFinished(const QList<QUrl>& urls);
604 void slotSelectedItemTextPressed(int index);
605
606 /*
607 * Is called when new items get pasted or dropped.
608 */
609 void slotItemCreated(const QUrl &url);
610 /*
611 * Is called after all pasted or dropped items have been copied to destination.
612 */
613 void slotPasteJobResult(KJob *job);
614
615 /**
616 * Emits the signal \a selectionChanged() with a small delay. This is
617 * because getting all file items for the selection can be an expensive
618 * operation. Fast selection changes are collected in this case and
619 * the signal is emitted only after no selection change has been done
620 * within a small delay.
621 */
622 void slotSelectionChanged(const KItemSet& current, const KItemSet& previous);
623
624 /**
625 * Is called by emitDelayedSelectionChangedSignal() and emits the
626 * signal \a selectionChanged() with all selected file items as parameter.
627 */
628 void emitSelectionChangedSignal();
629
630 /**
631 * Updates the view properties of the current URL to the
632 * sorting given by \a role.
633 */
634 void updateSortRole(const QByteArray& role);
635
636 /**
637 * Updates the view properties of the current URL to the
638 * sort order given by \a order.
639 */
640 void updateSortOrder(Qt::SortOrder order);
641
642 /**
643 * Updates the view properties of the current URL to the
644 * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
645 */
646 void updateSortFoldersFirst(bool foldersFirst);
647
648 /**
649 * Indicates in the status bar that the delete operation
650 * of the job \a job has been finished.
651 */
652 void slotDeleteFileFinished(KJob* job);
653
654 /**
655 * Indicates in the status bar that the trash operation
656 * of the job \a job has been finished.
657 */
658 void slotTrashFileFinished(KJob* job);
659
660 /**
661 * Invoked when the rename job is done, for error handling.
662 */
663 void slotRenamingResult(KJob* job);
664
665 /**
666 * Invoked when the file item model has started the loading
667 * of the directory specified by DolphinView::url().
668 */
669 void slotDirectoryLoadingStarted();
670
671 /**
672 * Invoked when the file item model indicates that the loading of a directory has
673 * been completed. Assures that pasted items and renamed items get selected.
674 */
675 void slotDirectoryLoadingCompleted();
676
677 /**
678 * Is invoked when items of KFileItemModel have been changed.
679 */
680 void slotItemsChanged();
681
682 /**
683 * Is invoked when the sort order has been changed by the user by clicking
684 * on a header item. The view properties of the directory will get updated.
685 */
686 void slotSortOrderChangedByHeader(Qt::SortOrder current, Qt::SortOrder previous);
687
688 /**
689 * Is invoked when the sort role has been changed by the user by clicking
690 * on a header item. The view properties of the directory will get updated.
691 */
692 void slotSortRoleChangedByHeader(const QByteArray& current, const QByteArray& previous);
693
694 /**
695 * Is invoked when the visible roles have been changed by the user by dragging
696 * a header item. The view properties of the directory will get updated.
697 */
698 void slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
699 const QList<QByteArray>& previous);
700
701 void slotRoleEditingCanceled();
702 void slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value);
703
704 /**
705 * Observes the item with the URL \a url. As soon as the directory
706 * model indicates that the item is available, the item will
707 * get selected and it is assured that the item stays visible.
708 */
709 void observeCreatedItem(const QUrl &url);
710
711 /**
712 * Called when a redirection happens.
713 * Testcase: fish://localhost
714 */
715 void slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl);
716
717 /**
718 * Calculates the number of currently shown files into
719 * \a fileCount and the number of folders into \a folderCount.
720 * The size of all files is written into \a totalFileSize.
721 * It is recommend using this method instead of asking the
722 * directory lister or the model directly, as it takes
723 * filtering and hierarchical previews into account.
724 */
725 void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
726
727 void slotTwoClicksRenamingTimerTimeout();
728
729 private:
730 void loadDirectory(const QUrl& url, bool reload = false);
731
732 /**
733 * Applies the view properties which are defined by the current URL
734 * to the DolphinView properties. The view properties are read from a
735 * .directory file either in the current directory, or in the
736 * share/apps/dolphin/view_properties/ subfolder of the user's .kde folder.
737 */
738 void applyViewProperties();
739
740 /**
741 * Applies the given view properties to the DolphinView.
742 */
743 void applyViewProperties(const ViewProperties& props);
744
745 /**
746 * Applies the m_mode property to the corresponding
747 * itemlayout-property of the KItemListView.
748 */
749 void applyModeToView();
750
751 /**
752 * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
753 * Pastes the clipboard data into the URL \a url.
754 */
755 void pasteToUrl(const QUrl& url);
756
757 /**
758 * Returns a list of URLs for all selected items. The list is
759 * simplified, so that when the URLs are part of different tree
760 * levels, only the parent is returned.
761 */
762 QList<QUrl> simplifiedSelectedUrls() const;
763
764 /**
765 * Returns the MIME data for all selected items.
766 */
767 QMimeData* selectionMimeData() const;
768
769 /**
770 * Updates m_isFolderWritable dependent on whether the folder represented by
771 * the current URL is writable. If the state has changed, the signal
772 * writeableStateChanged() will be emitted.
773 */
774 void updateWritableState();
775
776 /**
777 * @return The current URL if no viewproperties-context is given (see
778 * DolphinView::viewPropertiesContext(), otherwise the context
779 * is returned.
780 */
781 QUrl viewPropertiesUrl() const;
782
783 /**
784 * Clears the selection and updates current item and selection according to the parameters
785 *
786 * @param current URL to be set as current
787 * @param selected list of selected items
788 */
789 void forceUrlsSelection(const QUrl& current, const QList<QUrl>& selected);
790
791 void abortTwoClicksRenaming();
792
793 private:
794 void updatePalette();
795
796 bool m_active;
797 bool m_tabsForFiles;
798 bool m_assureVisibleCurrentIndex;
799 bool m_isFolderWritable;
800 bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
801 // tooltip may be shown when hovering an item.
802
803 QUrl m_url;
804 QString m_viewPropertiesContext;
805 Mode m_mode;
806 QList<QByteArray> m_visibleRoles;
807
808 QVBoxLayout* m_topLayout;
809
810 KFileItemModel* m_model;
811 DolphinItemListView* m_view;
812 KItemListContainer* m_container;
813
814 ToolTipManager* m_toolTipManager;
815
816 QTimer* m_selectionChangedTimer;
817
818 QUrl m_currentItemUrl; // Used for making the view to remember the current URL after F5
819 bool m_scrollToCurrentItem; // Used for marking we need to scroll to current item or not
820 QPoint m_restoredContentsPosition;
821
822 QList<QUrl> m_selectedUrls; // Used for making the view to remember selections after F5
823 bool m_clearSelectionBeforeSelectingNewItems;
824 bool m_markFirstNewlySelectedItemAsCurrent;
825
826 VersionControlObserver* m_versionControlObserver;
827
828 QTimer* m_twoClicksRenamingTimer;
829 QUrl m_twoClicksRenamingItemUrl;
830
831 // For unit tests
832 friend class TestBase;
833 friend class DolphinDetailsViewTest;
834 friend class DolphinPart; // Accesses m_model
835 };
836
837 /// Allow using DolphinView::Mode in QVariant
838 Q_DECLARE_METATYPE(DolphinView::Mode)
839
840 #endif // DOLPHINVIEW_H