2 * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #ifndef DOLPHINITEMLISTVIEW_H
8 #define DOLPHINITEMLISTVIEW_H
10 #include "dolphin_export.h"
11 #include "kitemviews/kfileitemlistview.h"
13 class KFileItemListView
;
16 * @brief Dolphin specific view-implementation.
18 * Offers zoom-level support and takes care for translating
19 * the view-properties into the corresponding KItemListView
22 class DOLPHIN_EXPORT DolphinItemListView
: public KFileItemListView
27 explicit DolphinItemListView(QGraphicsWidget
* parent
= nullptr);
28 ~DolphinItemListView() override
;
30 void setZoomLevel(int level
);
31 int zoomLevel() const;
33 enum SelectionTogglesEnabled
{
39 * Sets whether the items in this view should show a small selection toggle area on mouse hover.
40 * The default for this view is to follow the "showSelectionToggle" setting but this method can
41 * be used to ignore that setting and force a different value.
43 void setEnabledSelectionToggles(SelectionTogglesEnabled selectionTogglesEnabled
);
49 KItemListWidgetCreatorBase
* defaultWidgetCreator() const override
;
50 /** Overwriting in the Dolphin-specific class because we want this to be user-configurable.
51 * @see KStandardItemListView::itemLayoutHighlightEntireRow */
52 bool itemLayoutHighlightEntireRow(ItemLayout layout
) const override
;
53 bool itemLayoutSupportsItemExpanding(ItemLayout layout
) const override
;
54 void onItemLayoutChanged(ItemLayout current
, ItemLayout previous
) override
;
55 void onPreviewsShownChanged(bool shown
) override
;
56 void onVisibleRolesChanged(const QList
<QByteArray
>& current
,
57 const QList
<QByteArray
>& previous
) override
;
59 void updateFont() override
;
62 void updateGridSize();
64 using KItemListView::setEnabledSelectionToggles
; // Makes sure that the setEnabledSelectionToggles() declaration above doesn't hide
65 // the one from the base class so we can still use it privately.
66 SelectionTogglesEnabled m_selectionTogglesEnabled
= FollowSetting
;