File indexing completed on 2025-01-19 03:59:42

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2007-11-15
0007  * Description : widget item delegate for setup collection view
0008  *
0009  * SPDX-FileCopyrightText: 2015-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2007-2008 by Rafael Fernández López <ereslibre at kde dot org>
0011  * SPDX-FileCopyrightText: 2008      by Kevin Ottens <ervin at kde dot org>
0012  *
0013  * SPDX-License-Identifier: GPL-2.0-or-later
0014  *
0015  * ============================================================ */
0016 
0017 #ifndef DIGIKAM_DW_ITEM_DELEGATE_PRIVATE_H
0018 #define DIGIKAM_DW_ITEM_DELEGATE_PRIVATE_H
0019 
0020 #include "dwitemdelegate.h"
0021 
0022 // Qt includes
0023 
0024 #include <QObject>
0025 #include <QItemSelectionModel>
0026 
0027 namespace Digikam
0028 {
0029 
0030 class DWItemDelegate;
0031 class DWItemDelegatePool;
0032 
0033 class Q_DECL_HIDDEN DWItemDelegatePrivate : public QObject
0034 {
0035     Q_OBJECT
0036 
0037 public:
0038 
0039     explicit DWItemDelegatePrivate(DWItemDelegate* const q, QObject* const parent = nullptr);
0040     ~DWItemDelegatePrivate()                            override;
0041 
0042     void updateRowRange(const QModelIndex& parent, int start, int end, bool isRemoving);
0043     QStyleOptionViewItem optionView(const QModelIndex& index);
0044 
0045 public Q_SLOTS:
0046 
0047     void initializeModel(const QModelIndex& parent = QModelIndex());
0048 
0049     void slotDWRowsInserted(const QModelIndex& parent, int start, int end);
0050     void slotDWRowsAboutToBeRemoved(const QModelIndex& parent, int start, int end);
0051     void slotDWRowsRemoved(const QModelIndex& parent, int start, int end);
0052     void slotDWDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
0053     void slotDWLayoutChanged();
0054     void slotDWModelReset();
0055     void slotDWSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
0056 
0057 protected:
0058 
0059     bool eventFilter(QObject* watched, QEvent* event)   override;
0060 
0061 public:
0062 
0063     QAbstractItemView*   itemView;
0064     DWItemDelegatePool*  widgetPool;
0065     QAbstractItemModel*  model;
0066     QItemSelectionModel* selectionModel;
0067     DWItemDelegate*      q;
0068 };
0069 
0070 } // namespace Digikam
0071 
0072 #endif // DIGIKAM_DW_ITEM_DELEGATE_PRIVATE_H