File indexing completed on 2025-01-05 03:53:47
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2004-11-17 0007 * Description : Albums history manager. 0008 * 0009 * SPDX-FileCopyrightText: 2004 by Joern Ahrens <joern dot ahrens at kdemail dot net> 0010 * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0011 * SPDX-FileCopyrightText: 2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com> 0012 * 0013 * SPDX-License-Identifier: GPL-2.0-or-later 0014 * 0015 * ============================================================ */ 0016 0017 #ifndef DIGIKAM_ALBUM_HISTORY_H 0018 #define DIGIKAM_ALBUM_HISTORY_H 0019 0020 // Qt includes 0021 0022 #include <QList> 0023 #include <QObject> 0024 #include <QStringList> 0025 0026 // Local includes 0027 0028 #include "labelstreeview.h" 0029 #include "iteminfo.h" 0030 0031 namespace Digikam 0032 { 0033 0034 class Album; 0035 class HistoryItem; 0036 class HistoryPosition; 0037 0038 /** 0039 * Manages the history of the last visited albums. 0040 * 0041 * The user is able to navigate through the albums, he has 0042 * opened during a session. 0043 */ 0044 class AlbumHistory : public QObject 0045 { 0046 Q_OBJECT 0047 0048 public: 0049 0050 explicit AlbumHistory(QObject* const parent = nullptr); 0051 ~AlbumHistory() override; 0052 0053 void addAlbums(const QList<Album*>& albums, 0054 QWidget* const widget = nullptr); 0055 0056 void addAlbums(const QList<Album*>& albums, 0057 QWidget* const widget, 0058 const QHash<LabelsTreeView::Labels, QList<int> >& selectedLabels); 0059 0060 void deleteAlbum(Album* const album); 0061 void clearHistory(); 0062 0063 void back(QList<Album*>& album, 0064 QWidget** const widget, 0065 unsigned int steps = 1); 0066 0067 void forward(QList<Album*>& album, 0068 QWidget** const widget, 0069 unsigned int steps = 1); 0070 0071 void getCurrentAlbum(Album** const album, 0072 QWidget** const widget) const; 0073 0074 void getBackwardHistory(QStringList& list) const; 0075 void getForwardHistory(QStringList& list) const; 0076 0077 bool isForwardEmpty() const; 0078 bool isBackwardEmpty() const; 0079 0080 QHash<LabelsTreeView::Labels, QList<int> > neededLabels(); 0081 0082 Q_SIGNALS: 0083 0084 void signalSetCurrent(qlonglong imageId); 0085 void signalSetSelectedInfos(const QList<ItemInfo>&); 0086 0087 public Q_SLOTS: 0088 0089 void slotAlbumCurrentChanged(); 0090 void slotAlbumDeleted(Album* album); 0091 void slotAlbumsCleared(); 0092 void slotAlbumSelected(); 0093 void slotClearSelectPAlbum(const ItemInfo& imageInfo); 0094 void slotClearSelectTAlbum(int id); 0095 void slotCurrentChange(const ItemInfo& info); 0096 void slotImageSelected(const ItemInfoList& selectedImage); 0097 0098 private: 0099 0100 class Private; 0101 Private* const d; 0102 }; 0103 0104 } // namespace Digikam 0105 0106 #endif // DIGIKAM_ALBUM_HISTORY_H