Marble

kineticmodel.h
1/*
2 This file is part of the Ofi Labs X2 project.
3
4 SPDX-FileCopyrightText: 2010 Ariya Hidayat <ariya.hidayat@gmail.com>
5 SPDX-License-Identifier: BSD-3-Clause
6*/
7
8#ifndef OFILABS_KINETICMODEL
9#define OFILABS_KINETICMODEL
10
11#include <QObject>
12#include <QPointF>
13#include <QScopedPointer>
14
15class KineticModelPrivate;
16
17class KineticModel : public QObject
18{
20 Q_PROPERTY(int duration READ duration WRITE setDuration)
21 Q_PROPERTY(QPointF position READ position NOTIFY positionChanged)
22 Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval)
23
24public:
25 explicit KineticModel(QObject *parent = nullptr);
26 ~KineticModel() override;
27
28 int duration() const;
29 QPointF position() const;
30 int updateInterval() const;
31 bool hasVelocity() const;
32
33public Q_SLOTS:
34 void setDuration(int ms);
35 void setPosition(const QPointF &position);
36 void setPosition(qreal posX, qreal posY);
37 void setHeading(qreal heading);
38 void jumpToPosition(const QPointF &position);
39 void jumpToPosition(qreal posX, qreal posY);
40 void setUpdateInterval(int ms);
41 void stop();
42 void start();
43
45 void positionChanged(qreal lon, qreal lat);
46 void headingChanged(qreal heading);
47 void finished();
48
49private Q_SLOTS:
50 void update();
51
52private:
54 Q_DECLARE_PRIVATE(KineticModel)
55 Q_DISABLE_COPY(KineticModel);
56};
57
58#endif
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.