digiKam
gpsbookmarkmodelhelper.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 : 2009-11-21
7  * Description : Central object for managing bookmarks
8  *
9  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2009-2010 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_GPS_BOOKMARK_MODEL_HELPER_H
26 #define DIGIKAM_GPS_BOOKMARK_MODEL_HELPER_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 
32 // Local includes
33 
34 #include "geomodelhelper.h"
35 #include "gpsdatacontainer.h"
36 #include "bookmarksmngr.h"
37 #include "digikam_export.h"
38 
39 namespace Digikam
40 {
41 
42 class GPSItemModel;
43 class GPSUndoCommand;
44 
45 class DIGIKAM_EXPORT GPSBookmarkModelHelper : public GeoModelHelper
46 {
47  Q_OBJECT
48 
49 public:
50 
51  enum Constants
52  {
53  CoordinatesRole = Qt::UserRole + 1
54  };
55 
56 public:
57 
58  GPSBookmarkModelHelper(BookmarksManager* const bookmarkManager,
59  GPSItemModel* const imageModel,
60  QObject* const parent = nullptr);
61  ~GPSBookmarkModelHelper() override;
62 
63  void setVisible(const bool state);
64 
65  QAbstractItemModel* model() const override;
66  QItemSelectionModel* selectionModel() const override;
67  bool itemCoordinates(const QModelIndex& index,
68  GeoCoordinates* const coordinates) const override;
69  bool itemIcon(const QModelIndex& index, QPoint* const offset,
70  QSize* const size, QPixmap* const pixmap,
71  QUrl* const url) const override;
72  PropertyFlags modelFlags() const override;
73  PropertyFlags itemFlags(const QModelIndex& index) const override;
74  void snapItemsTo(const QModelIndex& targetIndex,
75  const QList<QModelIndex>& snappedIndices) override;
76 
77 private Q_SLOTS:
78 
79  void slotUpdateBookmarksModel();
80 
81 Q_SIGNALS:
82 
83  void signalUndoCommand(GPSUndoCommand* undoCommand);
84 
85 private:
86 
87  class Private;
88  Private* const d;
89 };
90 
91 } // namespace Digikam
92 
93 #endif // DIGIKAM_GPS_BOOKMARK_MODEL_HELPER_H
Definition: bookmarksmngr.h:214
Definition: gpsbookmarkmodelhelper.h:46
Constants
Definition: gpsbookmarkmodelhelper.h:52
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