Marble

GeoDataHotSpot.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2007 Torsten Rahn <rahn@kde.org>
4// SPDX-FileCopyrightText: 2008 Inge Wallin <inge@lysator.liu.se>
5//
6
7#ifndef MARBLE_GEODATAHOTSPOT_H
8#define MARBLE_GEODATAHOTSPOT_H
9
10#include <QPointF>
11
12#include "GeoDataObject.h"
13
14#include "geodata_export.h"
15
16namespace Marble
17{
18
19class GeoDataHotSpotPrivate;
20
21/**
22 */
23class GEODATA_EXPORT GeoDataHotSpot : public GeoDataObject
24{
25public:
26 enum Units {
27 Fraction,
28 Pixels,
29 InsetPixels
30 };
31
32 GeoDataHotSpot(const QPointF &hotSpot = QPointF(0.5, 0.5), Units xunits = Fraction, Units yunits = Fraction);
33 GeoDataHotSpot(const GeoDataHotSpot &other);
34 ~GeoDataHotSpot() override;
35
36 GeoDataHotSpot &operator=(const GeoDataHotSpot &other);
37 bool operator==(const GeoDataHotSpot &other) const;
38 bool operator!=(const GeoDataHotSpot &other) const;
39
40 /// Provides type information for downcasting a GeoData
41 const char *nodeType() const override;
42
43 /**
44 * @brief this function returns the hotspot and the units the hotspot is measured in
45 * @param xunits after running hotspot, you'll receive the unit in which x is measured
46 * @param yunits the same for y
47 * @return the point of the hotspot
48 */
49 const QPointF &hotSpot(Units &xunits, Units &yunits) const;
50
51 void setHotSpot(const QPointF &hotSpot = QPointF(0.5, 0.5), Units xunits = Fraction, Units yunits = Fraction);
52
53 /// Serialize the contents of the feature to @p stream.
54 void pack(QDataStream &stream) const override;
55 /// Unserialize the contents of the feature from @p stream.
56 void unpack(QDataStream &stream) override;
57
58private:
59 GeoDataHotSpotPrivate *const d;
60};
61
62}
63
64#endif
KIOCORE_EXPORT bool operator!=(const UDSEntry &entry, const UDSEntry &other)
bool operator==(const StyleDelim &l, const StyleDelim &r)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.