File indexing completed on 2025-01-05 03:57:54

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2021-08-27
0007  * Description : Showfoto folder view model.
0008  *
0009  * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef SHOWFOTO_FOLDER_VIEW_MODEL_H
0016 #define SHOWFOTO_FOLDER_VIEW_MODEL_H
0017 
0018 // QT includes
0019 
0020 #include <QFileSystemModel>
0021 #include <QStringList>
0022 
0023 // Local includes
0024 
0025 #include "loadingdescription.h"
0026 
0027 using namespace Digikam;
0028 
0029 namespace ShowFoto
0030 {
0031 
0032 class ShowfotoFolderViewList;
0033 
0034 class ShowfotoFolderViewModel : public QFileSystemModel
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039 
0040     explicit ShowfotoFolderViewModel(ShowfotoFolderViewList* const view);
0041     ~ShowfotoFolderViewModel()                              override;
0042 
0043     static int maxIconSize();
0044 
0045     QVariant data(const QModelIndex& index, int role) const override;
0046 
0047     /**
0048      * List all file paths from the current model root index selected in the view.
0049      */
0050     QStringList currentFilesPath() const;
0051 
0052 private Q_SLOTS:
0053 
0054     void refreshThumbnails(const LoadingDescription& desc, const QPixmap& pix);
0055 
0056 private:
0057 
0058     class Private;
0059     Private* const d;
0060 };
0061 
0062 } // namespace ShowFoto
0063 
0064 #endif // SHOWFOTO_FOLDER_VIEW_MODEL_H