#define MAINWINDOW_H
#include <QtGui/QMainWindow>
+#include <QSslError>
#include <QUrl>
//Remove this
#include "situareservice/message.h"
#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 Shows contact dialog.
*
* Shows contact dialog with contact's information.
void showMessageDialog(const QPair<QString, QString> &receiver);
/**
- * @brief Public slot to intercept signal when old cerdentials are invalid or credentials
- * doesn't exist yet
- */
- void startLoginProcess();
-
- /**
* @brief Toggle progress indicator.
*
* @param state true if progress indicator should be shown, false otherwise
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 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 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);
-
- /**
* REMOVE THIS, FIXES WEBVIEW BUG IN SCRATCHBOX
*/
void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
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 routeToCursor();
/**
- * @brief Signal to save username to settings
- *
- * @param username Username
- */
- void saveUsername(const QString &username);
-
- /**
* @brief Signal for location search
*
* @param location QString location
void sendMessage(const QString &receiverId, const QString &message, bool addCoordinates);
/**
- * @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 image is downloaded
*
* @param id image ID
void userImageReady(const QString &id, const QPixmap &image);
/**
- * @brief Signals when updateLocationDialog's data must be cleared
- *
- */
- void clearUpdateLocationDialogData();
-
- /**
* @brief Dragging mode triggered.
*/
void draggingModeTriggered();
void requestMessages();
/**
+ * @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
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
MapScale *m_mapScale; ///< Instance of the map scale
MapView *m_mapView; ///< Instance of the map view
MeetPeoplePanel *m_meetPeoplePanel; ///< Instance of MeetPeoplePanel
- NetworkCookieJar *m_cookieJar; ///< Placeholder for QNetworkCookies
MessagePanel *m_messagePanel; ///< Instance of MessagePanel
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
};