ModemManagerQt

modemlocation.h
1/*
2 SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org>
3 SPDX-FileCopyrightText: 2010 Lamarque Souza <lamarque@kde.org>
4 SPDX-FileCopyrightText: 2013 Lukas Tinkl <ltinkl@redhat.com>
5 SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
8*/
9
10#ifndef MODEMMANAGERQT_MODEMLOCATION_H
11#define MODEMMANAGERQT_MODEMLOCATION_H
12
13#include <modemmanagerqt_export.h>
14
15#include <QDBusPendingReply>
16#include <QObject>
17#include <QSharedPointer>
18
19#include "generictypes.h"
20#include "interface.h"
21
22namespace ModemManager
23{
24class ModemLocationPrivate;
25
26/**
27 * @brief The ModemLocation class
28 *
29 * The Location class allows devices to provide location information to
30 * client applications. Not all devices can provide this information, or even if
31 * they do, they may not be able to provide it while a data session is active.
32 */
33class MODEMMANAGERQT_EXPORT ModemLocation : public Interface
34{
35 Q_OBJECT
36 Q_DECLARE_PRIVATE(ModemLocation)
37 Q_FLAGS(MMModemLocationSource)
38
39public:
41 typedef QList<Ptr> List;
42
43 Q_DECLARE_FLAGS(LocationSources, MMModemLocationSource)
44
45 explicit ModemLocation(const QString &path, QObject *parent = nullptr);
46 ~ModemLocation() override;
47
48 /**
49 * Configure the location sources to use when gathering location
50 * information. Also enable or disable location information gathering. This
51 * method may require the client to authenticate itself.
52 *
53 * When signals are emitted, any client application (including malicious
54 * ones!) can listen for location updates unless D-Bus permissions restrict
55 * these signals from certain users. If further security is desired, the
56 * @p signLocation argument can be set to FALSE to disable location updates
57 * via the locationChanged() signal and require applications to call authenticated APIs
58 * (like GetLocation() ) to get location information.
59 */
61
62 /**
63 * @return current location information, if any. If the modem supports
64 * multiple location types it may return more than one. See the "Location"
65 * property for more information on the dictionary returned at location.
66 *
67 * This method may require the client to authenticate itself.
68 */
70
71 /**
72 * @return QFlags of MMModemLocationSource values, specifying the supported location sources.
73 */
74 LocationSources capabilities() const;
75
76 /**
77 * @return QFlags specifying which of the supported MMModemLocationSource location sources is currently enabled in the device.
78 */
79 LocationSources enabledCapabilities() const;
80
81 /**
82 * @return whether the device has any location capabilities
83 */
84 bool isEnabled() const;
85
86 /**
87 * @return TRUE if location updates will be emitted via the locationChanged() signal, FALSE if location updates will not be emitted.
88 *
89 * See the setup() method for more information.
90 */
91 bool signalsLocation() const;
92
93 /**
94 * @return Dictionary of available location information when location information gathering is enabled. If the modem supports multiple
95 * location types it may return more than one here.
96 * Note that if the device was told not to emit updated location information when location information gathering was initially enabled,
97 * this property may not return any location information for security reasons.
98 */
99 LocationInformationMap location() const;
100
101 /**
102 * Sets the timeout in milliseconds for all async method DBus calls.
103 * -1 means the default DBus timeout (usually 25 seconds).
104 */
105 void setTimeout(int timeout);
106
107 /**
108 * Returns the current value of the DBus timeout in milliseconds.
109 * -1 means the default DBus timeout (usually 25 seconds).
110 */
111 int timeout() const;
112
113Q_SIGNALS:
114 void capabilitiesChanged(QFlags<MMModemLocationSource> capabilities);
115 void enabledCapabilitiesChanged(QFlags<MMModemLocationSource> capabilities);
116 void signalsLocationChanged(bool signalsLocation);
117 /**
118 * Emitted when the location has changed
119 */
121};
122
123Q_DECLARE_OPERATORS_FOR_FLAGS(ModemLocation::LocationSources)
124
125} // namespace ModemManager
126
127#endif
The ModemLocation class.
void locationChanged(const ModemManager::LocationInformationMap &location)
Emitted when the location has changed.
This namespace allows to query the underlying system to discover the available modem interfaces respo...
Definition bearer.cpp:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.