qgeopositioninfosource.sip 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. // qgeopositioninfosource.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtPositioning Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. %If (Qt_6_2_0 -)
  22. class QGeoPositionInfoSource : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qgeopositioninfosource.h>
  26. %End
  27. %ConvertToSubClassCode
  28. static struct class_graph {
  29. const char *name;
  30. sipTypeDef **type;
  31. int yes, no;
  32. } graph[] = {
  33. {sipName_QGeoAreaMonitorSource, &sipType_QGeoAreaMonitorSource, -1, 1},
  34. {sipName_QGeoPositionInfoSource, &sipType_QGeoPositionInfoSource, 3, 2},
  35. {sipName_QGeoSatelliteInfoSource, &sipType_QGeoSatelliteInfoSource, 4, -1},
  36. {sipName_QNmeaPositionInfoSource, &sipType_QNmeaPositionInfoSource, -1, -1},
  37. {sipName_QNmeaSatelliteInfoSource, &sipType_QNmeaSatelliteInfoSource, -1, -1},
  38. };
  39. int i = 0;
  40. sipType = NULL;
  41. do
  42. {
  43. struct class_graph *cg = &graph[i];
  44. if (cg->name != NULL && sipCpp->inherits(cg->name))
  45. {
  46. sipType = *cg->type;
  47. i = cg->yes;
  48. }
  49. else
  50. i = cg->no;
  51. }
  52. while (i >= 0);
  53. %End
  54. public:
  55. enum Error
  56. {
  57. AccessError,
  58. ClosedError,
  59. UnknownSourceError,
  60. UpdateTimeoutError,
  61. NoError,
  62. };
  63. enum PositioningMethod /BaseType=Flag/
  64. {
  65. NoPositioningMethods,
  66. SatellitePositioningMethods,
  67. NonSatellitePositioningMethods,
  68. AllPositioningMethods,
  69. };
  70. typedef QFlags<QGeoPositionInfoSource::PositioningMethod> PositioningMethods;
  71. explicit QGeoPositionInfoSource(QObject *parent /TransferThis/);
  72. virtual ~QGeoPositionInfoSource();
  73. virtual void setUpdateInterval(int msec);
  74. int updateInterval() const;
  75. virtual void setPreferredPositioningMethods(QGeoPositionInfoSource::PositioningMethods methods);
  76. QGeoPositionInfoSource::PositioningMethods preferredPositioningMethods() const;
  77. virtual QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const = 0;
  78. virtual QGeoPositionInfoSource::PositioningMethods supportedPositioningMethods() const = 0;
  79. virtual int minimumUpdateInterval() const = 0;
  80. QString sourceName() const;
  81. static QGeoPositionInfoSource *createDefaultSource(QObject *parent /TransferThis/) /Factory/;
  82. static QGeoPositionInfoSource *createDefaultSource(const QVariantMap &parameters, QObject *parent /TransferThis/) /Factory/;
  83. static QGeoPositionInfoSource *createSource(const QString &sourceName, QObject *parent /TransferThis/) /Factory/;
  84. static QGeoPositionInfoSource *createSource(const QString &sourceName, const QVariantMap &parameters, QObject *parent /TransferThis/) /Factory/;
  85. static QStringList availableSources();
  86. virtual QGeoPositionInfoSource::Error error() const = 0;
  87. public slots:
  88. virtual void startUpdates() = 0;
  89. virtual void stopUpdates() = 0;
  90. virtual void requestUpdate(int timeout = 0) = 0;
  91. signals:
  92. void positionUpdated(const QGeoPositionInfo &update);
  93. void supportedPositioningMethodsChanged();
  94. void errorOccurred(QGeoPositionInfoSource::Error);
  95. public:
  96. virtual bool setBackendProperty(const QString &name, const QVariant &value);
  97. virtual QVariant backendProperty(const QString &name) const;
  98. };
  99. %End