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

KDE's Doxygen guidelines are available online.