digiKam
albumhistory.h
Go to the documentation of this file.
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  * Copyright (C) 2004 by Joern Ahrens <joern dot ahrens at kdemail dot net>
10  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_ALBUM_HISTORY_H
27 #define DIGIKAM_ALBUM_HISTORY_H
28 
29 // Qt includes
30 
31 #include <QList>
32 #include <QObject>
33 #include <QStringList>
34 
35 // Local includes
36 
37 #include "labelstreeview.h"
38 #include "iteminfo.h"
39 
40 namespace Digikam
41 {
42 
43 class Album;
44 class HistoryItem;
45 class HistoryPosition;
46 
53 class AlbumHistory : public QObject
54 {
55  Q_OBJECT
56 
57 public:
58 
59  explicit AlbumHistory(QObject* const parent = nullptr);
60  ~AlbumHistory() override;
61 
62  void addAlbums(const QList<Album*>& albums,
63  QWidget* const widget = nullptr);
64 
65  void addAlbums(const QList<Album*>& albums,
66  QWidget* const widget,
67  const QHash<LabelsTreeView::Labels, QList<int> >& selectedLabels);
68 
69  void deleteAlbum(Album* const album);
70  void clearHistory();
71 
72  void back(QList<Album*>& album,
73  QWidget** const widget,
74  unsigned int steps = 1);
75 
76  void forward(QList<Album*>& album,
77  QWidget** const widget,
78  unsigned int steps = 1);
79 
80  void getCurrentAlbum(Album** const album,
81  QWidget** const widget) const;
82 
83  void getBackwardHistory(QStringList& list) const;
84  void getForwardHistory(QStringList& list) const;
85 
86  bool isForwardEmpty() const;
87  bool isBackwardEmpty() const;
88 
89  QHash<LabelsTreeView::Labels, QList<int> > neededLabels();
90 
91 Q_SIGNALS:
92 
93  void signalSetCurrent(qlonglong imageId);
95 
96 public Q_SLOTS:
97 
99  void slotAlbumDeleted(Album* album);
100  void slotAlbumsCleared();
101  void slotAlbumSelected();
102  void slotClearSelectPAlbum(const ItemInfo& imageInfo);
103  void slotClearSelectTAlbum(int id);
104  void slotCurrentChange(const ItemInfo& info);
105  void slotImageSelected(const ItemInfoList& selectedImage);
106 
107 private:
108 
109  class Private;
110  Private* const d;
111 };
112 
113 } // namespace Digikam
114 
115 #endif // DIGIKAM_ALBUM_HISTORY_H
Definition: albumhistory.h:54
void slotCurrentChange(const ItemInfo &info)
Definition: albumhistory.cpp:533
void signalSetSelectedInfos(const QList< ItemInfo > &)
bool isBackwardEmpty() const
Definition: albumhistory.cpp:494
bool isForwardEmpty() const
Definition: albumhistory.cpp:489
void addAlbums(const QList< Album * > &albums, QWidget *const widget=nullptr)
Definition: albumhistory.cpp:198
AlbumHistory(QObject *const parent=nullptr)
Definition: albumhistory.cpp:177
void getBackwardHistory(QStringList &list) const
Definition: albumhistory.cpp:361
void slotAlbumsCleared()
Definition: albumhistory.cpp:596
void getForwardHistory(QStringList &list) const
Definition: albumhistory.cpp:393
void clearHistory()
Definition: albumhistory.cpp:189
void slotAlbumCurrentChanged()
Definition: albumhistory.cpp:518
void slotAlbumSelected()
Definition: albumhistory.cpp:507
void back(QList< Album * > &album, QWidget **const widget, unsigned int steps=1)
Definition: albumhistory.cpp:423
void getCurrentAlbum(Album **const album, QWidget **const widget) const
Definition: albumhistory.cpp:471
~AlbumHistory() override
Definition: albumhistory.cpp:183
void deleteAlbum(Album *const album)
Definition: albumhistory.cpp:256
QHash< LabelsTreeView::Labels, QList< int > > neededLabels()
Definition: albumhistory.cpp:502
void slotClearSelectTAlbum(int id)
Definition: albumhistory.cpp:572
void slotClearSelectPAlbum(const ItemInfo &imageInfo)
Definition: albumhistory.cpp:560
void slotImageSelected(const ItemInfoList &selectedImage)
Definition: albumhistory.cpp:545
void slotAlbumDeleted(Album *album)
Definition: albumhistory.cpp:584
void forward(QList< Album * > &album, QWidget **const widget, unsigned int steps=1)
Definition: albumhistory.cpp:450
void signalSetCurrent(qlonglong imageId)
Abstract base class for all album types.
Definition: album.h:67
Definition: iteminfolist.h:47
Definition: iteminfo.h:78
Labels
Definition: labelstreeview.h:49
@ Album
Definition: coredbfields.h:58
Definition: datefolderview.cpp:43