]> cloud.milkyroute.net Git - dolphin.git/blob - src/views/dolphinview.h
Merge branch 'master' into frameworks
[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 <config-baloo.h>
25
26 #include "dolphin_export.h"
27
28 #include <kparts/part.h>
29 #include <KFileItem>
30 #include <kio/fileundomanager.h>
31 #include <KIO/Job>
32 #include <QUrl>
33 #include <QMimeData>
34 #include <QWidget>
35
36 typedef KIO::FileUndoManager::CommandType CommandType;
37 class QVBoxLayout;
38 class DolphinItemListView;
39 class KFileItemModel;
40 class KItemListContainer;
41 class KItemModelBase;
42 class KItemSet;
43 class ToolTipManager;
44 class VersionControlObserver;
45 class ViewProperties;
46 class QGraphicsSceneDragDropEvent;
47 class QRegExp;
48
49 /**
50 * @short Represents a view for the directory content.
51 *
52 * View modes for icons, compact and details are supported. It's
53 * possible to adjust:
54 * - sort order
55 * - sort type
56 * - show hidden files
57 * - show previews
58 * - enable grouping
59 */
60 class DOLPHIN_EXPORT DolphinView : public QWidget
61 {
62 Q_OBJECT
63
64 public:
65 /**
66 * Defines the view mode for a directory. The
67 * view mode is automatically updated if the directory itself
68 * defines a view mode (see class ViewProperties for details).
69 */
70 enum Mode
71 {
72 /**
73 * The items are shown as icons with a name-label below.
74 */
75 IconsView = 0,
76
77 /**
78 * The icon, the name and the size of the items are
79 * shown per default as a table.
80 */
81 DetailsView,
82
83 /**
84 * The items are shown as icons with the name-label aligned
85 * to the right side.
86 */
87 CompactView
88 };
89
90 /**
91 * @param url Specifies the content which should be shown.
92 * @param parent Parent widget of the view.
93 */
94 DolphinView(const QUrl& url, QWidget* parent);
95
96 virtual ~DolphinView();
97
98 /**
99 * Returns the current active URL, where all actions are applied.
100 * The URL navigator is synchronized with this URL.
101 */
102 QUrl url() const;
103
104 /**
105 * If \a active is true, the view will marked as active. The active
106 * view is defined as view where all actions are applied to.
107 */
108 void setActive(bool active);
109 bool isActive() const;
110
111 /**
112 * Changes the view mode for the current directory to \a mode.
113 * If the view properties should be remembered for each directory
114 * (GeneralSettings::globalViewProps() returns false), then the
115 * changed view mode will be stored automatically.
116 */
117 void setMode(Mode mode);
118 Mode mode() const;
119
120 /**
121 * Turns on the file preview for the all files of the current directory,
122 * if \a show is true.
123 * If the view properties should be remembered for each directory
124 * (GeneralSettings::globalViewProps() returns false), then the
125 * preview setting will be stored automatically.
126 */
127 void setPreviewsShown(bool show);
128 bool previewsShown() const;
129
130 /**
131 * Shows all hidden files of the current directory,
132 * if \a show is true.
133 * If the view properties should be remembered for each directory
134 * (GeneralSettings::globalViewProps() returns false), then the
135 * show hidden file setting will be stored automatically.
136 */
137 void setHiddenFilesShown(bool show);
138 bool hiddenFilesShown() const;
139
140 /**
141 * Turns on sorting by groups if \a enable is true.
142 */
143 void setGroupedSorting(bool grouped);
144 bool groupedSorting() const;
145
146 /**
147 * Returns the items of the view.
148 */
149 KFileItemList items() const;
150
151 /**
152 * @return The number of items. itemsCount() is faster in comparison
153 * to items().count().
154 */
155 int itemsCount() const;
156
157 /**
158 * Returns the selected items. The list is empty if no item has been
159 * selected.
160 */
161 KFileItemList selectedItems() const;
162
163 /**
164 * Returns the number of selected items (this is faster than
165 * invoking selectedItems().count()).
166 */
167 int selectedItemsCount() const;
168
169 /**
170 * Marks the items indicated by \p urls to get selected after the
171 * directory DolphinView::url() has been loaded. Note that nothing
172 * gets selected if no loading of a directory has been triggered
173 * by DolphinView::setUrl() or DolphinView::reload().
174 */
175 void markUrlsAsSelected(const QList<QUrl> &urls);
176
177 /**
178 * Marks the item indicated by \p url to be scrolled to and as the
179 * current item after directory DolphinView::url() has been loaded.
180 */
181 void markUrlAsCurrent(const QUrl& url);
182
183 /**
184 * All items that match to the pattern \a pattern will get selected
185 * if \a enabled is true and deselected if \a enabled is false.
186 */
187 void selectItems(const QRegExp& pattern, bool enabled);
188
189 /**
190 * Sets the zoom level to \a level. It is assured that the used
191 * level is adjusted to be inside the range ZoomLevelInfo::minimumLevel() and
192 * ZoomLevelInfo::maximumLevel().
193 */
194 void setZoomLevel(int level);
195 int zoomLevel() const;
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 public slots:
309 /**
310 * Changes the directory to \a url. If the current directory is equal to
311 * \a url, nothing will be done (use DolphinView::reload() instead).
312 */
313 void setUrl(const QUrl& url);
314
315 /**
316 * Selects all items.
317 * @see DolphinView::selectedItems()
318 */
319 void selectAll();
320
321 /**
322 * Inverts the current selection: selected items get unselected,
323 * unselected items get selected.
324 * @see DolphinView::selectedItems()
325 */
326 void invertSelection();
327
328 void clearSelection();
329
330 /**
331 * Triggers the renaming of the currently selected items, where
332 * the user must input a new name for the items.
333 */
334 void renameSelectedItems();
335
336 /**
337 * Moves all selected items to the trash.
338 */
339 void trashSelectedItems();
340
341 /**
342 * Deletes all selected items.
343 */
344 void deleteSelectedItems();
345
346 /**
347 * Copies all selected items to the clipboard and marks
348 * the items as cut.
349 */
350 void cutSelectedItems();
351
352 /** Copies all selected items to the clipboard. */
353 void copySelectedItems();
354
355 /** Pastes the clipboard data to this view. */
356 void paste();
357
358 /**
359 * Pastes the clipboard data into the currently selected
360 * folder. If the current selection is not exactly one folder, no
361 * paste operation is done.
362 */
363 void pasteIntoFolder();
364
365 /**
366 * Handles a drop of @p dropEvent onto @p destUrl
367 */
368 void dropUrls(const QUrl &destUrl, QDropEvent *dropEvent);
369
370 void stopLoading();
371
372 /** Activates the view if the item list container gets focus. */
373 virtual bool eventFilter(QObject* watched, QEvent* event) Q_DECL_OVERRIDE;
374
375 signals:
376 /**
377 * Is emitted if the view has been activated by e. g. a mouse click.
378 */
379 void activated();
380
381 /**
382 * Is emitted if the URL of the view will be changed to \a url.
383 * After the URL has been changed the signal urlChanged() will
384 * be emitted.
385 */
386 void urlAboutToBeChanged(const QUrl& url);
387
388 /** Is emitted if the URL of the view has been changed to \a url. */
389 void urlChanged(const QUrl& url);
390
391 /**
392 * Is emitted when clicking on an item with the left mouse button.
393 */
394 void itemActivated(const KFileItem& item);
395
396 /**
397 * Is emitted when multiple items have been activated by e. g.
398 * context menu open with.
399 */
400 void itemsActivated(const KFileItemList& items);
401
402 /**
403 * Is emitted if items have been added or deleted.
404 */
405 void itemCountChanged();
406
407 /**
408 * Is emitted if a new tab should be opened for the URL \a url.
409 */
410 void tabRequested(const QUrl& url);
411
412 /**
413 * Is emitted if the view mode (IconsView, DetailsView,
414 * PreviewsView) has been changed.
415 */
416 void modeChanged(DolphinView::Mode current, DolphinView::Mode previous);
417
418 /** Is emitted if the 'show preview' property has been changed. */
419 void previewsShownChanged(bool shown);
420
421 /** Is emitted if the 'show hidden files' property has been changed. */
422 void hiddenFilesShownChanged(bool shown);
423
424 /** Is emitted if the 'grouped sorting' property has been changed. */
425 void groupedSortingChanged(bool groupedSorting);
426
427 /** Is emitted if the sorting by name, size or date has been changed. */
428 void sortRoleChanged(const QByteArray& role);
429
430 /** Is emitted if the sort order (ascending or descending) has been changed. */
431 void sortOrderChanged(Qt::SortOrder order);
432
433 /**
434 * Is emitted if the sorting of files and folders (separate with folders
435 * first or mixed) has been changed.
436 */
437 void sortFoldersFirstChanged(bool foldersFirst);
438
439 /** Is emitted if the additional information shown for this view has been changed. */
440 void visibleRolesChanged(const QList<QByteArray>& current,
441 const QList<QByteArray>& previous);
442
443 /** Is emitted if the zoom level has been changed by zooming in or out. */
444 void zoomLevelChanged(int current, int previous);
445
446 /**
447 * Is emitted if information of an item is requested to be shown e. g. in the panel.
448 * If item is null, no item information request is pending.
449 */
450 void requestItemInfo(const KFileItem& item);
451
452 /**
453 * Is emitted whenever the selection has been changed.
454 */
455 void selectionChanged(const KFileItemList& selection);
456
457 /**
458 * Is emitted if a context menu is requested for the item \a item,
459 * which is part of \a url. If the item is null, the context menu
460 * for the URL should be shown and the custom actions \a customActions
461 * will be added.
462 */
463 void requestContextMenu(const QPoint& pos,
464 const KFileItem& item,
465 const QUrl& url,
466 const QList<QAction*>& customActions);
467
468 /**
469 * Is emitted if an information message with the content \a msg
470 * should be shown.
471 */
472 void infoMessage(const QString& msg);
473
474 /**
475 * Is emitted if an error message with the content \a msg
476 * should be shown.
477 */
478 void errorMessage(const QString& msg);
479
480 /**
481 * Is emitted if an "operation completed" message with the content \a msg
482 * should be shown.
483 */
484 void operationCompletedMessage(const QString& msg);
485
486 /**
487 * Is emitted after DolphinView::setUrl() has been invoked and
488 * the current directory is loaded. If this signal is emitted,
489 * it is assured that the view contains already the correct root
490 * URL and property settings.
491 */
492 void directoryLoadingStarted();
493
494 /**
495 * Is emitted after the directory triggered by DolphinView::setUrl()
496 * has been loaded.
497 */
498 void directoryLoadingCompleted();
499
500 /**
501 * Is emitted after the directory loading triggered by DolphinView::setUrl()
502 * has been canceled.
503 */
504 void directoryLoadingCanceled();
505
506 /**
507 * Is emitted after DolphinView::setUrl() has been invoked and provides
508 * the information how much percent of the current directory have been loaded.
509 */
510 void directoryLoadingProgress(int percent);
511
512 /**
513 * Is emitted if the sorting is done asynchronously and provides the
514 * progress information of the sorting.
515 */
516 void directorySortingProgress(int percent);
517
518 /**
519 * Emitted when the file-item-model emits redirection.
520 * Testcase: fish://localhost
521 */
522 void redirection(const QUrl& oldUrl, const QUrl& newUrl);
523
524 /**
525 * Is emitted when the URL set by DolphinView::setUrl() represents a file.
526 * In this case no signal errorMessage() will be emitted.
527 */
528 void urlIsFileError(const QUrl& url);
529
530 /**
531 * Is emitted when the write state of the folder has been changed. The application
532 * should disable all actions like "Create New..." that depend on the write
533 * state.
534 */
535 void writeStateChanged(bool isFolderWritable);
536
537 /**
538 * Is emitted if the URL should be changed to the previous URL of the
539 * history (e.g. because the "back"-mousebutton has been pressed).
540 */
541 void goBackRequested();
542
543 /**
544 * Is emitted if the URL should be changed to the next URL of the
545 * history (e.g. because the "next"-mousebutton has been pressed).
546 */
547 void goForwardRequested();
548
549 protected:
550 /** Changes the zoom level if Control is pressed during a wheel event. */
551 virtual void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE;
552
553 virtual void hideEvent(QHideEvent* event) Q_DECL_OVERRIDE;
554 virtual bool event(QEvent* event) Q_DECL_OVERRIDE;
555
556 private slots:
557 /**
558 * Marks the view as active (DolphinView:isActive() will return true)
559 * and emits the 'activated' signal if it is not already active.
560 */
561 void activate();
562
563 void slotItemActivated(int index);
564 void slotItemsActivated(const KItemSet& indexes);
565 void slotItemMiddleClicked(int index);
566 void slotItemContextMenuRequested(int index, const QPointF& pos);
567 void slotViewContextMenuRequested(const QPointF& pos);
568 void slotHeaderContextMenuRequested(const QPointF& pos);
569 void slotHeaderColumnWidthChanged(const QByteArray& role, qreal current, qreal previous);
570 void slotItemHovered(int index);
571 void slotItemUnhovered(int index);
572 void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
573 void slotModelChanged(KItemModelBase* current, KItemModelBase* previous);
574 void slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons);
575
576 /*
577 * Is called when new items get pasted or dropped.
578 */
579 void slotItemCreated(const QUrl &url);
580 /*
581 * Is called after all pasted or dropped items have been copied to destination.
582 */
583 void slotPasteJobResult(KJob *job);
584
585 /**
586 * Emits the signal \a selectionChanged() with a small delay. This is
587 * because getting all file items for the selection can be an expensive
588 * operation. Fast selection changes are collected in this case and
589 * the signal is emitted only after no selection change has been done
590 * within a small delay.
591 */
592 void slotSelectionChanged(const KItemSet& current, const KItemSet& previous);
593
594 /**
595 * Is called by emitDelayedSelectionChangedSignal() and emits the
596 * signal \a selectionChanged() with all selected file items as parameter.
597 */
598 void emitSelectionChangedSignal();
599
600 /**
601 * Updates the view properties of the current URL to the
602 * sorting given by \a role.
603 */
604 void updateSortRole(const QByteArray& role);
605
606 /**
607 * Updates the view properties of the current URL to the
608 * sort order given by \a order.
609 */
610 void updateSortOrder(Qt::SortOrder order);
611
612 /**
613 * Updates the view properties of the current URL to the
614 * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
615 */
616 void updateSortFoldersFirst(bool foldersFirst);
617
618 /**
619 * Indicates in the status bar that the delete operation
620 * of the job \a job has been finished.
621 */
622 void slotDeleteFileFinished(KJob* job);
623
624 /**
625 * Indicates in the status bar that the trash operation
626 * of the job \a job has been finished.
627 */
628 void slotTrashFileFinished(KJob* job);
629
630 /**
631 * Invoked when the rename job is done, for error handling.
632 */
633 void slotRenamingResult(KJob* job);
634
635 /**
636 * Invoked when the file item model has started the loading
637 * of the directory specified by DolphinView::url().
638 */
639 void slotDirectoryLoadingStarted();
640
641 /**
642 * Invoked when the file item model indicates that the loading of a directory has
643 * been completed. Assures that pasted items and renamed items get seleced.
644 */
645 void slotDirectoryLoadingCompleted();
646
647 /**
648 * Is invoked when items of KFileItemModel have been changed.
649 */
650 void slotItemsChanged();
651
652 /**
653 * Is invoked when the sort order has been changed by the user by clicking
654 * on a header item. The view properties of the directory will get updated.
655 */
656 void slotSortOrderChangedByHeader(Qt::SortOrder current, Qt::SortOrder previous);
657
658 /**
659 * Is invoked when the sort role has been changed by the user by clicking
660 * on a header item. The view properties of the directory will get updated.
661 */
662 void slotSortRoleChangedByHeader(const QByteArray& current, const QByteArray& previous);
663
664 /**
665 * Is invoked when the visible roles have been changed by the user by dragging
666 * a header item. The view properties of the directory will get updated.
667 */
668 void slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
669 const QList<QByteArray>& previous);
670
671 void slotRoleEditingCanceled();
672 void slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value);
673
674 /**
675 * Observes the item with the URL \a url. As soon as the directory
676 * model indicates that the item is available, the item will
677 * get selected and it is assured that the item stays visible.
678 */
679 void observeCreatedItem(const QUrl &url);
680
681 /**
682 * Called when a redirection happens.
683 * Testcase: fish://localhost
684 */
685 void slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl);
686
687 /**
688 * Applies the state that has been restored by restoreViewState()
689 * to the view.
690 */
691 void updateViewState();
692
693 void hideToolTip();
694
695 /**
696 * Calculates the number of currently shown files into
697 * \a fileCount and the number of folders into \a folderCount.
698 * The size of all files is written into \a totalFileSize.
699 * It is recommend using this method instead of asking the
700 * directory lister or the model directly, as it takes
701 * filtering and hierarchical previews into account.
702 */
703 void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
704
705 private:
706 void loadDirectory(const QUrl& url, bool reload = false);
707
708 /**
709 * Applies the view properties which are defined by the current URL
710 * to the DolphinView properties. The view properties are read from a
711 * .directory file either in the current directory, or in the
712 * share/apps/dolphin/view_properties/ subfolder of the user's .kde folder.
713 */
714 void applyViewProperties();
715
716 /**
717 * Applies the given view properties to the DolphinView.
718 */
719 void applyViewProperties(const ViewProperties& props);
720
721 /**
722 * Applies the m_mode property to the corresponding
723 * itemlayout-property of the KItemListView.
724 */
725 void applyModeToView();
726
727 /**
728 * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
729 * Pastes the clipboard data into the URL \a url.
730 */
731 void pasteToUrl(const QUrl& url);
732
733 /**
734 * Returns a list of URLs for all selected items. The list is
735 * simplified, so that when the URLs are part of different tree
736 * levels, only the parent is returned.
737 */
738 QList<QUrl> simplifiedSelectedUrls() const;
739
740 /**
741 * Returns the MIME data for all selected items.
742 */
743 QMimeData* selectionMimeData() const;
744
745 /**
746 * Updates m_isFolderWritable dependent on whether the folder represented by
747 * the current URL is writable. If the state has changed, the signal
748 * writeableStateChanged() will be emitted.
749 */
750 void updateWritableState();
751
752 /**
753 * @return The current URL if no viewproperties-context is given (see
754 * DolphinView::viewPropertiesContext(), otherwise the context
755 * is returned.
756 */
757 QUrl viewPropertiesUrl() const;
758
759 private:
760 bool m_active;
761 bool m_tabsForFiles;
762 bool m_assureVisibleCurrentIndex;
763 bool m_isFolderWritable;
764 bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
765 // tooltip may be shown when hovering an item.
766
767 QUrl m_url;
768 QString m_viewPropertiesContext;
769 Mode m_mode;
770 QList<QByteArray> m_visibleRoles;
771
772 QVBoxLayout* m_topLayout;
773
774 KFileItemModel* m_model;
775 DolphinItemListView* m_view;
776 KItemListContainer* m_container;
777
778 ToolTipManager* m_toolTipManager;
779
780 QTimer* m_selectionChangedTimer;
781
782 QUrl m_currentItemUrl; // Used for making the view to remember the current URL after F5
783 bool m_scrollToCurrentItem; // Used for marking we need to scroll to current item or not
784 QPoint m_restoredContentsPosition;
785
786 QList<QUrl> m_selectedUrls; // Used for making the view to remember selections after F5
787 bool m_clearSelectionBeforeSelectingNewItems;
788 bool m_markFirstNewlySelectedItemAsCurrent;
789
790 VersionControlObserver* m_versionControlObserver;
791
792 // For unit tests
793 friend class TestBase;
794 friend class DolphinDetailsViewTest;
795 friend class DolphinPart; // Accesses m_model
796 };
797
798 /// Allow using DolphinView::Mode in QVariant
799 Q_DECLARE_METATYPE(DolphinView::Mode)
800
801 #endif // DOLPHINVIEW_H