Skip to content

Class QfGeofencer

ClassList > QfGeofencer

More...

  • #include <qfgeofencer.h>

Inherits the following classes: QObject

Public Types

Type Name
enum AudioTypes
enum Behaviors

Public Properties

Type Name
property bool active
property QString areasFilterExpression
property QgsVectorLayer * areasLayer
property AudioTypes audio
property Behaviors behavior
property bool isAlerting
property bool isWithin
property QString isWithinAreaName
property QString lastFeedback
property QString lastWithinAreaName
property QgsPoint position
property QgsCoordinateReferenceSystem positionCrs
property bool vibration

Public Signals

Type Name
signal void activeChanged
signal void areasFilterExpressionChanged
signal void areasLayerChanged
signal void audioChanged
signal void behaviorChanged
signal void invertLogicChanged
signal void isAlertingChanged
signal void isWithinChanged
signal void lastFeedbackChanged
signal void positionChanged
signal void positionCrsChanged
signal void projectChanged
signal void vibrationChanged

Public Functions

Type Name
QfGeofencer (QObject * parent=nullptr)
bool active () const
Q_INVOKABLE void applyProjectSettings (QgsProject * project)
QString areasFilterExpression () const
QgsVectorLayer * areasLayer () const
AudioTypes audio () const
Behaviors behavior () const
bool isAlerting () const
bool isWithin () const
QString isWithinAreaName () const
QString lastFeedback () const
QString lastWithinAreaName () const
QgsPoint position () const
QgsCoordinateReferenceSystem positionCrs () const
void setActive (bool active)
void setAreasFilterExpression (const QString & areasFilterExpression)
void setAreasLayer (QgsVectorLayer * layer)
void setAudio (AudioTypes audio)
void setBehavior (Behaviors behavior)
void setPosition (const QgsPoint & position)
void setPositionCrs (const QgsCoordinateReferenceSystem & crs)
void setVibration (bool vibration)
bool vibration () const
virtual ~QfGeofencer ()

Detailed Description

This class provides an interface to manage geofencing of areas as well as providing feedback whenever the position trespasses into or out of those areas.

Public Types Documentation

enum AudioTypes

enum QfGeofencer::AudioTypes {
    AudioMuted = 1,
    AudioAlarm = 2,
    AudioSpeech = 3
};

enum Behaviors

enum QfGeofencer::Behaviors {
    AlertWhenInsideGeofencedArea = 1,
    AlertWhenOutsideGeofencedArea,
    InformWhenEnteringLeavingGeofencedArea
};

Public Properties Documentation

property active [1/2]

bool QfGeofencer::active;

property areasFilterExpression [1/2]

QString QfGeofencer::areasFilterExpression;

property areasLayer [1/2]

QgsVectorLayer * QfGeofencer::areasLayer;

property audio [1/2]

AudioTypes QfGeofencer::audio;

property behavior [1/2]

Behaviors QfGeofencer::behavior;

property isAlerting [1/2]

bool QfGeofencer::isAlerting;

property isWithin [1/2]

bool QfGeofencer::isWithin;

property isWithinAreaName [1/2]

QString QfGeofencer::isWithinAreaName;

property lastFeedback [1/2]

QString QfGeofencer::lastFeedback;

property lastWithinAreaName [1/2]

QString QfGeofencer::lastWithinAreaName;

property position [1/2]

QgsPoint QfGeofencer::position;

property positionCrs [1/2]

QgsCoordinateReferenceSystem QfGeofencer::positionCrs;

property vibration [1/2]

bool QfGeofencer::vibration;

Public Signals Documentation

signal activeChanged

void QfGeofencer::activeChanged;

signal areasFilterExpressionChanged

void QfGeofencer::areasFilterExpressionChanged;

signal areasLayerChanged

void QfGeofencer::areasLayerChanged;

signal audioChanged

void QfGeofencer::audioChanged;

signal behaviorChanged

void QfGeofencer::behaviorChanged;

signal invertLogicChanged

void QfGeofencer::invertLogicChanged;

signal isAlertingChanged

void QfGeofencer::isAlertingChanged;

signal isWithinChanged

void QfGeofencer::isWithinChanged;

signal lastFeedbackChanged

void QfGeofencer::lastFeedbackChanged;

signal positionChanged

void QfGeofencer::positionChanged;

signal positionCrsChanged

void QfGeofencer::positionCrsChanged;

signal projectChanged

void QfGeofencer::projectChanged;

signal vibrationChanged

void QfGeofencer::vibrationChanged;

Public Functions Documentation

function QfGeofencer

explicit QfGeofencer::QfGeofencer (
    QObject * parent=nullptr
) 

function active [2/2]

inline bool QfGeofencer::active () const

Returns TRUE when geofencing is active.

See also: setActive


function applyProjectSettings

Q_INVOKABLE void QfGeofencer::applyProjectSettings (
    QgsProject * project
) 

Sets the polygon layer holding areas from a given project.


function areasFilterExpression [2/2]

inline QString QfGeofencer::areasFilterExpression () const

Returns the expression used to filter polygons within the areas layer.


function areasLayer [2/2]

inline QgsVectorLayer * QfGeofencer::areasLayer () const

Returns the polygon layer holding areas.


function audio [2/2]

inline AudioTypes QfGeofencer::audio () const

Returns the type of audio triggered by the behavior.


function behavior [2/2]

inline Behaviors QfGeofencer::behavior () const

Returns the geofencing behavior.


function isAlerting [2/2]

inline bool QfGeofencer::isAlerting () const

Returns TRUE when the geofencer's behavior is triggering an alarm.


function isWithin [2/2]

bool QfGeofencer::isWithin () const

Returns whether the current position is within an area.


function isWithinAreaName [2/2]

QString QfGeofencer::isWithinAreaName () const

Returns the area name within which the current position overlaps. If no overlap, an empty string will be returned.


function lastFeedback [2/2]

inline QString QfGeofencer::lastFeedback () const

Returns the last feedback string generated by position change and the selected behavior.


function lastWithinAreaName [2/2]

QString QfGeofencer::lastWithinAreaName () const

Returns the last area name within which the position had overlapped. If no overlap has yet to occur, an empty string will be returned.


function position [2/2]

inline QgsPoint QfGeofencer::position () const

Returns the position to be used to check for overlap with areas.


function positionCrs [2/2]

inline QgsCoordinateReferenceSystem QfGeofencer::positionCrs () const

Returns the position's coordinate reference system (CRS).


function setActive

void QfGeofencer::setActive (
    bool active
) 

Sets the geofencing active state.

See also: active


function setAreasFilterExpression

void QfGeofencer::setAreasFilterExpression (
    const QString & areasFilterExpression
) 

Sets the expression used to filter polygons within the areas layer.


function setAreasLayer

void QfGeofencer::setAreasLayer (
    QgsVectorLayer * layer
) 

Sets the polygon layer holding areas.


function setAudio

void QfGeofencer::setAudio (
    AudioTypes audio
) 

Sets the type of audio triggered by the behavior.


function setBehavior

void QfGeofencer::setBehavior (
    Behaviors behavior
) 

Sets the geofencing behavior.


function setPosition

void QfGeofencer::setPosition (
    const QgsPoint & position
) 

Sets the position to be used to check for overlap with areas.


function setPositionCrs

void QfGeofencer::setPositionCrs (
    const QgsCoordinateReferenceSystem & crs
) 

Sets the position's coordinate reference system (CRS).


function setVibration

void QfGeofencer::setVibration (
    bool vibration
) 

Sets whether vibration will be triggered by the behavior.


function vibration [2/2]

inline bool QfGeofencer::vibration () const

Returns true if vibration will be triggered by the behavior.


function ~QfGeofencer

virtual QfGeofencer::~QfGeofencer () 


The documentation for this class was generated from the following file src/core/positioning/qfgeofencer.h