]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinview.h
show the actions of a revision control plugin in the context menu
[dolphin.git] / src / dolphinview.h
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
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
22 #ifndef DOLPHINVIEW_H
23 #define DOLPHINVIEW_H
24
25 #include <config-nepomuk.h>
26
27 #include "libdolphin_export.h"
28
29 #include <kparts/part.h>
30 #include <kfileitem.h>
31 #include <kfileitemdelegate.h>
32 #include <kio/fileundomanager.h>
33 #include <kio/job.h>
34
35 #include <QBoxLayout>
36 #include <QKeyEvent>
37 #include <QLinkedList>
38 #include <QListView>
39 #include <QSet>
40 #include <QWidget>
41
42 typedef KIO::FileUndoManager::CommandType CommandType;
43
44 class DolphinController;
45 class DolphinColumnView;
46 class DolphinDetailsView;
47 class DolphinFileItemDelegate;
48 class DolphinIconsView;
49 class DolphinMainWindow;
50 class DolphinModel;
51 class DolphinSortFilterProxyModel;
52 class KFilePreviewGenerator;
53 class KAction;
54 class KActionCollection;
55 class KDirLister;
56 class KUrl;
57 class KToggleAction;
58 class RevisionControlObserver;
59 class ToolTipManager;
60 class QModelIndex;
61 class ViewProperties;
62
63 /**
64 * @short Represents a view for the directory content.
65 *
66 * View modes for icons, details and columns are supported. It's
67 * possible to adjust:
68 * - sort order
69 * - sort type
70 * - show hidden files
71 * - show previews
72 *
73 * @see DolphinIconsView
74 * @see DolphinDetailsView
75 * @see DolphinColumnView
76 */
77 class LIBDOLPHINPRIVATE_EXPORT DolphinView : public QWidget
78 {
79 Q_OBJECT
80
81 public:
82 /**
83 * Defines the view mode for a directory. The view mode
84 * can be defined when constructing a DolphinView. The
85 * view mode is automatically updated if the directory itself
86 * defines a view mode (see class ViewProperties for details).
87 */
88 enum Mode
89 {
90 /**
91 * The directory items are shown as icons including an
92 * icon name.
93 */
94 IconsView = 0,
95
96 /**
97 * The icon, the name and at least the size of the directory
98 * items are shown in a table. It is possible to add columns
99 * for date, group and permissions.
100 */
101 DetailsView = 1,
102
103 /**
104 * Each folder is shown in a separate column.
105 */
106 ColumnView = 2,
107 MaxModeEnum = ColumnView
108 };
109
110 /** Defines the sort order for the items of a directory. */
111 enum Sorting
112 {
113 SortByName = 0,
114 SortBySize,
115 SortByDate,
116 SortByPermissions,
117 SortByOwner,
118 SortByGroup,
119 SortByType,
120 SortByRating,
121 SortByTags,
122 MaxSortEnum = SortByTags
123 };
124
125 /**
126 * @param parent Parent widget of the view.
127 * @param url Specifies the content which should be shown.
128 * @param dirLister Used directory lister. The lister is not owned
129 * by the view and won't get deleted.
130 * @param dolphinModel Used directory model. The model is not owned
131 * by the view and won't get deleted.
132 * @param proxyModel Used proxy model which specifies the sorting. The
133 * model is not owned by the view and won't get
134 * deleted.
135 */
136 DolphinView(QWidget* parent,
137 const KUrl& url,
138 KDirLister* dirLister,
139 DolphinModel* dolphinModel,
140 DolphinSortFilterProxyModel* proxyModel);
141
142 virtual ~DolphinView();
143
144 /**
145 * Returns the current active URL, where all actions are applied.
146 * The URL navigator is synchronized with this URL.
147 */
148 const KUrl& url() const;
149
150 /**
151 * Returns the root URL of the view, which is defined as the first
152 * visible path of DolphinView::url(). Usually the root URL is
153 * equal to DolphinView::url(), but in the case of the column view
154 * when 2 columns are shown, the root URL might be:
155 * /home/peter/Documents
156 * and DolphinView::url() might return
157 * /home/peter/Documents/Music/
158 */
159 KUrl rootUrl() const;
160
161 /**
162 * If \a active is true, the view will marked as active. The active
163 * view is defined as view where all actions are applied to.
164 */
165 void setActive(bool active);
166 bool isActive() const;
167
168 /**
169 * Changes the view mode for the current directory to \a mode.
170 * If the view properties should be remembered for each directory
171 * (GeneralSettings::globalViewProps() returns false), then the
172 * changed view mode will be stored automatically.
173 */
174 void setMode(Mode mode);
175 Mode mode() const;
176
177 /** See setShowPreview */
178 bool showPreview() const;
179
180 /** See setShowHiddenFiles */
181 bool showHiddenFiles() const;
182
183 /** See setCategorizedSorting */
184 bool categorizedSorting() const;
185
186 /**
187 * Returns true, if the categorized sorting is supported by the current
188 * used mode (see DolphinView::setMode()). Currently only DolphinView::IconsView
189 * supports categorizations. To check whether the categorized
190 * sorting is set, use DolphinView::categorizedSorting().
191 */
192 bool supportsCategorizedSorting() const;
193
194 /**
195 * Selects all items.
196 * @see DolphinView::selectedItems()
197 */
198 void selectAll();
199
200 /**
201 * Inverts the current selection: selected items get unselected,
202 * unselected items get selected.
203 * @see DolphinView::selectedItems()
204 */
205 void invertSelection();
206
207 /** Returns true, if at least one item is selected. */
208 bool hasSelection() const;
209
210 void clearSelection();
211
212 /**
213 * Returns the selected items. The list is empty if no item has been
214 * selected.
215 * @see DolphinView::selectedUrls()
216 */
217 KFileItemList selectedItems() const;
218
219 /**
220 * Returns a list of URLs for all selected items. An empty list
221 * is returned, if no item is selected.
222 * @see DolphinView::selectedItems()
223 */
224 KUrl::List selectedUrls() const;
225
226 /**
227 * Returns the number of selected items (this is faster than
228 * invoking selectedItems().count()).
229 */
230 int selectedItemsCount() const;
231
232 /**
233 * Sets the upper left position of the view content
234 * to (x,y). The content of the view might be larger than the visible area
235 * and hence a scrolling must be done.
236 */
237 void setContentsPosition(int x, int y);
238
239 /** Returns the upper left position of the view content. */
240 QPoint contentsPosition() const;
241
242 /**
243 * Sets the zoom level to \a level. It is assured that the used
244 * level is adjusted to be inside the range ZoomLevelInfo::minimumLevel() and
245 * ZoomLevelInfo::maximumLevel().
246 */
247 void setZoomLevel(int level);
248 int zoomLevel() const;
249
250 /**
251 * Returns true, if zooming in is possible. If false is returned,
252 * the maximum zooming level has been reached.
253 */
254 bool isZoomInPossible() const;
255
256 /**
257 * Returns true, if zooming out is possible. If false is returned,
258 * the minimum zooming level has been reached.
259 */
260 bool isZoomOutPossible() const;
261
262 /** Sets the sort order of the items inside a directory (see DolphinView::Sorting). */
263 void setSorting(Sorting sorting);
264
265 /** Returns the sort order of the items inside a directory (see DolphinView::Sorting). */
266 Sorting sorting() const;
267
268 /** Sets the sort order (Qt::Ascending or Qt::Descending) for the items. */
269 void setSortOrder(Qt::SortOrder order);
270
271 /** Returns the current used sort order (Qt::Ascending or Qt::Descending). */
272 Qt::SortOrder sortOrder() const;
273
274 /** Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */
275 void setSortFoldersFirst(bool foldersFirst);
276
277 /** Returns if files and folders are sorted separately or not. */
278 bool sortFoldersFirst() const;
279
280 /** Sets the additional information which should be shown for the items. */
281 void setAdditionalInfo(KFileItemDelegate::InformationList info);
282
283 /** Returns the additional information which should be shown for the items. */
284 KFileItemDelegate::InformationList additionalInfo() const;
285
286 /** Reloads the current directory. */
287 void reload();
288
289 /**
290 * Refreshes the view to get synchronized with the (updated) Dolphin settings.
291 * This method only needs to get invoked if the view settings for the Icons View,
292 * Details View or Columns View have been changed.
293 */
294 void refresh();
295
296 /**
297 * Changes the directory of the view to \a url. If \a rootUrl is empty, the view
298 * properties from \a url are used for adjusting the view mode and the other properties.
299 * If \a rootUrl is not empty, the view properties from the root URL are considered
300 * instead. Specifying a root URL is only required if a view having a different root URL
301 * (e. g. the column view) should be restored. Usually using DolphinView::setUrl()
302 * is enough for changing the current URL.
303 */
304 void updateView(const KUrl& url, const KUrl& rootUrl);
305
306 /**
307 * Filters the currently shown items by \a nameFilter. All items
308 * which contain the given filter string will be shown.
309 */
310 void setNameFilter(const QString& nameFilter);
311
312 /**
313 * Calculates the number of currently shown files into
314 * \a fileCount and the number of folders into \a folderCount.
315 * The size of all files is written into \a totalFileSize.
316 * It is recommend using this method instead of asking the
317 * directory lister or the model directly, as it takes
318 * filtering and hierarchical previews into account.
319 */
320 void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
321
322 /**
323 * Returns a textual representation of the state of the current
324 * folder or selected items, suitable for use in the status bar.
325 */
326 QString statusBarText() const;
327
328 /**
329 * Returns the revision control actions that are provided for the items \p items.
330 * Usually the actions are presented in the context menu.
331 */
332 QList<QAction*> revisionControlActions(const KFileItemList& items) const;
333
334 /**
335 * Updates the state of the 'Additional Information' actions in \a collection.
336 */
337 void updateAdditionalInfoActions(KActionCollection* collection);
338
339 /**
340 * Returns the state of the paste action:
341 * first is whether the action should be enabled
342 * second is the text for the action
343 */
344 QPair<bool, QString> pasteInfo() const;
345
346 /**
347 * If \a tabsForFiles is true, the signal tabRequested() will also
348 * emitted also for files. Per default tabs for files is disabled
349 * and hence the signal tabRequested() will only be emitted for
350 * directories.
351 */
352 void setTabsForFilesEnabled(bool tabsForFiles);
353 bool isTabsForFilesEnabled() const;
354
355 /**
356 * Marks the item \a url as active item as soon as it has
357 * been loaded by the directory lister. This is useful mark
358 * the previously visited directory as active when going
359 * back in history (the URL is known, but the item is not
360 * loaded yet).
361 */
362 void activateItem(const KUrl& url);
363
364 /**
365 * Returns true if the current view allows folders to be expanded,
366 * i.e. presents a hierarchical view to the user.
367 */
368 bool itemsExpandable() const;
369
370 public slots:
371 /**
372 * Changes the directory to \a url. If the current directory is equal to
373 * \a url, nothing will be done (use DolphinView::reload() instead).
374 */
375 void setUrl(const KUrl& url);
376
377 /**
378 * Request of a selection change. The view will do its best to accommodate
379 * the request, but it is not guaranteed that all items in \a selection
380 * will actually get selected. The view will e.g. not select items which
381 * are not in the currently displayed folder.
382 */
383 void changeSelection(const KFileItemList& selection);
384
385 /**
386 * Triggers the renaming of the currently selected items, where
387 * the user must input a new name for the items.
388 */
389 void renameSelectedItems();
390
391 /**
392 * Moves all selected items to the trash.
393 */
394 void trashSelectedItems();
395
396 /**
397 * Deletes all selected items.
398 */
399 void deleteSelectedItems();
400
401 /**
402 * Copies all selected items to the clipboard and marks
403 * the items as cutted.
404 */
405 void cutSelectedItems();
406
407 /** Copies all selected items to the clipboard. */
408 void copySelectedItems();
409
410 /** Pastes the clipboard data to this view. */
411 void paste();
412
413 /**
414 * Pastes the clipboard data into the currently selected
415 * folder. If the current selection is not exactly one folder, no
416 * paste operation is done.
417 */
418 void pasteIntoFolder();
419
420 /**
421 * Turns on the file preview for the all files of the current directory,
422 * if \a show is true.
423 * If the view properties should be remembered for each directory
424 * (GeneralSettings::globalViewProps() returns false), then the
425 * preview setting will be stored automatically.
426 */
427 void setShowPreview(bool show);
428
429 /**
430 * Shows all hidden files of the current directory,
431 * if \a show is true.
432 * If the view properties should be remembered for each directory
433 * (GeneralSettings::globalViewProps() returns false), then the
434 * show hidden file setting will be stored automatically.
435 */
436 void setShowHiddenFiles(bool show);
437
438 /**
439 * Summarizes all sorted items by their category \a categorized
440 * is true.
441 * If the view properties should be remembered for each directory
442 * (GeneralSettings::globalViewProps() returns false), then the
443 * categorized sorting setting will be stored automatically.
444 */
445 void setCategorizedSorting(bool categorized);
446
447 /** Switches between an ascending and descending sorting order. */
448 void toggleSortOrder();
449
450 /** Switches between a separate sorting (with folders first) and a mixed sorting of files and folders. */
451 void toggleSortFoldersFirst();
452
453 /**
454 * Switches on or off the displaying of additional information
455 * as specified by \a action.
456 */
457 void toggleAdditionalInfo(QAction* action);
458
459 signals:
460 /**
461 * Is emitted if the view has been activated by e. g. a mouse click.
462 */
463 void activated();
464
465 /** Is emitted if URL of the view has been changed to \a url. */
466 void urlChanged(const KUrl& url);
467
468 /**
469 * Is emitted if the view requests a changing of the current
470 * URL to \a url (see DolphinController::triggerUrlChangeRequest()).
471 */
472 void requestUrlChange(const KUrl& url);
473
474 /**
475 * Is emitted when clicking on an item with the left mouse button.
476 */
477 void itemTriggered(const KFileItem& item);
478
479 /**
480 * Is emitted if a new tab should be opened for the URL \a url.
481 */
482 void tabRequested(const KUrl& url);
483
484 /**
485 * Is emitted if the view mode (IconsView, DetailsView,
486 * PreviewsView) has been changed.
487 */
488 void modeChanged();
489
490 /** Is emitted if the 'show preview' property has been changed. */
491 void showPreviewChanged();
492
493 /** Is emitted if the 'show hidden files' property has been changed. */
494 void showHiddenFilesChanged();
495
496 /** Is emitted if the 'categorized sorting' property has been changed. */
497 void categorizedSortingChanged();
498
499 /** Is emitted if the sorting by name, size or date has been changed. */
500 void sortingChanged(DolphinView::Sorting sorting);
501
502 /** Is emitted if the sort order (ascending or descending) has been changed. */
503 void sortOrderChanged(Qt::SortOrder order);
504
505 /** Is emitted if the sorting of files and folders (separate with folders first or mixed) has been changed. */
506 void sortFoldersFirstChanged(bool foldersFirst);
507
508 /** Is emitted if the additional information shown for this view has been changed. */
509 void additionalInfoChanged();
510
511 /** Is emitted if the zoom level has been changed by zooming in or out. */
512 void zoomLevelChanged(int level);
513
514 /**
515 * Is emitted if information of an item is requested to be shown e. g. in the panel.
516 * If item is null, no item information request is pending.
517 */
518 void requestItemInfo(const KFileItem& item);
519
520 /** Is emitted if the contents has been moved to \a x, \a y. */
521 void contentsMoved(int x, int y);
522
523 /**
524 * Is emitted whenever the selection has been changed.
525 */
526 void selectionChanged(const KFileItemList& selection);
527
528 /**
529 * Is emitted if a context menu is requested for the item \a item,
530 * which is part of \a url. If the item is null, the context menu
531 * for the URL should be shown and the custom actions \a customActions
532 * will be added.
533 */
534 void requestContextMenu(const KFileItem& item,
535 const KUrl& url,
536 const QList<QAction*>& customActions);
537
538 /**
539 * Is emitted if an information message with the content \a msg
540 * should be shown.
541 */
542 void infoMessage(const QString& msg);
543
544 /**
545 * Is emitted if an error message with the content \a msg
546 * should be shown.
547 */
548 void errorMessage(const QString& msg);
549
550 /**
551 * Is emitted if an "operation completed" message with the content \a msg
552 * should be shown.
553 */
554 void operationCompletedMessage(const QString& msg);
555
556 /**
557 * Is emitted after DolphinView::setUrl() has been invoked and
558 * the path \a url is currently loaded. If this signal is emitted,
559 * it is assured that the view contains already the correct root
560 * URL and property settings.
561 */
562 void startedPathLoading(const KUrl& url);
563
564 /**
565 * Emitted when KDirLister emits redirection.
566 * Testcase: fish://localhost
567 */
568 void redirection(const KUrl& oldUrl, const KUrl& newUrl);
569
570 protected:
571 /** @see QWidget::mouseReleaseEvent */
572 virtual void mouseReleaseEvent(QMouseEvent* event);
573 virtual void wheelEvent(QWheelEvent* event);
574 virtual bool eventFilter(QObject* watched, QEvent* event);
575
576 private slots:
577 /**
578 * Marks the view as active (DolphinView:isActive() will return true)
579 * and emits the 'activated' signal if it is not already active.
580 */
581 void activate();
582
583 /**
584 * If the item \a item is a directory, then this
585 * directory will be loaded. If the item is a file, the corresponding
586 * application will get started.
587 */
588 void triggerItem(const KFileItem& index);
589
590 /**
591 * Emits the signal \a selectionChanged() with a small delay. This is
592 * because getting all file items for the signal can be an expensive
593 * operation. Fast selection changes are collected in this case and
594 * the signal is emitted only after no selection change has been done
595 * within a small delay.
596 */
597 void emitDelayedSelectionChangedSignal();
598
599 /**
600 * Is called by emitDelayedSelectionChangedSignal() and emits the
601 * signal \a selectionChanged() with all selected file items as parameter.
602 */
603 void emitSelectionChangedSignal();
604
605 /**
606 * Opens the context menu on position \a pos. The position
607 * is used to check whether the context menu is related to an
608 * item or to the viewport.
609 */
610 void openContextMenu(const QPoint& pos, const QList<QAction*>& customActions);
611
612 /**
613 * Drops dragged URLs to the destination path \a destPath. If
614 * the URLs are dropped above an item inside the destination path,
615 * the item is indicated by \a destItem.
616 */
617 void dropUrls(const KFileItem& destItem,
618 const KUrl& destPath,
619 QDropEvent* event);
620
621 /**
622 * Updates the view properties of the current URL to the
623 * sorting given by \a sorting.
624 */
625 void updateSorting(DolphinView::Sorting sorting);
626
627 /**
628 * Updates the view properties of the current URL to the
629 * sort order given by \a order.
630 */
631 void updateSortOrder(Qt::SortOrder order);
632
633 /**
634 * Updates the view properties of the current URL to the
635 * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
636 */
637 void updateSortFoldersFirst(bool foldersFirst);
638
639 /**
640 * Updates the view properties of the current URL to the
641 * additional information given by \a info.
642 */
643 void updateAdditionalInfo(const KFileItemDelegate::InformationList& info);
644
645 /**
646 * Emits the signal contentsMoved with the current coordinates
647 * of the viewport as parameters.
648 */
649 void emitContentsMoved();
650
651 /**
652 * Updates the status bar to show hover information for the
653 * item \a item. If currently other items are selected,
654 * no hover information is shown.
655 * @see DolphinView::clearHoverInformation()
656 */
657 void showHoverInformation(const KFileItem& item);
658
659 /**
660 * Clears the hover information shown in the status bar.
661 * @see DolphinView::showHoverInformation().
662 */
663 void clearHoverInformation();
664
665 /**
666 * Indicates in the status bar that the delete operation
667 * of the job \a job has been finished.
668 */
669 void slotDeleteFileFinished(KJob* job);
670
671 /**
672 * Is emitted if the controller requests a changing of the current
673 * URL to \a url
674 */
675 void slotRequestUrlChange(const KUrl& url);
676
677 /**
678 * Invoked when the directory lister has completed the loading of
679 * items. Assures that pasted items and renamed items get seleced.
680 */
681 void slotDirListerCompleted();
682
683 /**
684 * Is invoked when the KDirLister indicates refreshed items.
685 */
686 void slotRefreshItems();
687
688 /**
689 * If \a view can be positively identified as not being the source for the
690 * current drag operation, deleteLater() it immediately. Else stores
691 * it for later deletion.
692 */
693 void deleteWhenNotDragSource(QAbstractItemView* view);
694
695 /**
696 * Observes the item with the URL \a url. As soon as the directory
697 * model indicates that the item is available, the item will
698 * get selected and it is assure that the item stays visible.
699 *
700 * @see selectAndScrollToCreatedItem()
701 */
702 void observeCreatedItem(const KUrl& url);
703
704 /**
705 * Selects and scrolls to the item that got observed
706 * by observeCreatedItem().
707 */
708 void selectAndScrollToCreatedItem();
709
710 /**
711 * Restore selection after view refresh.
712 */
713 void restoreSelection();
714
715 private:
716 void loadDirectory(const KUrl& url, bool reload = false);
717
718 /**
719 * Returns the URL where the view properties should be stored. Usually
720 * DolphinView::url() is returned, but in the case of a Column View the
721 * view properties are always stored in the directory represented by the
722 * first column. It is recommendend whenever using the ViewProperties class
723 * to use DolphinView::viewPropertiesUrl() as URL.
724 */
725 KUrl viewPropertiesUrl() const;
726
727 /**
728 * Applies the view properties which are defined by the current URL
729 * m_url to the DolphinView properties.
730 */
731 void applyViewProperties(const KUrl& url);
732
733 /**
734 * Creates a new view representing the given view mode (DolphinView::mode()).
735 * The current view will get deleted.
736 */
737 void createView();
738
739 void deleteView();
740
741 /**
742 * Returns a pointer to the currently used item view, which is either
743 * a ListView or a TreeView.
744 */
745 QAbstractItemView* itemView() const;
746
747 /**
748 * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
749 * Pastes the clipboard data into the URL \a url.
750 */
751 void pasteToUrl(const KUrl& url);
752
753 /**
754 * Checks whether the current item view has the same zoom level
755 * as \a oldZoomLevel. If this is not the case, the zoom level
756 * of the controller is updated and a zoomLevelChanged() signal
757 * is emitted.
758 */
759 void updateZoomLevel(int oldZoomLevel);
760
761 /**
762 * Returns a list of URLs for all selected items. The list is
763 * simplified, so that when the URLs are part of different tree
764 * levels, only the parent is returned.
765 */
766 KUrl::List simplifiedSelectedUrls() const;
767
768 /**
769 * Returns true, if the ColumnView is activated. As the column view
770 * requires some special handling for iterating through directories,
771 * this method has been introduced for convenience.
772 */
773 bool isColumnViewActive() const;
774
775 /**
776 * Returns the MIME data for all selected items.
777 */
778 QMimeData* selectionMimeData() const;
779
780 /**
781 * Is invoked after a paste operation or a drag & drop
782 * operation and adds the filenames of all URLs from \a mimeData to
783 * m_newFileNames. This allows to select all newly added
784 * items in slotDirListerCompleted().
785 */
786 void addNewFileNames(const QMimeData* mimeData);
787
788 private:
789 bool m_active : 1;
790 bool m_showPreview : 1;
791 bool m_loadingDirectory : 1;
792 bool m_storedCategorizedSorting : 1;
793 bool m_tabsForFiles : 1;
794 bool m_isContextMenuOpen : 1; // TODO: workaround for Qt-issue 207192
795 bool m_ignoreViewProperties : 1;
796 bool m_assureVisibleCurrentIndex : 1;
797
798 Mode m_mode;
799
800 DolphinMainWindow* m_mainWindow;
801 QVBoxLayout* m_topLayout;
802
803 DolphinController* m_controller;
804 DolphinIconsView* m_iconsView;
805 DolphinDetailsView* m_detailsView;
806 DolphinColumnView* m_columnView;
807 DolphinFileItemDelegate* m_fileItemDelegate;
808
809 QItemSelectionModel* m_selectionModel;
810 QTimer* m_selectionChangedTimer;
811
812 DolphinModel* m_dolphinModel;
813 KDirLister* m_dirLister;
814 DolphinSortFilterProxyModel* m_proxyModel;
815
816 KFilePreviewGenerator* m_previewGenerator;
817 ToolTipManager* m_toolTipManager;
818
819 RevisionControlObserver* m_revisionControlObserver;
820
821 KUrl m_rootUrl;
822 KUrl m_activeItemUrl;
823 KUrl m_createdItemUrl; // URL for a new item that got created by the "Create New..." menu
824 KFileItemList m_selectedItems; // this is used for making the View to remember selections after F5
825
826 /**
827 * Remembers the filenames that have been added by a paste operation
828 * or a drag & drop operation. Allows to select the items in
829 * slotDirListerCompleted().
830 */
831 QSet<QString> m_newFileNames;
832
833 QAbstractItemView* m_expandedDragSource;
834 };
835
836 inline bool DolphinView::isColumnViewActive() const
837 {
838 return m_columnView != 0;
839 }
840
841 /// Allow using DolphinView::Mode in QVariant
842 Q_DECLARE_METATYPE(DolphinView::Mode)
843
844 #endif // DOLPHINVIEW_H