Warning, file /system/dolphin/src/views/dolphinitemlistview.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef DOLPHINITEMLISTVIEW_H 0008 #define DOLPHINITEMLISTVIEW_H 0009 0010 #include "dolphin_export.h" 0011 #include "kitemviews/kfileitemlistview.h" 0012 0013 class KFileItemListView; 0014 0015 /** 0016 * @brief Dolphin specific view-implementation. 0017 * 0018 * Offers zoom-level support and takes care for translating 0019 * the view-properties into the corresponding KItemListView 0020 * properties. 0021 */ 0022 class DOLPHIN_EXPORT DolphinItemListView : public KFileItemListView 0023 { 0024 Q_OBJECT 0025 0026 public: 0027 explicit DolphinItemListView(QGraphicsWidget *parent = nullptr); 0028 ~DolphinItemListView() override; 0029 0030 void setZoomLevel(int level); 0031 int zoomLevel() const; 0032 0033 enum SelectionTogglesEnabled { True, False, FollowSetting }; 0034 /** 0035 * Sets whether the items in this view should show a small selection toggle area on mouse hover. 0036 * The default for this view is to follow the "showSelectionToggle" setting but this method can 0037 * be used to ignore that setting and force a different value. 0038 */ 0039 void setEnabledSelectionToggles(SelectionTogglesEnabled selectionTogglesEnabled); 0040 0041 void readSettings(); 0042 void writeSettings(); 0043 0044 protected: 0045 KItemListWidgetCreatorBase *defaultWidgetCreator() const override; 0046 /** Overwriting in the Dolphin-specific class because we want this to be user-configurable. 0047 * @see KStandardItemListView::itemLayoutHighlightEntireRow */ 0048 bool itemLayoutHighlightEntireRow(ItemLayout layout) const override; 0049 bool itemLayoutSupportsItemExpanding(ItemLayout layout) const override; 0050 void onItemLayoutChanged(ItemLayout current, ItemLayout previous) override; 0051 void onPreviewsShownChanged(bool shown) override; 0052 void onVisibleRolesChanged(const QList<QByteArray> ¤t, const QList<QByteArray> &previous) override; 0053 0054 void updateFont() override; 0055 0056 private: 0057 void updateGridSize(); 0058 0059 using KItemListView::setEnabledSelectionToggles; // Makes sure that the setEnabledSelectionToggles() declaration above doesn't hide 0060 // the one from the base class so we can still use it privately. 0061 SelectionTogglesEnabled m_selectionTogglesEnabled = FollowSetting; 0062 0063 private: 0064 int m_zoomLevel; 0065 }; 0066 0067 #endif