File indexing completed on 2025-01-19 03:57:59

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2008-05-19
0007  * Description : Fuzzy search sidebar tab contents - private container.
0008  *
0009  * SPDX-FileCopyrightText: 2016-2018 by Mario Frank <mario dot frank at uni minus potsdam dot de>
0010  * SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  * SPDX-FileCopyrightText: 2008-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0012  * SPDX-FileCopyrightText: 2012      by Andi Clemens <andi dot clemens at gmail dot com>
0013  *
0014  * SPDX-License-Identifier: GPL-2.0-or-later
0015  *
0016  * ============================================================ */
0017 
0018 #ifndef DIGIKAM_FUZZY_SEARCH_VIEW_P_H
0019 #define DIGIKAM_FUZZY_SEARCH_VIEW_P_H
0020 
0021 #include "fuzzysearchview.h"
0022 
0023 // Qt includes
0024 
0025 #include <QFrame>
0026 #include <QImage>
0027 #include <QLabel>
0028 #include <QLayout>
0029 #include <QPushButton>
0030 #include <QSpinBox>
0031 #include <QTime>
0032 #include <QTimer>
0033 #include <QToolButton>
0034 #include <QApplication>
0035 #include <QStyle>
0036 #include <QLineEdit>
0037 #include <QIcon>
0038 #include <QMessageBox>
0039 
0040 // KDE includes
0041 
0042 #include <klocalizedstring.h>
0043 #include <kconfiggroup.h>
0044 
0045 // Local includes
0046 
0047 #include "dlayoutbox.h"
0048 #include "digikam_debug.h"
0049 #include "album.h"
0050 #include "coredb.h"
0051 #include "coredbalbuminfo.h"
0052 #include "albummanager.h"
0053 #include "albummodel.h"
0054 #include "albumselectors.h"
0055 #include "searchtreeview.h"
0056 #include "coredbaccess.h"
0057 #include "ddragobjects.h"
0058 #include "editablesearchtreeview.h"
0059 #include "findduplicatesview.h"
0060 #include "haariface.h"
0061 #include "iteminfo.h"
0062 #include "itemlister.h"
0063 #include "searchmodificationhelper.h"
0064 #include "searchtextbardb.h"
0065 #include "coredbsearchxml.h"
0066 #include "sketchwidget.h"
0067 #include "thumbnailloadthread.h"
0068 #include "thumbnailsize.h"
0069 #include "dhuesaturationselect.h"
0070 #include "dcolorvalueselector.h"
0071 #include "dexpanderbox.h"
0072 #include "applicationsettings.h"
0073 #include "drangebox.h"
0074 #include "similaritydbaccess.h"
0075 #include "similaritydb.h"
0076 #include "dnotificationwidget.h"
0077 #include "dtextedit.h"
0078 
0079 namespace Digikam
0080 {
0081 
0082 class Q_DECL_HIDDEN FuzzySearchView::Private
0083 {
0084 
0085 public:
0086 
0087     enum FuzzySearchTab
0088     {
0089         DUPLICATES = 0,
0090         SIMILARS,
0091         SKETCH
0092     };
0093 
0094 public:
0095 
0096     explicit Private()
0097       : configTabEntry                  (QLatin1String("FuzzySearch Tab")),
0098         configPenSketchSizeEntry        (QLatin1String("Pen Sketch Size")),
0099         configResultSketchItemsEntry    (QLatin1String("Result Sketch items")),
0100         configPenSketchHueEntry         (QLatin1String("Pen Sketch Hue")),
0101         configPenSketchSaturationEntry  (QLatin1String("Pen Sketch Saturation")),
0102         configPenSkethValueEntry        (QLatin1String("Pen Sketch Value")),
0103         configSimilarsThresholdEntry    (QLatin1String("Similars Threshold")),
0104         configSimilarsMaxThresholdEntry (QLatin1String("Similars Maximum Threshold")),
0105         active                          (false),                      ///< initially be active to update sketch panel when the search list is restored
0106         fingerprintsChecked             (false),
0107         resetButton                     (nullptr),
0108         saveBtnSketch                   (nullptr),
0109         undoBtnSketch                   (nullptr),
0110         redoBtnSketch                   (nullptr),
0111         saveBtnImage                    (nullptr),
0112         penSize                         (nullptr),
0113         resultsSketch                   (nullptr),
0114         similarityRange                 (nullptr),
0115         imageWidget                     (nullptr),
0116         timerSketch                     (nullptr),
0117         timerImage                      (nullptr),
0118         folderView                      (nullptr),
0119         nameEditSketch                  (nullptr),
0120         nameEditImage                   (nullptr),
0121         tabWidget                       (nullptr),
0122         hsSelector                      (nullptr),
0123         vSelector                       (nullptr),
0124         labelFile                       (nullptr),
0125         labelFolder                     (nullptr),
0126         searchFuzzyBar                  (nullptr),
0127         searchTreeView                  (nullptr),
0128         sketchWidget                    (nullptr),
0129         thumbLoadThread                 (nullptr),
0130         findDuplicatesPanel             (nullptr),
0131         imageSAlbum                     (nullptr),
0132         sketchSAlbum                    (nullptr),
0133         fuzzySearchAlbumSelectors       (nullptr),
0134         sketchSearchAlbumSelectors      (nullptr),
0135         searchModel                     (nullptr),
0136         searchModificationHelper        (nullptr),
0137         settings                        (nullptr)
0138     {
0139     }
0140 
0141     const QString             configTabEntry;
0142     const QString             configPenSketchSizeEntry;
0143     const QString             configResultSketchItemsEntry;
0144     const QString             configPenSketchHueEntry;
0145     const QString             configPenSketchSaturationEntry;
0146     const QString             configPenSkethValueEntry;
0147     const QString             configSimilarsThresholdEntry;
0148     const QString             configSimilarsMaxThresholdEntry;
0149 
0150     bool                      active;
0151     bool                      fingerprintsChecked;
0152 
0153     QColor                    selColor;
0154 
0155     QToolButton*              resetButton;
0156     QToolButton*              saveBtnSketch;
0157     QToolButton*              undoBtnSketch;
0158     QToolButton*              redoBtnSketch;
0159     QToolButton*              saveBtnImage;
0160 
0161     QSpinBox*                 penSize;
0162     QSpinBox*                 resultsSketch;
0163 
0164     DIntRangeBox*             similarityRange;
0165 
0166     QLabel*                   imageWidget;
0167 
0168     QTimer*                   timerSketch;
0169     QTimer*                   timerImage;
0170 
0171     DVBox*                    folderView;
0172 
0173     DTextEdit*                nameEditSketch;
0174     DTextEdit*                nameEditImage;
0175 
0176     QTabWidget*               tabWidget;
0177 
0178     DHueSaturationSelector*   hsSelector;
0179 
0180     DColorValueSelector*      vSelector;
0181 
0182     DAdjustableLabel*         labelFile;
0183     DAdjustableLabel*         labelFolder;
0184 
0185     ItemInfo                  imageInfo;
0186     QUrl                      imageUrl;
0187 
0188     SearchTextBarDb*          searchFuzzyBar;
0189 
0190     EditableSearchTreeView*   searchTreeView;
0191 
0192     SketchWidget*             sketchWidget;
0193 
0194     ThumbnailLoadThread*      thumbLoadThread;
0195 
0196     FindDuplicatesView*       findDuplicatesPanel;
0197 
0198     AlbumPointer<SAlbum>      imageSAlbum;
0199     AlbumPointer<SAlbum>      sketchSAlbum;
0200 
0201     AlbumSelectors*           fuzzySearchAlbumSelectors;
0202     AlbumSelectors*           sketchSearchAlbumSelectors;
0203 
0204     SearchModel*              searchModel;
0205     SearchModificationHelper* searchModificationHelper;
0206 
0207     ApplicationSettings*      settings;
0208 };
0209 
0210 } // namespace Digikam
0211 
0212 #endif // DIGIKAM_FUZZY_SEARCH_VIEW_P_H