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