Debian Codegraph @

core/libs/album/engine/albumhistory.h

raw
1 /* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2004-11-17
7 * Description : Albums history manager.
8 *
9 * SPDX-FileCopyrightText: 2004 by Joern Ahrens <joern dot ahrens at kdemail dot net>
10 * SPDX-FileCopyrightText: 2006-2026 by Gilles Caulier <caulier dot gilles at gmail dot com>
11 * SPDX-FileCopyrightText: 2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
12 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
14 *
15 * ============================================================ */
16
17 #pragma once
18
19 // Qt includes
20
21 #include <QList>
22 #include <QObject>
23 #include <QStringList>
24
25 // Local includes
26
27 #include "labelstreeview.h"
28 #include "iteminfo.h"
29
30 namespace Digikam
31 {
32
33 class Album;
34 class HistoryItem;
35 class HistoryPosition;
36
37 /**
38 * Manages the history of the last visited albums.
39 *
40 * The user is able to navigate through the albums, he has
41 * opened during a session.
42 */
43 class AlbumHistory : public QObject
44 {
45 Q_OBJECT
46
47 public:
48
49 explicit AlbumHistory(QObject* const parent = nullptr);
50 ~AlbumHistory() override;
51
52 void addAlbums(const QList<Album*>& albums,
53 QWidget* const widget = nullptr);
54
55 void addAlbums(const QList<Album*>& albums,
56 QWidget* const widget,
57 const QHash<LabelsTreeView::Labels, QList<int> >& selectedLabels);
58
59 void deleteAlbum(Album* const album);
60 void clearHistory();
61
62 void back(QList<Album*>& album,
63 QWidget** const widget,
64 unsigned int steps = 1);
65
66 void forward(QList<Album*>& album,
67 QWidget** const widget,
68 unsigned int steps = 1);
69
70 void getCurrentAlbum(Album** const album,
71 QWidget** const widget) const;
72
73 void getBackwardHistory(QStringList& list) const;
74 void getForwardHistory(QStringList& list) const;
75
76 bool isForwardEmpty() const;
77 bool isBackwardEmpty() const;
78
79 QHash<LabelsTreeView::Labels, QList<int> > neededLabels();
80
81 Q_SIGNALS:
82
83 void signalSetCurrent(qlonglong imageId);
84 void signalSetSelectedInfos(const QList<ItemInfo>&);
85
86 public Q_SLOTS:
87
88 void slotAlbumCurrentChanged();
89 void slotAlbumDeleted(Album* album);
90 void slotAlbumsCleared();
91 void slotAlbumSelected();
92 void slotClearSelectPAlbum(const ItemInfo& imageInfo);
93 void slotClearSelectTAlbum(int id);
94 void slotCurrentChange(const ItemInfo& info);
95 void slotImageSelected(const ItemInfoList& selectedImage);
96
97 private:
98
99 class Private;
100 Private* const d = nullptr;
101 };
102
103 } // namespace Digikam