Added coordinates to sendMessage.
[situare] / src / engine / engine.h
index defb0f2..2cd2341 100644 (file)
 
 #include <QObject>
 #include <QTime>
+#include <QPair>
 
 #include "coordinates/geocoordinate.h"
+#include "situareservice/situareservice.h"
 
 class QTimer;
 
 class Application;
+class ContactManager;
 class FacebookAuthentication;
 class FacebookCredentials;
 class GeocodingService;
@@ -43,6 +46,7 @@ class MainWindow;
 class MapEngine;
 class MCE;
 class NetworkAccessManager;
+class Route;
 class RoutingService;
 class SituareService;
 class User;
@@ -139,8 +143,9 @@ public slots:
     /**
     * @brief Slot to intercept signal from successful location update
     *
+    * @param successfulMethod which method was successful
     */
-    void updateWasSuccessful();
+    void updateWasSuccessful(SituareService::SuccessfulMethod successfulMethod);
 
     /**
     * @brief Slot to intercept signal when new user data is available.
@@ -225,11 +230,12 @@ private slots:
     void enableAutomaticLocationUpdate(bool enabled, int updateIntervalMsecs = 0);
 
     /**
-    * @brief Slot to intercept signal when user's/friend's image is downloaded
+    * @brief Slot for image ready
     *
-    * @param user Instance of user/friend
+    * @param id image ID
+    * @param image image pixmap
     */
-    void imageReady(User *user);
+    void imageReady(const QString &id, const QPixmap &image);
 
     /**
     * @brief Requests automatic update.
@@ -241,6 +247,43 @@ private slots:
     void requestAutomaticUpdateIfMoved(GeoCoordinate position);
 
     /**
+    * @brief Requests interesting people from current map viewport.
+    *
+    * Interesting people is defined by people with same tags as user has.
+    */
+    void requestInterestingPeople();
+
+    /**
+    * @brief Route is parsed and is ready for further processing.
+    *
+    * @param route Route item containing parsed route details
+    */
+    void routeParsed(Route &route);
+
+    /**
+    * @brief Routes to geo coordinates.
+    *
+    * Uses map center coordinates as start point.
+    * @param endPointCoordinates end point geo coordinates
+    */
+    void routeTo(const GeoCoordinate &endPointCoordinates);
+
+    /**
+    * @brief Route to current cursor position
+    */
+    void routeToCursor();
+
+    /**
+    * @brief Requests to send a message to a person.
+    *
+    * Adds coordinates to to message if selected.
+    * @param receiverId Facebook user ID
+    * @param message message text
+    * @param addCoordinates true if coordinates should be added, false otherwise
+    */
+    void requestSendMessage(const QString &receiverId, const QString &message, bool addCoordinates);
+
+    /**
     * @brief Slot for setting auto centering state.
     *
     * Calls gps to send last known position
@@ -270,6 +313,22 @@ private slots:
     void setPowerSaving(bool enabled);
 
     /**
+    * @brief Shows contact dialog.
+    *
+    * Calls MainWindow showContactDialog with contact guid defined by contact's Facebook ID.
+    * @param facebookId contact's facebookId
+    */
+    void showContactDialog(const QString &facebookId);
+
+    /**
+    * @brief Shows message dialog.
+    *
+    * If contact is a friend, show contact dialog instead.
+    * @param receiver receiver facebook ID and name
+    */
+    void showMessageDialog(const QPair<QString, QString> &receiver);
+
+    /**
     * @brief Automatic update interval timer timeout.
     *
     * Requests update location if user has moved.
@@ -281,7 +340,7 @@ private slots:
     *
     * Does set power saving state.
     *
-    * @param mainWindowIsTopmost True if MainWindow is the topmost one
+    * @param isMainWindow True if MainWindow is the topmost one
     */
     void topmostWindowChanged(bool isMainWindow);
 
@@ -324,7 +383,7 @@ signals:
     *
     * @param user Instance of friend
     */
-    void friendImageReady(User *user);
+    void friendImageReady(const QString &id, const QPixmap &image);
 
     /**
     * @brief Emited when location request is parsed and is ready for further processing
@@ -334,6 +393,13 @@ signals:
     void locationDataParsed(QList<Location> &result);
 
     /**
+    * @brief Signals when users's image is ready
+    *
+    * @param user Instance of friend
+    */
+    void userImageReady(const QString &id, const QPixmap &image);
+
+    /**
     * @brief Signals when new user data is ready
     *
     * @param user Instance of User
@@ -351,6 +417,7 @@ private:
 
     QTimer *m_automaticUpdateIntervalTimer; ///< Automatic update interval timer
 
+    ContactManager *m_contactManager;                ///< Instance of contact manager
     FacebookAuthentication *m_facebookAuthenticator; ///< Instance for facebook authenticator
     GeocodingService *m_geocodingService;            ///< Instance of the geocoding service
     GeoCoordinate m_lastUpdatedGPSPosition;          ///< Last updated GPS position