digiKam
gpsiteminfosorter.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 : 2011-01-06
7  * Description : Helper class for geomap interaction
8  *
9  * Copyright (C) 2011 by Michael G. Hansen <mike at mghansen dot de>
10  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
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_ITEM_INFO_SORTER_H
26 #define DIGIKAM_GPS_ITEM_INFO_SORTER_H
27 
28 // Qt includes
29 
30 #include <QDateTime>
31 #include <QObject>
32 #include <QSize>
33 #include <QUrl>
34 
35 // Local includes
36 
37 #include "digikam_export.h"
38 #include "geocoordinates.h"
39 #include "geogroupstate.h"
40 #include "gpsiteminfo.h"
41 #include "mapwidget.h"
42 
43 namespace Digikam
44 {
45 
46 class DIGIKAM_EXPORT GPSItemInfoSorter : public QObject
47 {
48  Q_OBJECT
49 
50 public:
51 
53  {
54  SortYoungestFirst = 0,
55  SortOldestFirst = 1,
56  SortRating = 2
57  };
58  Q_DECLARE_FLAGS(SortOptions, SortOption)
59 
60 public:
61 
62  explicit GPSItemInfoSorter(QObject* const parent);
63  ~GPSItemInfoSorter() override;
64 
65  void addToMapWidget(MapWidget* const mapWidget);
66 
67  void setSortOptions(const SortOptions sortOptions);
68  SortOptions getSortOptions() const;
69 
70 public:
71 
72  static bool fitsBetter(const GPSItemInfo& oldInfo,
73  const GeoGroupState oldState,
74  const GPSItemInfo& newInfo,
75  const GeoGroupState newState,
76  const GeoGroupState globalGroupState,
77  const SortOptions sortOptions);
78 
79 private Q_SLOTS:
80 
81  void slotSortOptionTriggered();
82 
83 private:
84 
85  void initializeSortMenu();
86 
87 private:
88 
89  // Disable
90  GPSItemInfoSorter() = delete;
91 
92 private:
93 
94  class Private;
95  Private* const d;
96 };
97 
98 } // namespace Digikam
99 
100 Q_DECLARE_OPERATORS_FOR_FLAGS(Digikam::GPSItemInfoSorter::SortOptions)
101 
102 #endif // DIGIKAM_GPS_ITEM_INFO_SORTER_H
Definition: gpsiteminfosorter.h:47
SortOption
Definition: gpsiteminfosorter.h:53
Definition: gpsiteminfo.h:43
The central map view class of geolocation interface.
Definition: mapwidget.h:58
Definition: datefolderview.cpp:43