digiKam
searchresultmodelhelper.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 : 2010-06-01
7  * Description : A widget to search for places.
8  *
9  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2010-2011 by Michael G. Hansen <mike at mghansen dot de>
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_RESULT_MODEL_HELPER_H
26 #define DIGIKAM_SEARCH_RESULT_MODEL_HELPER_H
27 
28 // Qt includes
29 
30 #include <QAbstractItemModel>
31 
32 // Local includes
33 
34 #include "searchresultmodel.h"
35 #include "geomodelhelper.h"
36 #include "searchbackend.h"
37 #include "gpsundocommand.h"
38 #include "gpsitemmodel.h"
39 
40 using namespace Digikam;
41 
43 {
44 
46 {
47  Q_OBJECT
48 
49 public:
50 
51  explicit SearchResultModelHelper(SearchResultModel* const resultModel,
52  QItemSelectionModel* const selectionModel,
53  GPSItemModel* const imageModel,
54  QObject* const parent = nullptr);
55  ~SearchResultModelHelper() override;
56 
57  void setVisibility(const bool state);
58 
59  QAbstractItemModel* model() const override;
60  QItemSelectionModel* selectionModel() const override;
61  bool itemCoordinates(const QModelIndex& index, GeoCoordinates* const coordinates) const override;
62  bool itemIcon(const QModelIndex& index, QPoint* const offset, QSize* const size, QPixmap* const pixmap, QUrl* const url) const override;
63  PropertyFlags modelFlags() const override;
64  PropertyFlags itemFlags(const QModelIndex& index) const override;
65  void snapItemsTo(const QModelIndex& targetIndex, const QList<QModelIndex>& snappedIndices) override;
66 
67 Q_SIGNALS:
68 
69  void signalUndoCommand(GPSUndoCommand* undoCommand);
70 
71 private:
72 
73  class Private;
74  Private* const d;
75 };
76 
77 } // namespace DigikamGenericGeolocationEditPlugin
78 
79 #endif // DIGIKAM_SEARCH_RESULT_MODEL_HELPER_H
Definition: searchresultmodelhelper.h:46
Definition: gpsitemmodel.h:43
Definition: gpsundocommand.h:41
Definition: geocoordinates.h:49
Helper class to access data in models.
Definition: geomodelhelper.h:47
Definition: geolocationedit.cpp:97
Definition: datefolderview.cpp:43