digiKam
searchwidget.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_WIDGET_H
26 #define DIGIKAM_SEARCH_WIDGET_H
27 
28 // Qt includes
29 
30 #include <QAbstractItemModel>
31 #include <QWidget>
32 
33 // Local includes
34 
35 #include "digikam_config.h"
36 #include "geomodelhelper.h"
37 #include "mapwidget.h"
38 #include "searchbackend.h"
39 #include "gpsundocommand.h"
40 #include "gpsbookmarkowner.h"
41 
42 class QEvent;
43 
44 class KConfigGroup;
45 
46 using namespace Digikam;
47 
49 {
50 
51 class SearchWidget : public QWidget
52 {
53  Q_OBJECT
54 
55 public:
56 
57  explicit SearchWidget(GPSBookmarkOwner* const gpsBookmarkOwner,
58  GPSItemModel* const gpsItemModel,
59  QItemSelectionModel* const gpsImageSelectionModel,
60  QWidget* const parent);
61  ~SearchWidget() override;
62 
63  GeoModelHelper* getModelHelper() const;
64 
65  void saveSettingsToGroup(KConfigGroup* const group);
66  void readSettingsFromGroup(const KConfigGroup* const group);
67  void setPrimaryMapWidget(MapWidget* const mapWidget);
68 
69 private Q_SLOTS:
70 
71  void slotSearchCompleted();
72  void slotTriggerSearch();
73  void slotCurrentlySelectedResultChanged(const QModelIndex& current,
74  const QModelIndex& previous);
75  void slotClearSearchResults();
76  void slotVisibilityChanged(bool state);
77  void slotCopyCoordinates();
78  void slotMoveSelectedImagesToThisResult();
79  void slotUpdateActionAvailability();
80  void slotRemoveSelectedFromResultsList();
81 
82 protected:
83 
84  bool eventFilter(QObject* watched, QEvent* event) override;
85 
86 Q_SIGNALS:
87 
88  void signalUndoCommand(GPSUndoCommand* undoCommand);
89 
90 private:
91 
92  class Private;
93  Private* const d;
94 };
95 
96 } // namespace DigikamGenericGeolocationEditPlugin
97 
98 #endif // DIGIKAM_SEARCH_WIDGET_H
void signalUndoCommand(GPSUndoCommand *undoCommand)
Definition: gpsbookmarkowner.h:46
Definition: gpsitemmodel.h:43
Definition: gpsundocommand.h:41
Helper class to access data in models.
Definition: geomodelhelper.h:47
The central map view class of geolocation interface.
Definition: mapwidget.h:58
Definition: geolocationedit.cpp:97
Definition: datefolderview.cpp:43