File indexing completed on 2025-01-19 03:58:12

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2008-05-30
0007  * Description : GPS search sidebar tab contents.
0008  *
0009  * SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText:      2009 by Johannes Wienke <languitar at semipol dot de>
0011  * SPDX-FileCopyrightText: 2010-2011 by Michael G. Hansen <mike at mghansen dot de>
0012  * SPDX-FileCopyrightText:      2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
0013  *
0014  * SPDX-License-Identifier: GPL-2.0-or-later
0015  *
0016  * ============================================================ */
0017 
0018 #ifndef DIGIKAM_GPS_SEARCH_VIEW_H
0019 #define DIGIKAM_GPS_SEARCH_VIEW_H
0020 
0021 // Qt includes
0022 
0023 #include <QWidget>
0024 
0025 // Local includes
0026 
0027 #include "geomodelhelper.h"
0028 #include "mapwidget.h"
0029 #include "statesavingobject.h"
0030 #include "itemfiltermodel.h"
0031 
0032 namespace Digikam
0033 {
0034 
0035 class Album;
0036 class SAlbum;
0037 class SearchModel;
0038 class SearchModificationHelper;
0039 
0040 class GPSSearchView : public QWidget, public StateSavingObject
0041 {
0042     Q_OBJECT
0043 
0044 public:
0045 
0046     explicit GPSSearchView(QWidget* const parent,
0047                   SearchModel* const searchModel,
0048                   SearchModificationHelper* const searchModificationHelper,
0049                   ItemFilterModel* const imageFilterModel,
0050                   QItemSelectionModel* const itemSelectionModel);
0051     ~GPSSearchView()                                override;
0052 
0053     void setActive(bool state);
0054 
0055     void changeAlbumFromHistory(SAlbum* const album);
0056 
0057     void doLoadState()                              override;
0058     void doSaveState()                              override;
0059 
0060     void setConfigGroup(const KConfigGroup& group)  override;
0061 
0062 public Q_SLOTS:
0063 
0064     void slotRefreshMap();
0065     void slotClearImages();
0066 
0067 private:
0068 
0069     bool checkName(QString& name);
0070     bool checkAlbum(const QString& name) const;
0071 
0072     void createNewGPSSearchAlbum(const QString& name);
0073 
0074 private Q_SLOTS:
0075 
0076     void slotAlbumSelected(Album*);
0077 
0078     void slotSaveGPSSAlbum();
0079     void slotCheckNameEditGPSConditions();
0080 
0081     void slotRegionSelectionChanged();
0082     void slotRemoveCurrentFilter();
0083     void slotMapSoloItems(const QList<qlonglong>& idList);
0084 
0085     void showNonGeolocatedItems();
0086 
0087 Q_SIGNALS:
0088 
0089     void signalMapSoloItems(const QList<qlonglong>& idList, const QString& id);
0090 
0091 private:
0092 
0093     class Private;
0094     Private* const d;
0095 };
0096 
0097 } // namespace Digikam
0098 
0099 #endif // DIGIKAM_GPS_SEARCH_VIEW_H