File indexing completed on 2025-03-09 03:58:43

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2012-20-07
0007  * Description : Thumbnail bar for import tool
0008  *
0009  * SPDX-FileCopyrightText: 2012      by Islam Wazery <wazery at ubuntu dot com>
0010  * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_IMPORT_THUMBNAIL_BAR_H
0017 #define DIGIKAM_IMPORT_THUMBNAIL_BAR_H
0018 
0019 // Local includes
0020 
0021 #include "importcategorizedview.h"
0022 
0023 namespace Digikam
0024 {
0025 
0026 class ImportThumbnailBar : public ImportCategorizedView
0027 {
0028     Q_OBJECT
0029 
0030 public:
0031 
0032     explicit ImportThumbnailBar(QWidget* const parent = nullptr);
0033     ~ImportThumbnailBar() override;
0034 
0035     /**
0036      * This installs a duplicate filter model, if the ImportItemModel may contain duplicates.
0037      * Otherwise, just use setModels().
0038      */
0039     void setModelsFiltered(ImportItemModel* model, ImportSortFilterModel* filterModel);
0040 
0041     QModelIndex nextIndex(const QModelIndex& index)     const;
0042     QModelIndex previousIndex(const QModelIndex& index) const;
0043     QModelIndex firstIndex()                            const;
0044     QModelIndex lastIndex()                             const;
0045 
0046     /**
0047      * Sets the policy always for the one scroll bar which is relevant, depending on orientation
0048      */
0049     void setScrollBarPolicy(Qt::ScrollBarPolicy policy);
0050     void setFlow(QListView::Flow newFlow);
0051 
0052     void installOverlays();
0053 
0054 public Q_SLOTS:
0055 
0056     void assignRating(const QList<QModelIndex>& index, int rating);
0057     void slotDockLocationChanged(Qt::DockWidgetArea area);
0058 
0059 protected:
0060 
0061     void slotSetupChanged() override;
0062     bool event(QEvent*)     override;
0063 
0064 private:
0065 
0066     // Disable
0067     ImportThumbnailBar(const ImportThumbnailBar&)            = delete;
0068     ImportThumbnailBar& operator=(const ImportThumbnailBar&) = delete;
0069 
0070 private:
0071 
0072     class Private;
0073     Private* const d;
0074 };
0075 
0076 } // namespace Digikam
0077 
0078 #endif // DIGIKAM_IMPORT_THUMBNAIL_BAR_H