Engine class for Situare Application. More...
#include <engine.h>
Public Slots | |
void | error (const QString &error) |
Slot to intercept error signal from ImageFetcher and SituareService. | |
void | fetchUsernameFromSettings () |
Slot to intercept signal when username is fetched from settings. | |
void | loginActionPressed () |
Slot to intercept signal when Login/Logout action is pressed. | |
void | loginOk () |
Slot to intercept signal from successful login. | |
void | loginProcessCancelled () |
Slot to intercept signal when user has cancelled login process. | |
void | logout () |
Changes application state when logged out. | |
void | requestAddress () |
Calls reverseGeo from SituareService to translate coordinates to street address. | |
void | requestUpdateLocation (const QString &status=QString(), bool publish=false) |
Calls updateLocation from SituareService to send the location update to Situare server. | |
void | refreshUserData () |
Slot to refresh user data. | |
void | updateWasSuccessful () |
Slot to intercept signal from successful location update. | |
void | userDataChanged (User *user, QList< User * > &friendsList) |
Slot to intercept signal when new user data is available. Splits User and friendsList data and emits them as two different signals. | |
Signals | |
void | automaticLocationUpdateEnabled (bool enabled) |
Signals when automatic location update was enabled. | |
void | friendsLocationsReady (QList< User * > &friendList) |
Signals when new friends data is ready. | |
void | userLocationReady (User *user) |
Signals when new user data is ready. | |
Public Member Functions | |
SituareEngine (QMainWindow *parent=0) | |
Constructor. | |
~SituareEngine () | |
Destructor. | |
Private Slots | |
void | automaticUpdateIntervalTimerTimeout () |
Automatic update interval timer timeout. | |
void | changeAutoCenteringSetting (bool enabled) |
Set auto centering feature enabled / disabled. | |
void | disableAutoCentering () |
Slot for disabling automatic centering when map is scrolled manually. | |
void | enableAutoCentering (bool enabled) |
Slot for auto centering enabling. | |
void | enableGPS (bool enabled) |
Slot for gps enabling. | |
void | enableAutomaticLocationUpdate (bool enabled, int updateIntervalMsecs=0) |
Enables automatic location update. | |
void | setFirstStartZoomLevel (QPointF latLonCoordinate, qreal accuracy) |
Sets zoom level to default when first GPS location is received if autocentering is enabled. | |
void | saveGPSPosition (QPointF position) |
Saves GPS position. | |
Private Member Functions | |
bool | isUserMoved () |
Checks if user is moved enough for position auto update. | |
void | initializeGpsAndAutocentering () |
Read settings and determine whether to use GPS and autocentering. When values does not found on the settings, GPS and autocentering are enabled as a default. | |
void | signalsFromFacebookAuthenticator () |
Connect signals coming from Facdebook authenticator. | |
void | signalsFromGPS () |
Connect signals coming from GPS. | |
void | signalsFromMainWindow () |
Connect signals coming from MainWindow. | |
void | signalsFromMapEngine () |
Connect signals coming from MapEngine. | |
void | signalsFromMapView () |
Connect signals coming from MapView. | |
void | signalsFromSituareService () |
Connect signals coming from Situare. | |
Private Attributes | |
bool | m_autoCenteringEnabled |
Auto centering flag. | |
bool | m_automaticUpdateFirstStart |
Automatic location update first start flag. | |
bool | m_loggedIn |
Login state. | |
bool | m_userMoved |
Flag for user moving. | |
bool | m_automaticUpdateEnabled |
Automatic update enabled flag. | |
FacebookAuthentication * | m_facebookAuthenticator |
Instance for facebook authenticator. | |
GPSPosition * | m_gps |
Instance of the gps position. | |
MainWindow * | m_ui |
Instance of the MainWindow UI. | |
MapEngine * | m_mapEngine |
MapEngine. | |
SituareService * | m_situareService |
Instance of the situare server communication service. | |
QTimer * | m_automaticUpdateIntervalTimer |
Automatic update interval timer. | |
QPointF | m_lastUpdatedGPSPosition |
Last updated GPS position. |
Engine class for Situare Application.
This class handles all the underlaying login of the Situare application.
SituareEngine::SituareEngine | ( | QMainWindow * | parent = 0 |
) |
Constructor.
parent |
void SituareEngine::automaticLocationUpdateEnabled | ( | bool | enabled | ) | [signal] |
Signals when automatic location update was enabled.
enabled | true if enabled, false otherwise |
void SituareEngine::automaticUpdateIntervalTimerTimeout | ( | ) | [private, slot] |
Automatic update interval timer timeout.
Requests update location if user has moved.
void SituareEngine::changeAutoCenteringSetting | ( | bool | enabled | ) | [private, slot] |
Set auto centering feature enabled / disabled.
enabled | true if enabled, false otherwise |
void SituareEngine::enableAutoCentering | ( | bool | enabled | ) | [private, slot] |
Slot for auto centering enabling.
Calls gps to send last known position
enabled | true if auto centering was enabled, false otherwise |
void SituareEngine::enableAutomaticLocationUpdate | ( | bool | enabled, | |
int | updateIntervalMsecs = 0 | |||
) | [private, slot] |
Enables automatic location update.
enabled | true if enabled, false otherwise | |
updateIntervalMsecs | update interval in milliseconds |
void SituareEngine::enableGPS | ( | bool | enabled | ) | [private, slot] |
Slot for gps enabling.
enabled | true if gps should be enabled, false otherwise |
void SituareEngine::error | ( | const QString & | error | ) | [slot] |
Slot to intercept error signal from ImageFetcher and SituareService.
error | Error message |
void SituareEngine::friendsLocationsReady | ( | QList< User * > & | friendList | ) | [signal] |
Signals when new friends data is ready.
friendList | List of User instances (friends) |
bool SituareEngine::isUserMoved | ( | ) | [private] |
Checks if user is moved enough for position auto update.
void SituareEngine::requestUpdateLocation | ( | const QString & | status = QString() , |
|
bool | publish = false | |||
) | [slot] |
Calls updateLocation from SituareService to send the location update to Situare server.
status | Status message | |
publish | Publish on Facebook |
void SituareEngine::saveGPSPosition | ( | QPointF | position | ) | [private, slot] |
Saves GPS position.
Saves GPS position if it has changed enough and sets m_userMoved flag.
position | geo coordinates |
void SituareEngine::setFirstStartZoomLevel | ( | QPointF | latLonCoordinate, | |
qreal | accuracy | |||
) | [private, slot] |
Sets zoom level to default when first GPS location is received if autocentering is enabled.
latLonCoordinate | own location | |
accuracy | accuracy of GPS location |
void SituareEngine::userLocationReady | ( | User * | user | ) | [signal] |
Signals when new user data is ready.
user | Instance of User |