Added auto updating methods to Engine.
[situare] / src / ui / mainwindow.h
index e54e33d..2657415 100644 (file)
@@ -27,6 +27,8 @@
 #include <QtGui/QMainWindow>
 #include <QUrl>
 
+#include "panelsidebar.h"
+
 class QGraphicsScene;
 class QLabel;
 class QWebView;
@@ -37,10 +39,10 @@ class LoginDialog;
 class MapScene;
 class MapView;
 class SituareService;
-class UpdateLocationDialog;
 class User;
 class UserInfoPanel;
 class ZoomButtonPanel;
+class SettingsDialog;
 
 /**
 * @brief Main Window Class
@@ -75,7 +77,14 @@ private:
 /*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
-public:
+public:    
+    /**
+    * @brief
+    *
+    * @param logged
+    */
+    void loggedIn(bool logged);
+
     /**
     * @brief Enable / disable auto centering button.
     *
@@ -106,6 +115,13 @@ public:
     */
     void showMaemoInformationBox(const QString &message);
 
+    /**
+    * @brief Gets the username from member variable for saving purposes
+    *
+    * @return QString Username
+    */
+    const QString username();
+
 public slots:
     /**
     * @brief Slot to intercept signal when user has pressed connect button from loginDialog
@@ -127,6 +143,20 @@ public slots:
     void openSettingsDialog();
 
     /**
+    * @brief Sets username to member variable for login dialog
+    *
+    * @param username Username to be set
+    */
+    void setUsername(const QString &username);
+
+    /**
+    * @brief
+    *
+    * @param show
+    */
+    void showPanels(bool show);
+
+    /**
     * @brief Public slot to intercept signal when old cerdentials are invalid or credentials
     *        doesn't exist yet
     *
@@ -195,10 +225,9 @@ private slots:
     /**
     * @brief Slot for drawing the Open Street Map license text
     *
-    * @param width Width of the viewport
-    * @param height Height of the viewport
+    * @param size Size of the screen
     */
-    void drawOsmLicense(int width, int height);
+    void drawOsmLicense(const QSize &size);
 
     /**
     * @brief Slot for drawing the own location crosshair
@@ -242,31 +271,38 @@ private slots:
  ******************************************************************************/
 signals:
     /**
+    * @brief Automatic centering setting changed by user
+    *
+    * @param enabled True if automatic centering is enabled, otherwise false
+    */
+    void autoCenteringTriggered(bool enabled);
+
+    /**
     * @brief Signal that indicates when user has cancelled login process
     *
     */
     void cancelLoginProcess();
 
     /**
-    * @brief Automatic centering setting changed
+    * @brief View should be centered to new location
     *
-    * @param enabled True if automatic centering is enabled, otherwise false
+    * @param sceneCoordinate Scene coordinates of the new center point
     */
-    void autoCenteringToggled(bool enabled);
+    void centerToSceneCoordinates(QPoint sceneCoordinate);
 
     /**
-    * @brief Automatic centering setting changed by user
+    * @brief Signal for enabling automatic location update.
     *
-    * @param enabled True if automatic centering is enabled, otherwise false
+    * @param enabled true if enabled, false otherwise
+    * @param updateIntervalMsecs update interval in milliseconds
     */
-    void autoCenteringTriggered(bool enabled);
+    void enableAutomaticLocationUpdate(bool enabled, int updateIntervalMsecs);
 
     /**
-    * @brief View should be centered to new location
+    * @brief Signal for requesting username from settings
     *
-    * @param sceneCoordinate Scene coordinates of the new center point
     */
-    void centerToSceneCoordinates(QPoint sceneCoordinate);
+    void fetchUsernameFromSettings();
 
     /**
     * @brief GPS setting changed
@@ -290,6 +326,19 @@ signals:
     void friendsLocationsReady(QList<User *> &friendsList);
 
     /**
+    * @brief Signal is emitted when location item is clicked.
+    *
+    * @param userIDs list of friends user IDs in the group
+    */
+    void locationItemClicked(const QList<QString> &userIDs);
+
+    /**
+    * @brief Signals when Login/Logout action is pressed
+    *
+    */
+    void loginActionPressed();
+
+    /**
     * @brief MapView has been resized
     *
     * @param size view size
@@ -380,6 +429,7 @@ signals:
 private:
 
     bool m_drawOwnLocationCrosshair;        ///< Flag for making ownLocationCrosshair visible or not
+    bool m_loggedIn;                        ///< Indicates login state
     bool m_refresh;                         ///< Indicates when webpage is refreshed
 
     int m_viewPortHeight;                   ///< Height of view port
@@ -387,6 +437,7 @@ private:
 
     QAction *m_autoCenteringAct;            ///< Action to auto center map using gps position
     QAction *m_gpsToggleAct;                ///< Action to trigger gps toggle
+    QAction *m_loginAct;                    ///< Action to Login/Logout
     QAction *m_toSettingsAct;               ///< Action to trigger switch to settings dialog
 
     QLabel *m_osmLicense;                   ///< Label for Open Street Map license
@@ -404,9 +455,12 @@ private:
     FriendListPanel *m_friendsListPanel;    ///< Instance of friends list panel
     LoginDialog *m_loginDialog;             ///< Login dialog
     MapView *m_mapView;                     ///< Instance of the map view
-    UpdateLocationDialog *m_locationDialog; ///< Message dialog
+    PanelSideBar *m_userPanelSidebar;       ///< User panel side bar
+    PanelSideBar *m_friendsListPanelSidebar;///< Friends panel side bar
     UserInfoPanel *m_userPanel;             ///< Instance of the user information panel
     ZoomButtonPanel *m_zoomButtonPanel;     ///< Instance of zoom button panel
+
+    SettingsDialog *m_settingsDialog;       ///< Settings dialog
 };
 
 #endif // MAINWINDOW_H