File indexing completed on 2025-01-19 03:51:19

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2010-06-01
0007  * Description : A widget to search for places.
0008  *
0009  * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2010-2011 by Michael G. Hansen <mike at mghansen dot de>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_SEARCH_RESULT_MODEL_HELPER_H
0017 #define DIGIKAM_SEARCH_RESULT_MODEL_HELPER_H
0018 
0019 // Qt includes
0020 
0021 #include <QAbstractItemModel>
0022 
0023 // Local includes
0024 
0025 #include "searchresultmodel.h"
0026 #include "geomodelhelper.h"
0027 #include "searchresultbackend.h"
0028 #include "gpsundocommand.h"
0029 #include "gpsitemmodel.h"
0030 
0031 using namespace Digikam;
0032 
0033 namespace DigikamGenericGeolocationEditPlugin
0034 {
0035 
0036 class SearchResultModelHelper : public GeoModelHelper
0037 {
0038     Q_OBJECT
0039 
0040 public:
0041 
0042     explicit SearchResultModelHelper(SearchResultModel* const resultModel,
0043                                      QItemSelectionModel* const selectionModel,
0044                                      GPSItemModel* const imageModel,
0045                                      QObject* const parent = nullptr);
0046     ~SearchResultModelHelper()                                                                                                     override;
0047 
0048     void setVisibility(const bool state);
0049 
0050     QAbstractItemModel* model()                                                                                              const override;
0051     QItemSelectionModel* selectionModel()                                                                                    const override;
0052     bool itemCoordinates(const QModelIndex& index, GeoCoordinates* const coordinates)                                        const override;
0053     bool itemIcon(const QModelIndex& index, QPoint* const offset, QSize* const size, QPixmap* const pixmap, QUrl* const url) const override;
0054     PropertyFlags modelFlags()                                                                                               const override;
0055     PropertyFlags itemFlags(const QModelIndex& index)                                                                        const override;
0056     void snapItemsTo(const QModelIndex& targetIndex, const QList<QModelIndex>& snappedIndices)                                     override;
0057 
0058 Q_SIGNALS:
0059 
0060     void signalUndoCommand(GPSUndoCommand* undoCommand);
0061 
0062 private:
0063 
0064     class Private;
0065     Private* const d;
0066 };
0067 
0068 } // namespace DigikamGenericGeolocationEditPlugin
0069 
0070 #endif // DIGIKAM_SEARCH_RESULT_MODEL_HELPER_H