File indexing completed on 2025-01-19 03:50:39

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2009-05-04
0007  * Description : Various operation on items
0008  *
0009  * SPDX-FileCopyrightText: 2002-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2009-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_ITEM_VIEW_UTILITIES_H
0017 #define DIGIKAM_ITEM_VIEW_UTILITIES_H
0018 
0019 // Qt includes
0020 
0021 #include <QList>
0022 #include <QWidget>
0023 #include <QUrl>
0024 
0025 // Local includes
0026 
0027 #include "iteminfo.h"
0028 #include "digikam_export.h"
0029 
0030 namespace Digikam
0031 {
0032 class Album;
0033 
0034 class DIGIKAM_GUI_EXPORT ItemViewUtilities : public QObject
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039 
0040     enum DeleteMode
0041     {
0042         DeletePermanently = 1,
0043         DeleteUseTrash    = 2
0044     };
0045 
0046 public:
0047 
0048     explicit ItemViewUtilities(QWidget* const parentWidget);
0049 
0050 public Q_SLOTS:
0051 
0052     void copyItemsToExternalFolder(const QList<ItemInfo>& infos);
0053     void createNewAlbumForInfos(const QList<ItemInfo>& infos, Album* currentAlbum);
0054     bool deleteImages(const QList<ItemInfo>& infos, const DeleteMode deleteMode);
0055     void deleteImagesDirectly(const QList<ItemInfo>& infos, const DeleteMode deleteMode);
0056 
0057     void insertToLightTableAuto(const QList<ItemInfo>& all, const QList<ItemInfo>& selected, const ItemInfo& current);
0058     void insertToLightTable(const QList<ItemInfo>& list, const ItemInfo& current, bool addTo);
0059 
0060     void insertToQueueManager(const QList<ItemInfo>& list, const ItemInfo& currentInfo, bool newQueue);
0061     void insertSilentToQueueManager(const QList<ItemInfo>& list, const ItemInfo& currentInfo, int queueid);
0062 
0063     void notifyFileContentChanged(const QList<QUrl>& urls);
0064 
0065     void openInfos(const ItemInfo& info, const QList<ItemInfo>& allInfosToOpen, Album* currentAlbum);
0066     void openInfosWithDefaultApplication(const QList<ItemInfo>& allInfosToOpen);
0067 
0068     void rename(const QUrl& imageUrl, const QString& newName, bool overwrite = false);
0069     void setAsAlbumThumbnail(Album* album, const ItemInfo& itemInfo);
0070 
0071     void createGroupByTimeFromInfoList(const ItemInfoList& itemInfoList);
0072     void createGroupByFilenameFromInfoList(const ItemInfoList& itemInfoList);
0073     void createGroupByTimelapseFromInfoList(const ItemInfoList& itemInfoList);
0074 
0075 Q_SIGNALS:
0076 
0077     void editorCurrentUrlChanged(const QUrl& url);
0078     void signalImagesDeleted(const QList<qlonglong>& imageIds);
0079 
0080 protected:
0081 
0082     QWidget* m_widget;
0083 };
0084 
0085 } // namespace Digikam
0086 
0087 Q_DECLARE_METATYPE(Digikam::ItemViewUtilities::DeleteMode)
0088 
0089 #endif // DIGIKAM_ITEM_VIEW_UTILITIES_H