Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qgeosatelliteinfosource_gypsy_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QGEOSATELLITEINFOSOURCE_GYPSY_H
5#define QGEOSATELLITEINFOSOURCE_GYPSY_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
19#include "qgeosatelliteinfo.h"
20#include <gypsy/gypsy-satellite.h>
21#include <gypsy/gypsy-control.h>
22#include <gypsy/gypsy-device.h>
23#include <gconf/gconf-client.h>
24#include <QTimer>
25
26// #define Q_LOCATION_GYPSY_DEBUG
27
29
30// An engine that encapsulates all symbols we want
31// to be able to mock (for unit/autotest purposes).
33{
34public:
36 virtual ~SatelliteGypsyEngine();
37 // Glib symbols
38 virtual gulong eng_g_signal_connect(gpointer instance,
39 const gchar *detailed_signal,
40 GCallback c_handler,
41 gpointer data);
42 virtual guint eng_g_signal_handlers_disconnect_by_func(gpointer instance,
43 gpointer func,
44 gpointer data);
45 virtual void eng_g_free(gpointer mem);
46 // Gypsy symbols
47 virtual GypsyControl *eng_gypsy_control_get_default (void);
48 virtual char *eng_gypsy_control_create (GypsyControl *control, const char *device_name, GError **error);
49 virtual GypsyDevice *eng_gypsy_device_new (const char *object_path);
50 virtual GypsySatellite *eng_gypsy_satellite_new (const char *object_path);
51 virtual gboolean eng_gypsy_device_start (GypsyDevice *device, GError **error);
52 virtual gboolean eng_gypsy_device_stop (GypsyDevice *device, GError **error);
53 virtual GypsyDeviceFixStatus eng_gypsy_device_get_fix_status (GypsyDevice *device, GError **error);
54 virtual GPtrArray *eng_gypsy_satellite_get_satellites (GypsySatellite *satellite, GError **error);
55 virtual void eng_gypsy_satellite_free_satellite_array (GPtrArray *satellites);
56 // GConf symbols (mockability due to X11 requirement)
57 virtual GConfClient *eng_gconf_client_get_default(void);
58 virtual gchar *eng_gconf_client_get_string(GConfClient *client, const gchar *key, GError** err);
59protected:
61};
62
64 {
66
67public:
70 int init(const QVariantMap parameters);
71
72 int minimumUpdateInterval() const override;
73 Error error() const override;
74
75public slots:
76 virtual void startUpdates() override;
77 void stopUpdates() override;
78 void requestUpdate(int timeout = 5000) override;
79 void satellitesChanged(GypsySatellite *satellite, GPtrArray *satellites);
80
81private slots:
82 void requestUpdateTimeout();
83
84private:
86 QString extractDeviceNameFromParameters(const QVariantMap &parameters) const;
87
88protected:
89 // Creates an engine which encapsulates all used symbols
90 // that we want to be also able to mock.
91 virtual void createEngine();
93
94private:
95 Q_DISABLE_COPY(QGeoSatelliteInfoSourceGypsy)
96 GypsySatellite *m_satellite;
97 GypsyDevice *m_device;
98 QTimer m_requestTimer;
99 bool m_updatesOngoing;
100 bool m_requestOngoing;
102 GypsyControl *m_control = nullptr;
103 };
104
106
107#endif // QGEOSATELLITEINFOSOURCE_GYPSY_H
IOBluetoothDevice * device
void satellitesChanged(GypsySatellite *satellite, GPtrArray *satellites)
void requestUpdate(int timeout=5000) override
int init(const QVariantMap parameters)
Error error() const override
Returns the last error that occurred.
\inmodule QtPositioning
Error
The Error enumeration represents the errors which can occur.
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qtimer.h:20
virtual void eng_g_free(gpointer mem)
virtual gboolean eng_gypsy_device_stop(GypsyDevice *device, GError **error)
virtual gchar * eng_gconf_client_get_string(GConfClient *client, const gchar *key, GError **err)
SatelliteGypsyEngine(QGeoSatelliteInfoSource *parent=0)
virtual guint eng_g_signal_handlers_disconnect_by_func(gpointer instance, gpointer func, gpointer data)
virtual GypsyControl * eng_gypsy_control_get_default(void)
virtual GConfClient * eng_gconf_client_get_default(void)
virtual gulong eng_g_signal_connect(gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer data)
virtual gboolean eng_gypsy_device_start(GypsyDevice *device, GError **error)
virtual void eng_gypsy_satellite_free_satellite_array(GPtrArray *satellites)
virtual GPtrArray * eng_gypsy_satellite_get_satellites(GypsySatellite *satellite, GError **error)
virtual GypsyDevice * eng_gypsy_device_new(const char *object_path)
QGeoSatelliteInfoSource * m_owner
virtual char * eng_gypsy_control_create(GypsyControl *control, const char *device_name, GError **error)
virtual GypsySatellite * eng_gypsy_satellite_new(const char *object_path)
virtual GypsyDeviceFixStatus eng_gypsy_device_get_fix_status(GypsyDevice *device, GError **error)
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLuint64 key
GLbitfield GLuint64 timeout
[4]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum func
Definition qopenglext.h:663
#define Q_OBJECT
#define slots