X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fmainwindow.h;h=44d9b671f7de7f862c5dfd72fe95d6bea250e771;hb=2b0eaa8f6793fde2f8c946f5e7c98ee84dec8b98;hp=1ed213d729f71ffe277feb598180d08c4e2b3618;hpb=be9403a9a43d8a3e97d7706221bdf5afe8f97169;p=situare diff --git a/src/ui/mainwindow.h b/src/ui/mainwindow.h index 1ed213d..44d9b67 100644 --- a/src/ui/mainwindow.h +++ b/src/ui/mainwindow.h @@ -27,19 +27,23 @@ #include #include +#include "network/networkcookiejar.h" +#include "panelsidebar.h" + class QGraphicsScene; class QLabel; class QWebView; class FacebookAuthentication; class FriendListPanel; -class LoginDialog; class MapScene; class MapView; class SituareService; class User; class UserInfoPanel; class ZoomButtonPanel; +class SettingsDialog; +class QToolButton; /** * @brief Main Window Class @@ -76,6 +80,19 @@ private: ******************************************************************************/ public: /** + * @brief Clears cookie jar + * + */ + void clearCookieJar(); + + /** + * @brief + * + * @param logged + */ + void loggedIn(bool logged); + + /** * @brief Enable / disable auto centering button. * * @param enabled true if shoud be enabled, false otherwise @@ -101,9 +118,10 @@ public: /** * @brief Show Maemo information box with message. * - * @brief message information message + * @param message Information message + * @param modal Modal = true, non-modal false */ - void showMaemoInformationBox(const QString &message); + void showMaemoInformationBox(const QString &message, bool modal=false); /** * @brief Gets the username from member variable for saving purposes @@ -114,18 +132,16 @@ public: public slots: /** - * @brief Slot to intercept signal when user has pressed connect button from loginDialog + * @brief Slot to intercept signal when login has failed (loginFailure signal) * - * @param email E-mail - * @param password Password */ - void loginDialogDone(const QString &email, const QString &password); + void loginFailed(); /** - * @brief Slot to intercept signal when login has failed (loginFailure signal) + * @brief Slot to intercept signal when login with cookies is requested * */ - void loginFailed(); + void loginUsingCookies(); /** * @brief Public slot, which open settings dialog @@ -154,8 +170,20 @@ public slots: */ void toggleProgressIndicator(bool state); + /** + * @brief Shows / hides Situare related UI items + * + * @param show + */ + void updateItemVisibility(bool show); + private: /** + * @brief Build fullscreen toggle button and connect slots + */ + void buildFullScreenButton(); + + /** * @brief Build friend list panel and connect slots */ void buildFriendListPanel(); @@ -181,6 +209,12 @@ private: void buildUserInfoPanel(); /** + * @brief Build webview and connect slots + * + */ + void buildWebView(); + + /** * @brief Build zoom button panel and connect slots */ void buildZoomButtonPanel(); @@ -206,12 +240,18 @@ private: private slots: /** + * @brief Slot for drawing the fullscreen toggle button + * + * @param size Size of the screen + */ + void drawFullScreenButton(const QSize &size); + + /** * @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 @@ -222,18 +262,17 @@ private slots: void drawOwnLocationCrosshair(int width, int height); /** - * @brief Slot for gps error. + * @brief Slot for gps timeout. * - * @param message error message + * Called when request timeout occurs. */ - void gpsError(const QString &message); + void gpsTimeout(); /** - * @brief Slot for gps timeout. + * @brief Slot to load cookies from settings * - * Called when request timeout occurs. */ - void gpsTimeout(); + void loadCookies(); /** * @brief Slot to intercept signal when webview has finished loading webpage @@ -243,6 +282,12 @@ private slots: void loadDone(bool done); /** + * @brief Slot to save cookies to settings + * + */ + void saveCookies(); + + /** * @brief Set correnct view port size to datamembers * * @param width Width of the viewport @@ -250,6 +295,11 @@ private slots: */ void setViewPortSize(const int width, const int height); + /** + * @brief Toggle between fullscreen and normal window mode + */ + void toggleFullScreen(); + /******************************************************************************* * SIGNALS ******************************************************************************/ @@ -275,12 +325,27 @@ signals: void centerToSceneCoordinates(QPoint sceneCoordinate); /** + * @brief Signal for enabling automatic location update. + * + * @param enabled true if enabled, false otherwise + * @param updateIntervalMsecs update interval in milliseconds + */ + void enableAutomaticLocationUpdate(bool enabled, int updateIntervalMsecs); + + /** * @brief Signal for requesting username from settings * */ void fetchUsernameFromSettings(); /** + * @brief Signal for finding user. + * + * @param coordinates user geo coordinates + */ + void findUser(const QPointF &coordinates); + + /** * @brief GPS setting changed * * @param enabled True if GPS is enabled, otherwise false @@ -302,6 +367,19 @@ signals: void friendsLocationsReady(QList &friendsList); /** + * @brief Signal is emitted when location item is clicked. + * + * @param userIDs list of friends user IDs in the group + */ + void locationItemClicked(const QList &userIDs); + + /** + * @brief Signals when Login/Logout action is pressed + * + */ + void loginActionPressed(); + + /** * @brief MapView has been resized * * @param size view size @@ -321,11 +399,25 @@ signals: void maxZoomLevelReached(); /** + * @brief Signal that informs that user's message/location failed to update on Situare server + * This signal is originally sended from SituareService with name error + * Signal is renamed on MainWindow + */ + void messageSendingFailed(const QString &error); + + /** * @brief Forwarding signal from MapEngine to MapView */ void minZoomLevelReached(); /** + * @brief Signal that used to inform user that his message/location update tp Situare server + * was failed. + * This signal is originally sended from UserInfo + */ + void notificateUpdateFailing(const QString &message); + + /** * @brief Signal for refreshing user data. * */ @@ -345,6 +437,13 @@ signals: void reverseGeoReady(const QString &address); /** + * @brief Signal to save username to settings + * + * @param username Username + */ + void saveUsername(const QString &username); + + /** * @brief Signal for requestLocationUpdate from SituareEngine * * @param status Status message @@ -360,6 +459,12 @@ signals: void updateCredentials(const QUrl &url); /** + * @brief Signals when updateLocation request finished successfully + * + */ + void updateWasSuccessful(); + + /** * @brief MapView has finished zooming */ void viewZoomFinished(); @@ -390,8 +495,8 @@ signals: * DATA MEMBERS ******************************************************************************/ 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 @@ -399,6 +504,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 @@ -409,15 +515,19 @@ private: QString m_email; ///< Placeholder for email QString m_password; ///< Placeholder for password - QUrl m_loginUrl; ///< Placeholder for login page url + QToolButton *m_fullScreenButton; ///< Instance of the fullscreen toggle button QWebView *m_webView; ///< Shows facebook login page FriendListPanel *m_friendsListPanel; ///< Instance of friends list panel - LoginDialog *m_loginDialog; ///< Login dialog MapView *m_mapView; ///< Instance of the map view + NetworkCookieJar *m_cookieJar; ///< Placeholder for QNetworkCookies + 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