#include <QtGui/QMainWindow>
#include <QUrl>
+#include "panelsidebar.h"
+
class QGraphicsScene;
class QLabel;
class QWebView;
class MapScene;
class MapView;
class SituareService;
-class UpdateLocationDialog;
class User;
class UserInfoPanel;
class ZoomButtonPanel;
+class SettingsDialog;
/**
* @brief Main Window Class
/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
-public:
+public:
+ /**
+ * @brief
+ *
+ * @param logged
+ */
+ void loggedIn(bool logged);
+
/**
* @brief Enable / disable auto centering button.
*
*/
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
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
*
/**
* @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
******************************************************************************/
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
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
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
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
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