digiKam
gpsgeoifacemodelhelper.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 : 2006-05-16
7  * Description : A tool to edit geolocation
8  *
9  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2010-2014 by Michael G. Hansen <mike at mghansen dot de>
11  * Copyright (C) 2010 by Gabriel Voicu <ping dot gabi at gmail dot com>
12  * Copyright (C) 2014 by Justus Schwartz <justus at gmx dot li>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option)
18  * any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * ============================================================ */
26 
27 #ifndef DIGIKAM_GPS_GEOIFACE_MODEL_HELPER_H
28 #define DIGIKAM_GPS_GEOIFACE_MODEL_HELPER_H
29 
30 // Qt includes
31 
32 #include <QModelIndex>
33 
34 // Local includes
35 
36 #include "geomodelhelper.h"
37 #include "digikam_export.h"
38 
39 namespace Digikam
40 {
41 
42 class GPSItemModel;
43 class GPSUndoCommand;
44 class MapWidget;
45 
46 class DIGIKAM_EXPORT GPSGeoIfaceModelHelper : public GeoModelHelper
47 {
48  Q_OBJECT
49 
50 public:
51 
52  explicit GPSGeoIfaceModelHelper(GPSItemModel* const model,
53  QItemSelectionModel* const selectionModel,
54  QObject* const parent = nullptr);
55  ~GPSGeoIfaceModelHelper() override;
56 
57  QAbstractItemModel* model() const override;
58  QItemSelectionModel* selectionModel() const override;
59 
60  bool itemCoordinates(const QModelIndex& index,
61  GeoCoordinates* const coordinates) const override;
62 
63  PropertyFlags modelFlags() const override;
64 
65  QPixmap pixmapFromRepresentativeIndex(const QPersistentModelIndex& index,
66  const QSize& size) override;
67 
68  QPersistentModelIndex bestRepresentativeIndexFromList(const QList<QPersistentModelIndex>& list,
69  const int sortKey) override;
70 
71  void onIndicesMoved(const QList<QPersistentModelIndex>& movedMarkers,
72  const GeoCoordinates& targetCoordinates,
73  const QPersistentModelIndex& targetSnapIndex) override;
74 
75  void addUngroupedModelHelper(GeoModelHelper* const newModelHelper);
76 
77 private Q_SLOTS:
78 
79  void slotThumbnailFromModel(const QPersistentModelIndex& index,
80  const QPixmap& pixmap);
81 
82 Q_SIGNALS:
83 
84  void signalUndoCommand(GPSUndoCommand* undoCommand);
85 
86 private:
87 
88  class Private;
89  Private* const d;
90 };
91 
92 } // namespace Digikam
93 
94 #endif // DIGIKAM_GPS_GEOIFACE_MODEL_HELPER_H
Definition: gpsgeoifacemodelhelper.h:47
void signalUndoCommand(GPSUndoCommand *undoCommand)
Definition: gpsitemmodel.h:43
Definition: gpsundocommand.h:41
Definition: geocoordinates.h:49
Helper class to access data in models.
Definition: geomodelhelper.h:47
Definition: datefolderview.cpp:43