digiKam
lookupaltitude.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-04-30
7  * Description : Base class for altitude lookup jobs
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_LOOKUP_ALTITUDE_H
26 #define DIGIKAM_LOOKUP_ALTITUDE_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 
32 // local includes
33 
34 #include "digikam_export.h"
35 #include "geocoordinates.h"
36 
37 namespace Digikam
38 {
39 
40 class DIGIKAM_EXPORT LookupAltitude : public QObject
41 {
42  Q_OBJECT
43 
44 public:
45 
47  {
48  StatusInProgress = 0,
49  StatusSuccess = 1,
50  StatusCanceled = 2,
51  StatusError = 3
52  };
53  Q_DECLARE_FLAGS(StatusAltitude, StatusEnum)
54 
55 public:
56 
57  class Request
58  {
59  public:
60 
61  explicit Request()
62  : coordinates(),
63  success (false),
64  data ()
65  {
66  }
67 
68  public:
69 
71  bool success;
72  QVariant data;
73 
75  };
76 
77 public:
78 
79  explicit LookupAltitude(QObject* const parent);
80  ~LookupAltitude() override;
81 
82  virtual QString backendName() const = 0;
83  virtual QString backendHumanName() const = 0;
84 
85  virtual void addRequests(const Request::List& requests) = 0;
86  virtual Request::List getRequests() const = 0;
87  virtual Request getRequest(const int index) const = 0;
88 
89  virtual void startLookup() = 0;
90  virtual StatusAltitude getStatus() const = 0;
91  virtual QString errorMessage() const = 0;
92  virtual void cancel() = 0;
93 
94 Q_SIGNALS:
95 
96  void signalRequestsReady(const QList<int>& readyRequests);
97  void signalDone();
98 };
99 
100 } // namespace Digikam
101 
102 Q_DECLARE_OPERATORS_FOR_FLAGS(Digikam::LookupAltitude::StatusAltitude)
103 
104 #endif // DIGIKAM_LOOKUP_ALTITUDE_H
Definition: geocoordinates.h:49
Definition: lookupaltitude.h:58
Request()
Definition: lookupaltitude.h:61
QList< Request > List
Definition: lookupaltitude.h:74
GeoCoordinates coordinates
Definition: lookupaltitude.h:70
QVariant data
Definition: lookupaltitude.h:72
bool success
Definition: lookupaltitude.h:71
Definition: lookupaltitude.h:41
virtual StatusAltitude getStatus() const =0
virtual void cancel()=0
virtual Request::List getRequests() const =0
void signalRequestsReady(const QList< int > &readyRequests)
virtual QString errorMessage() const =0
virtual void addRequests(const Request::List &requests)=0
virtual QString backendName() const =0
virtual void startLookup()=0
virtual QString backendHumanName() const =0
virtual Request getRequest(const int index) const =0
StatusEnum
Definition: lookupaltitude.h:47
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43