digiKam
albumlabelssearchhandler.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 : 2014-05-17
7  * Description : Album Labels Search Tree View.
8  *
9  * Copyright (C) 2014-2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
10  * Copyright (C) 2014-2022 by Gilles Caulier <caulier dot gilles at gmail 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_ALBUM_LABELS_SEARCH_HANDLER_H
26 #define DIGIKAM_ALBUM_LABELS_SEARCH_HANDLER_H
27 
28 #include "labelstreeview.h"
29 
30 namespace Digikam
31 {
32 
33 class AlbumLabelsSearchHandler : public QObject
34 {
35  Q_OBJECT
36 
37 public:
38 
39  explicit AlbumLabelsSearchHandler(LabelsTreeView* const treeWidget);
40  ~AlbumLabelsSearchHandler() override;
41 
46 
52  QList<QUrl> imagesUrls() const;
53 
58  QString generatedName() const;
59 
66  QList<int> >& neededLabels);
67 
74 
75 private:
76 
83  QString createXMLForCurrentSelection(const QHash<LabelsTreeView::Labels, QList<int> >& selectedLabels);
84 
92  SAlbum* search(const QString& xml) const;
93 
100  void generateAlbumNameForExporting(const QList<int>& ratings,
101  const QList<int>& colorsList,
102  const QList<int>& picksList);
103 
108  void imagesUrlsForCurrentAlbum();
109 
114  QString getDefaultTitle() const;
115 
116 private Q_SLOTS:
117 
118  void slotSelectionChanged();
119  void slotCheckStateChanged();
120  void slotSetCurrentAlbum();
121  void slotResult();
122  void slotData(const QList<ItemListerRecord>& data);
123 
124 Q_SIGNALS:
125 
126  void checkStateChanged(Album* album, Qt::CheckState checkState);
127 
128 private:
129 
130  class Private;
131  Private* const d;
132 };
133 
134 } // namespace Digikam
135 
136 #endif // DIGIKAM_ALBUM_LABELS_SEARCH_HANDLER_H
Definition: albumlabelssearchhandler.h:34
QList< QUrl > imagesUrls() const
Gets the list of images generated, for exporting.
Definition: albumlabelssearchhandler.cpp:117
QString generatedName() const
Definition: albumlabelssearchhandler.cpp:122
AlbumLabelsSearchHandler(LabelsTreeView *const treeWidget)
Definition: albumlabelssearchhandler.cpp:87
bool isRestoringSelectionFromHistory() const
Definition: albumlabelssearchhandler.cpp:135
void restoreSelectionFromHistory(const QHash< LabelsTreeView::Labels, QList< int > > &neededLabels)
Restores the selection of the tree-view from history.
Definition: albumlabelssearchhandler.cpp:127
~AlbumLabelsSearchHandler() override
Definition: albumlabelssearchhandler.cpp:107
void checkStateChanged(Album *album, Qt::CheckState checkState)
Album * albumForSelectedItems() const
Definition: albumlabelssearchhandler.cpp:112
Abstract base class for all album types.
Definition: album.h:67
Definition: labelstreeview.h:43
Labels
Definition: labelstreeview.h:49
Definition: album.h:493
Definition: datefolderview.cpp:43