digiKam
itemposition.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 : 2007-11-01
7  * Description : Access item position stored in database.
8  *
9  * Copyright (C) 2007-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2008 by Patrick Spendrin <ps_ml at gmx dot de>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_ITEM_POSITION_H
27 #define DIGIKAM_ITEM_POSITION_H
28 
29 // Qt includes
30 
31 #include <QString>
32 #include <QSharedDataPointer>
33 #include <QSharedData>
34 
35 // Local includes
36 
37 #include "digikam_export.h"
38 #include "coredbfields.h"
39 
40 namespace Digikam
41 {
42 
43 class CoreDbAccess;
44 class ItemPositionPriv;
45 
46 class DIGIKAM_DATABASE_EXPORT ItemPosition
47 {
48 
49 public:
50 
54  ItemPosition();
55 
60  explicit ItemPosition(qlonglong imageId);
61  ItemPosition(const CoreDbAccess& access, qlonglong imageId);
62 
63  ItemPosition(const ItemPosition& other);
64  ~ItemPosition();
65 
66  ItemPosition& operator=(const ItemPosition& other);
67 
68  bool isNull() const;
75  bool isEmpty() const;
76 
83  QString latitude() const;
84  QString longitude() const;
85 
93  double latitudeNumber() const;
94  double longitudeNumber() const;
95 
100  QString latitudeFormatted() const;
101  QString longitudeFormatted() const;
102 
110  bool latitudeUserPresentableNumbers(int* degrees, int* minutes, double* seconds, char* directionReference);
111  bool longitudeUserPresentableNumbers(int* degrees, int* minutes, double* seconds, char* directionReference);
112 
116  double altitude() const;
117 
121  QString altitudeFormatted() const;
122  double orientation() const;
123  double tilt() const;
124  double roll() const;
125  double accuracy() const;
126  QString description() const;
127 
128  bool hasCoordinates() const;
129  bool hasAltitude() const;
130  bool hasOrientation() const;
131  bool hasTilt() const;
132  bool hasRoll() const;
133  bool hasAccuracy() const;
134 
139  bool setLatitude(const QString& latitude);
140  bool setLongitude(const QString& longitude);
141 
147  bool setLatitude(double latitudeNumber);
148  bool setLongitude(double longitudeNumber);
149 
153  void setAltitude(double altitude);
154  void setOrientation(double orientation);
155  void setTilt(double tilt);
156  void setRoll(double roll);
157  void setAccuracy(double accuracy);
158  void setDescription(const QString& description);
159 
164  void apply();
165 
172  void remove();
173 
178  void removeAltitude();
179 
180 private:
181 
182  QSharedDataPointer<ItemPositionPriv> d;
183 };
184 
185 } // namespace Digikam
186 
187 #endif // DIGIKAM_ITEM_POSITION_H
Definition: coredbaccess.h:56
Definition: itemposition.h:47
Definition: datefolderview.cpp:43