digiKam
searchmodificationhelper.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 : 2000-12-05
7  * Description : helper class used to modify search albums in views
8  *
9  * Copyright (C) 2009-2010 by Johannes Wienke <languitar at semipol dot de>
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_SEARCH_MODIFICATION_HELPER_H
26 #define DIGIKAM_SEARCH_MODIFICATION_HELPER_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 
32 // Local includes
33 
34 #include "album.h"
35 
36 namespace Digikam
37 {
38 
39 class SketchWidget;
40 class ItemInfo;
41 
45 typedef QPair<QDateTime, QDateTime> DateRange;
46 
51 
58 class SearchModificationHelper: public QObject
59 {
60  Q_OBJECT
61 
62 public:
63 
70  SearchModificationHelper(QObject* const parent, QWidget* const dialogParent);
71 
75  ~SearchModificationHelper() override;
76 
81  SAlbum* createFuzzySearchFromSketch(const QString& name,
82  SketchWidget* sketchWidget,
83  unsigned int numberOfResults,
84  const QList<int>& targetAlbums,
85  bool overwriteIfExisting = false);
86 
91  SAlbum* createFuzzySearchFromDropped(const QString& name,
92  const QString& filePath,
93  float threshold,
94  float maxThreshold,
95  const QList<int>& targetAlbums,
96  bool overwriteIfExisting = false);
97 
102  SAlbum* createFuzzySearchFromImage(const QString& name,
103  const ItemInfo& image,
104  float threshold,
105  float maxThreshold,
106  const QList<int>& targetAlbums,
107  bool overwriteIfExisting = false);
108 
109 public Q_SLOTS:
110 
116  void slotSearchDelete(SAlbum* searchAlbum);
117 
123  void slotSearchRename(SAlbum* searchAlbum);
124 
137  SAlbum* slotCreateTimeLineSearch(const QString& desiredName,
138  const DateRangeList& dateRanges,
139  bool overwriteIfExisting = false);
140 
153  void slotCreateFuzzySearchFromSketch(const QString& name,
154  SketchWidget* sketchWidget,
155  unsigned int numberOfResults,
156  const QList<int>& targetAlbums,
157  bool overwriteIfExisting = false);
158 
172  void slotCreateFuzzySearchFromImage(const QString& name,
173  const ItemInfo& image,
174  float threshold,
175  float maxThreshold,
176  const QList<int>& targetAlbums,
177  bool overwriteIfExisting = false);
178 
193  void slotCreateFuzzySearchFromDropped(const QString& name,
194  const QString& filePath,
195  float threshold,
196  float maxThreshold,
197  const QList<int>& targetAlbums,
198  bool overwriteIfExisting);
199 
200 private:
201 
202  bool checkAlbum(const QString& name) const;
203  bool checkName(QString& name);
204 
205 private:
206 
207  class Private;
208  Private* const d;
209 };
210 
211 } // namespace Digikam
212 
213 #endif // DIGIKAM_SEARCH_MODIFICATION_HELPER_H
Definition: iteminfo.h:78
Definition: album.h:493
Definition: searchmodificationhelper.h:59
void slotCreateFuzzySearchFromImage(const QString &name, const ItemInfo &image, float threshold, float maxThreshold, const QList< int > &targetAlbums, bool overwriteIfExisting=false)
Definition: searchmodificationhelper.cpp:413
void slotSearchDelete(SAlbum *searchAlbum)
Definition: searchmodificationhelper.cpp:75
~SearchModificationHelper() override
Definition: searchmodificationhelper.cpp:70
SAlbum * createFuzzySearchFromDropped(const QString &name, const QString &filePath, float threshold, float maxThreshold, const QList< int > &targetAlbums, bool overwriteIfExisting=false)
Definition: searchmodificationhelper.cpp:285
void slotCreateFuzzySearchFromDropped(const QString &name, const QString &filePath, float threshold, float maxThreshold, const QList< int > &targetAlbums, bool overwriteIfExisting)
Definition: searchmodificationhelper.cpp:332
SAlbum * createFuzzySearchFromSketch(const QString &name, SketchWidget *sketchWidget, unsigned int numberOfResults, const QList< int > &targetAlbums, bool overwriteIfExisting=false)
Definition: searchmodificationhelper.cpp:221
SAlbum * createFuzzySearchFromImage(const QString &name, const ItemInfo &image, float threshold, float maxThreshold, const QList< int > &targetAlbums, bool overwriteIfExisting=false)
Definition: searchmodificationhelper.cpp:347
SAlbum * slotCreateTimeLineSearch(const QString &desiredName, const DateRangeList &dateRanges, bool overwriteIfExisting=false)
Definition: searchmodificationhelper.cpp:173
SearchModificationHelper(QObject *const parent, QWidget *const dialogParent)
Definition: searchmodificationhelper.cpp:63
void slotCreateFuzzySearchFromSketch(const QString &name, SketchWidget *sketchWidget, unsigned int numberOfResults, const QList< int > &targetAlbums, bool overwriteIfExisting=false)
Definition: searchmodificationhelper.cpp:272
void slotSearchRename(SAlbum *searchAlbum)
Definition: searchmodificationhelper.cpp:144
Definition: sketchwidget.h:38
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43
QList< DateRange > DateRangeList
Definition: searchmodificationhelper.h:50
QPair< QDateTime, QDateTime > DateRange
Definition: searchmodificationhelper.h:40