File indexing completed on 2025-01-05 04:00:12

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2013-08-22
0007  * Description : Reimplemented QListView for metadata setup, with support for
0008  *               drag-n-drop
0009  *
0010  * SPDX-FileCopyrightText: 2013-2015 by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_NAMESPACE_LISTVIEW_H
0017 #define DIGIKAM_NAMESPACE_LISTVIEW_H
0018 
0019 // Qt includes
0020 
0021 #include <QListView>
0022 
0023 class QPoint;
0024 
0025 namespace Digikam
0026 {
0027 
0028 class NamespaceListView : public QListView
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033 
0034     explicit NamespaceListView(QWidget* const parent = nullptr);
0035     QModelIndexList mySelectedIndexes();
0036 
0037 protected:
0038 
0039     /**
0040      * Reimplemented methods to enable custom drag-n-drop in QListView
0041      */
0042     void startDrag(Qt::DropActions supportedActions) override;
0043     void dropEvent(QDropEvent* e) override;
0044 
0045     QModelIndex indexVisuallyAt(const QPoint& p);
0046 
0047     /**
0048      * @brief contextMenuEvent - reimplemented method from QListView
0049      *                           to handle custom context menu
0050      */
0051 /*
0052     void contextMenuEvent(QContextMenuEvent* event);
0053 */
0054 
0055 Q_SIGNALS:
0056 
0057     void signalItemsChanged();
0058 
0059 public Q_SLOTS:
0060 
0061     /**
0062      * @brief slotDeleteSelected - delete selected item from Quick Access List
0063      */
0064     void slotDeleteSelected();
0065 
0066     void slotMoveItemDown();
0067 
0068     void slotMoveItemUp();
0069 };
0070 
0071 } // namespace Digikam
0072 
0073 #endif // DIGIKAM_NAMESPACE_LISTVIEW_H