digiKam
itemalbummodel.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 : 2009-03-08
7  * Description : Qt item model for database entries, listing done with database job
8  *
9  * Copyright (C) 2009-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_ITEM_ALBUM_MODEL_H
26 #define DIGIKAM_ITEM_ALBUM_MODEL_H
27 
28 // Qt includes
29 
30 #include <QList>
31 
32 // Local includes
33 
34 #include "itemthumbnailmodel.h"
35 #include "album.h"
36 #include "itemlisterrecord.h"
37 
38 namespace Digikam
39 {
40 
41 class ImageChangeset;
42 class CollectionImageChangeset;
43 class SearchChangeset;
44 class Album;
45 
47 {
48  Q_OBJECT
49 
50 public:
51 
52  explicit ItemAlbumModel(QObject* const parent = nullptr);
53  ~ItemAlbumModel() override;
54 
56 
57  bool hasScheduledRefresh() const;
58  bool isRecursingAlbums() const;
59  bool isRecursingTags() const;
60  bool isListingOnlyAvailableImages() const;
61 
62 public Q_SLOTS:
63 
69  void openAlbum(const QList<Album*>& albums);
70 
74  void refresh();
75 
76  void setRecurseAlbums(bool recursiveListing);
77  void setRecurseTags(bool recursiveListing);
78  void setListOnlyAvailableImages(bool onlyAvailable);
79 
80  void setSpecialTagListing(const QString& specialListing);
81 /*
82 Q_SIGNALS:
83 
84  void listedAlbumChanged(QList<Album*> album);
85 */
86 protected Q_SLOTS:
87 
88  void scheduleRefresh();
90 
91  void slotResult();
92  void slotData(const QList<ItemListerRecord>& records);
93 
94  void slotNextRefresh();
96 
98  void slotSearchChange(const SearchChangeset& changeset);
99 
100  void slotAlbumAdded(Album* album);
101  void slotAlbumDeleted(Album* album);
102  void slotAlbumRenamed(Album* album);
103  void slotAlbumsCleared();
104 
105  void incrementalRefresh();
106 
107  void slotImageChange(const ImageChangeset& changeset) override;
108  void slotImageTagChange(const ImageTagChangeset& changeset) override;
109 
110 protected:
111 
112  void startListJob(const QList<Album*>& albums);
113 
114 private:
115 
116  // Disable
117  ItemAlbumModel(const ItemAlbumModel&) = delete;
118  ItemAlbumModel& operator=(const ItemAlbumModel&) = delete;
119 
120 private:
121 
122  class Private;
123  Private* const d;
124 };
125 
126 } // namespace Digikam
127 
128 #endif // DIGIKAM_ITEM_ALBUM_MODEL_H
Abstract base class for all album types.
Definition: album.h:67
Definition: coredbchangesets.h:152
Definition: coredbchangesets.h:48
Definition: coredbchangesets.h:80
Definition: itemalbummodel.h:47
QList< Album * > currentAlbums() const
Definition: itemalbummodel.cpp:133
void scheduleRefresh()
Definition: itemalbummodel.cpp:271
bool hasScheduledRefresh() const
Definition: itemalbummodel.cpp:266
void slotData(const QList< ItemListerRecord > &records)
Definition: itemalbummodel.cpp:472
ItemAlbumModel(QObject *const parent=nullptr)
Definition: itemalbummodel.cpp:79
void slotImageTagChange(const ImageTagChangeset &changeset) override
Definition: itemalbummodel.cpp:612
void scheduleIncrementalRefresh()
Definition: itemalbummodel.cpp:280
void slotNextIncrementalRefresh()
Definition: itemalbummodel.cpp:303
void slotCollectionImageChange(const CollectionImageChangeset &changeset)
Definition: itemalbummodel.cpp:657
void openAlbum(const QList< Album * > &albums)
Definition: itemalbummodel.cpp:189
void slotAlbumsCleared()
Definition: itemalbummodel.cpp:810
bool isRecursingAlbums() const
Definition: itemalbummodel.cpp:165
void slotAlbumRenamed(Album *album)
Definition: itemalbummodel.cpp:800
void slotNextRefresh()
Definition: itemalbummodel.cpp:288
void setRecurseTags(bool recursiveListing)
Definition: itemalbummodel.cpp:147
bool isListingOnlyAvailableImages() const
Definition: itemalbummodel.cpp:175
void slotAlbumDeleted(Album *album)
Definition: itemalbummodel.cpp:783
void slotAlbumAdded(Album *album)
Definition: itemalbummodel.cpp:779
~ItemAlbumModel() override
Definition: itemalbummodel.cpp:122
void startListJob(const QList< Album * > &albums)
Definition: itemalbummodel.cpp:315
void slotResult()
Definition: itemalbummodel.cpp:445
void slotImageChange(const ImageChangeset &changeset) override
Definition: itemalbummodel.cpp:534
void setSpecialTagListing(const QString &specialListing)
Definition: itemalbummodel.cpp:180
void setRecurseAlbums(bool recursiveListing)
Definition: itemalbummodel.cpp:138
bool isRecursingTags() const
Definition: itemalbummodel.cpp:170
void slotSearchChange(const SearchChangeset &changeset)
Definition: itemalbummodel.cpp:754
void incrementalRefresh()
Definition: itemalbummodel.cpp:243
void setListOnlyAvailableImages(bool onlyAvailable)
Definition: itemalbummodel.cpp:156
void refresh()
Definition: itemalbummodel.cpp:214
Definition: itemthumbnailmodel.h:41
Definition: coredbchangesets.h:372
@ Album
Definition: coredbfields.h:58
Definition: datefolderview.cpp:43