#define MAINWINDOW_H
#include <QtGui/QMainWindow>
+#include <QSslError>
#include <QUrl>
#include "network/networkcookiejar.h"
+class QDialog;
class QGraphicsScene;
class QLabel;
class QMessageBox;
class QToolButton;
class QWebView;
-class FacebookAuthentication;
class FriendListPanel;
class FullScreenButton;
class GeoCoordinate;
class SettingsDialog;
class SituareService;
class TabbedPanel;
+class UpdateLocation;
class User;
class UserInfoPanel;
class ZoomButtonPanel;
******************************************************************************/
public:
/**
- * @brief Clears cookie jar
- *
- */
- void clearCookieJar();
+ * @brief Build and show login dialog with login browser
+ *
+ * @param browser Login browser instance
+ */
+ void buildLoginDialog(QWebView *browser);
/**
* @brief
void loggedIn(bool logged);
/**
- * @brief Gets the login state (logged in/logged out)
- *
- * @return bool Login state
- */
- bool loginState();
-
- /**
* @brief Reads automatic location update settings.
*/
void readAutomaticLocationUpdateSettings();
*/
void showEnableAutomaticUpdateLocationDialog(const QString &text);
- /**
- * @brief Gets the username from member variable for saving purposes
- *
- * @return QString Username
- */
- const QString username();
-
public slots:
/**
* @brief Builds information box with message.
void buildInformationBox(const QString &message, bool modal=false);
/**
- * @brief Slot for failed login
- */
- void loginFailed();
-
- /**
- * @brief Slot to intercept signal when login with cookies is requested
- */
- void loginUsingCookies();
+ * @brief Hides and deletes login dialog
+ */
+ void destroyLoginDialog();
/**
* @brief Public slot, which open settings dialog
void setCrosshairVisibility(bool visible);
/**
- * @brief Sets username to member variable for login dialog
- *
- * @param username Username to be set
- */
- void setUsername(const QString &username);
-
- /**
- * @brief Method to show panels
- */
- void showPanels();
-
- /**
- * @brief Public slot to intercept signal when old cerdentials are invalid or credentials
- * doesn't exist yet
- */
- void startLoginProcess();
+ * @brief Shows contact dialog.
+ *
+ * Shows contact dialog with contact's information.
+ * @param guid globally unique ID of a contact
+ */
+ void showContactDialog(const QString &guid);
/**
* @brief Toggle progress indicator.
void toggleProgressIndicator(bool state);
/**
- * @brief Shows / hides Situare related UI items
+ * @brief Shows / hides Situare related UI items based on login state
*
+ * @param loggedIn Is the user currently logged in
*/
- void updateItemVisibility();
+ void updateItemVisibility(bool loggedIn);
private:
/**
*/
void buildIndicatorButtonPanel();
+
+ /**
+ * @brief Build location search panel and connect signals
+ */
void buildLocationSearchPanel();
/**
void buildUserInfoPanel();
/**
- * @brief Build webview and connect slots
- */
- void buildWebView();
-
- /**
* @brief Build zoom button panel and connect slots
*/
void buildZoomButtonPanel();
void gpsTimeout();
/**
- * @brief Slot to load cookies from settings
- */
- void loadCookies();
-
- /**
- * @brief Slot to intercept signal when webview has finished loading webpage
- *
- * @param done Status of the loading
- */
- void loadDone(bool done);
-
- /**
* @brief Called when map center point horizontal shifting is changed
*
* @param shifting New shifting value
void moveCrosshair();
/**
- * @brief Slot to save cookies to settings
+ * @brief Slot for settings dialog accepted.
*/
- void saveCookies();
+ void settingsDialogAccepted();
/**
- * @brief Slot for settings dialog accepted.
+ * @brief Show update location dialog
*/
- void settingsDialogAccepted();
+ void showUpdateLocationDialog();
+
+ /**
+ * @brief Ignore SSL error from the reply
+ */
+ void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
/**
* @brief Start location search (open search dialog)
*/
void toggleFullScreen();
- /**
- * @brief Slot to intercept signal from webview's networkaccessmanager
- *
- * @param reply Network reply (contains errors)
- */
- void webViewRequestFinished(QNetworkReply* reply);
-
/*******************************************************************************
* SIGNALS
******************************************************************************/
void autoCenteringTriggered(bool enabled);
/**
- * @brief Signal that indicates when user has cancelled login process
- *
- */
- void cancelLoginProcess();
-
- /**
* @brief Signal for centering to coordinates.
*
* @param coordinates geo coordinates to center to.
void error(const int context, const int error);
/**
- * @brief Signal for requesting username from settings
- *
- */
- void fetchUsernameFromSettings();
-
- /**
* @brief Signals when friend's profile image is ready
*
* @param user Friend
void locationItemClicked(const GeoCoordinate &swBound, const GeoCoordinate &neBound);
/**
+ * @brief Send location update
+ *
+ * @param status Status message
+ * @param publish Publish on Facebook?
+ */
+ void locationUpdate(const QString &status, bool publish);
+
+ /**
* @brief Signals when Login/Logout action is pressed
*
*/
void refreshUserData();
/**
+ * @brief Requests contact dialog.
+ *
+ * @param facebookId contact's facebookId
+ */
+ void requestContactDialog(const QString &facebookId);
+
+ /**
* @brief Signal for requesting reverseGeo from SituareEngine
*
*/
void routeTo(const GeoCoordinate &coordinates);
/**
- * @brief Signal to save username to settings
- *
- * @param username Username
- */
- void saveUsername(const QString &username);
+ * @brief Request routing to current cursor position
+ */
+ void routeToCursor();
/**
* @brief Signal for location search
void searchForLocation(QString location);
/**
- * @brief Signal for requestLocationUpdate from SituareEngine
- *
- * @param status Status message
- * @param publish Publish on Facebook
- */
- void statusUpdate(const QString &status, const bool &publish);
-
- /**
- * @brief Signals when webview's urlChanged signal is emitted
- *
- * @param url New url
- */
- void updateCredentials(const QUrl &url);
-
- /**
- * @brief Signals when updateLocationDialog's data must be cleared
- *
- */
- void clearUpdateLocationDialogData();
+ * @brief Signal is emitted when search history item is clicked.
+ *
+ * @param searchString search string used
+ */
+ void searchHistoryItemClicked(const QString &searchString);
/**
* @brief Dragging mode triggered.
void viewZoomFinished();
/**
+ * @brief Signals when updateLocation request finished successfully
+ */
+ void updateWasSuccessful();
+
+ /**
* @brief Signal for use location ready.
*
* @param user User object
QAction *m_loginAct; ///< Action to Login/Logout
QAction *m_toSettingsAct; ///< Action to trigger switch to settings dialog
+ QDialog *m_loginDialog; ///< Login dialog
+
QLabel *m_crosshair; ///< Label for center point crosshair
QLabel *m_osmLicense; ///< Label for Open Street Map license
+ QList<int> m_situareTabsIndexes; ///< List of Situare tab indexes
QList<QDialog *> m_error_queue; ///< QList type error dialog queue
QList<QDialog *> m_queue; ///< QList type dialog queue
QMessageBox *m_automaticUpdateLocationDialog; ///< Automatic update location dialog
- QString m_email; ///< Placeholder for email
- QString m_password; ///< Placeholder for password
-
- QWebView *m_webView; ///< Shows facebook login page
-
FriendListPanel *m_friendsListPanel; ///< Instance of friends list panel
FullScreenButton *m_fullScreenButton; ///< Instance of the fullscreen toggle button
- IndicatorButtonPanel *m_indicatorButtonPanel; ///< Instance of direction indicator button
- LocationSearchPanel *m_locationSearchPanel;
+ IndicatorButtonPanel *m_indicatorButtonPanel; ///< Instance of direction indicator button
+ LocationSearchPanel *m_locationSearchPanel; ///< Location search panel
MapScale *m_mapScale; ///< Instance of the map scale
MapView *m_mapView; ///< Instance of the map view
- NetworkCookieJar *m_cookieJar; ///< Placeholder for QNetworkCookies
RoutingPanel *m_routingPanel; ///< Instance of routing panel
TabbedPanel *m_tabbedPanel; ///< Widget for tabbed panels
+ UpdateLocation *m_updateLocationController; ///< Controller for update location dialog
UserInfoPanel *m_userInfoPanel; ///< Instance of the user information panel
ZoomButtonPanel *m_zoomButtonPanel; ///< Instance of zoom button panel
};