X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fui%2Fmainwindow.h;h=f9a1a13f2e6c2ad2a78ebf6390d23aac69b78987;hb=5c278b1afcacc9371e8424b6af64b1cdfd233e61;hp=ab87f3980896d39c7b2d1cd85e8ff4c9f7ca97d5;hpb=69aad6909e7ce7482e56255b65b70cfdffaaa9a1;p=situare diff --git a/src/ui/mainwindow.h b/src/ui/mainwindow.h index ab87f39..f9a1a13 100644 --- a/src/ui/mainwindow.h +++ b/src/ui/mainwindow.h @@ -28,10 +28,12 @@ #define MAINWINDOW_H #include +#include #include #include "network/networkcookiejar.h" +class QDialog; class QGraphicsScene; class QLabel; class QMessageBox; @@ -39,16 +41,19 @@ class QNetworkReply; class QToolButton; class QWebView; -class FacebookAuthentication; -class FullScreenButton; class FriendListPanel; -class IndicatorButtonPanel; +class FullScreenButton; class GeoCoordinate; +class IndicatorButtonPanel; +class Location; +class LocationSearchPanel; class MapScale; class MapScene; class MapView; -class SettingsDialog; +class Route; +class RoutingPanel; class SceneCoordinate; +class SettingsDialog; class SituareService; class TabbedPanel; class User; @@ -89,10 +94,11 @@ private: ******************************************************************************/ 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 @@ -152,11 +158,6 @@ public: public slots: /** - * @brief Build direction indicator button panel and connect signals - */ - void buildIndicatorButtonPanel(); - - /** * @brief Builds information box with message. * * @param message Information message @@ -165,14 +166,14 @@ public slots: void buildInformationBox(const QString &message, bool modal=false); /** - * @brief Slot for failed login - */ - void loginFailed(); + * @brief Hides and deletes login dialog + */ + void destroyLoginDialog(); /** - * @brief Slot to intercept signal when login with cookies is requested + * @brief Slot for failed login */ - void loginUsingCookies(); + void loginFailed(); /** * @brief Public slot, which open settings dialog @@ -184,24 +185,19 @@ public slots: * * @param visible */ - void setOwnLocationCrosshairVisibility(bool visible); - - /** - * @brief Sets username to member variable for login dialog - * - * @param username Username to be set - */ - void setUsername(const QString &username); + void setCrosshairVisibility(bool visible); /** - * @brief Method to show panels - */ - void showPanels(); + * @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 Public slot to intercept signal when old cerdentials are invalid or credentials * doesn't exist yet - * */ void startLoginProcess(); @@ -220,9 +216,9 @@ public slots: private: /** - * @brief Build fullscreen toggle button and connect slots + * @brief Build manual location setting cross hair and connect slots */ - void buildFullScreenButton(); + void buildCrosshair(); /** * @brief Build friend list panel and connect slots @@ -230,9 +226,20 @@ private: void buildFriendListPanel(); /** - * @brief Build manual location setting cross hair and connect slots + * @brief Build fullscreen toggle button and connect slots + */ + void buildFullScreenButton(); + + /** + * @brief Build direction indicator button panel and connect signals */ - void buildManualLocationCrosshair(); + void buildIndicatorButtonPanel(); + + + /** + * @brief Build location search panel and connect signals + */ + void buildLocationSearchPanel(); /** * @brief Build map and connect slots @@ -255,14 +262,14 @@ private: void buildPanels(); /** - * @brief Build user info panel and connect slots + * @brief Build routing panel and connect slots */ - void buildUserInfoPanel(); + void buildRoutingPanel(); /** - * @brief Build webview and connect slots + * @brief Build user info panel and connect slots */ - void buildWebView(); + void buildUserInfoPanel(); /** * @brief Build zoom button panel and connect slots @@ -338,13 +345,6 @@ private slots: void drawOsmLicense(const QSize &size); /** - * @brief Slot for drawing the own location crosshair - * - * @param size Size of the screen - */ - void drawOwnLocationCrosshair(const QSize &size); - - /** * @brief Slot to intercept signal when error dialog/information note is processed * * @param status Status of the dialog @@ -359,21 +359,16 @@ private slots: 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 mapCenterHorizontalShiftingChanged(int shifting); /** - * @brief Slot to save cookies to settings + * @brief Move the crosshair */ - void saveCookies(); + void moveCrosshair(); /** * @brief Slot for settings dialog accepted. @@ -381,11 +376,9 @@ private slots: void settingsDialogAccepted(); /** - * @brief Set correnct view port size to datamembers - * - * @param size Size of the screen + * @brief Ignore SSL error from the reply */ - void setViewPortSize(const QSize &size); + void sslErrors(QNetworkReply *reply, const QList &errors); /** * @brief Start location search (open search dialog) @@ -397,13 +390,6 @@ private slots: */ void toggleFullScreen(); - /** - * @brief Slot to intercept signal from webview's networkaccessmanager - * - * @param reply Network reply (contains errors) - */ - void webViewRequestFinished(QNetworkReply* reply); - /******************************************************************************* * SIGNALS ******************************************************************************/ @@ -422,6 +408,13 @@ signals: void cancelLoginProcess(); /** + * @brief Signal for centering to coordinates. + * + * @param coordinates geo coordinates to center to. + */ + void centerToCoordinates(const GeoCoordinate &coordinates); + + /** * @brief View should be centered to new location * * @param coordinate Scene coordinates of the new center point @@ -429,6 +422,11 @@ signals: void centerToSceneCoordinates(const SceneCoordinate &coordinate); /** + * @brief Emitted when route is cleared + */ + void clearRoute(); + + /** * @brief Signal when direction and distance from current map center point to current GPS * location is changed * @@ -461,13 +459,6 @@ signals: void fetchUsernameFromSettings(); /** - * @brief Signal for finding user. - * - * @param coordinates user geo coordinates - */ - void findUser(const GeoCoordinate &coordinates); - - /** * @brief Signals when friend's profile image is ready * * @param user Friend @@ -482,13 +473,6 @@ signals: void gpsTriggered(bool enabled); /** - * @brief Signal for finding friend. - * - * @param coordinates friend's geo coordinates - */ - void findFriend(const GeoCoordinate &coordinates); - - /** * @brief Signal for friend location ready. * * @param friendsList @@ -496,13 +480,28 @@ signals: void friendsLocationsReady(QList &friendsList); /** - * @brief Signal is emitted when location item is clicked. + * @brief Emited when location request is parsed and is ready for further processing + * + * @param result List of Location items + */ + void locationDataParsed(const QList &result); + + /** + * @brief Signal is emitted when location item is clicked on map. * * @param userIDs list of friends user IDs in the group */ void locationItemClicked(const QList &userIDs); /** + * @brief Signal is emitted when location item is clicked in list. + * + * @param swBound south-west bound in GeoCoorinate + * @param neBound north-east bound in GeoCoordinate + */ + void locationItemClicked(const GeoCoordinate &swBound, const GeoCoordinate &neBound); + + /** * @brief Signals when Login/Logout action is pressed * */ @@ -518,7 +517,7 @@ signals: /** * @brief Forwarding signal from MapView to MapEngine * - * @param coordinate + * @param coordinate New center point coordinate */ void mapViewScrolled(const SceneCoordinate &coordinate); @@ -544,6 +543,13 @@ signals: void refreshUserData(); /** + * @brief Requests contact dialog. + * + * @param facebookId contact's facebookId + */ + void requestContactDialog(const QString &facebookId); + + /** * @brief Signal for requesting reverseGeo from SituareEngine * */ @@ -557,11 +563,23 @@ signals: void reverseGeoReady(const QString &address); /** - * @brief Signal to save username to settings - * - * @param username Username - */ - void saveUsername(const QString &username); + * @brief Emited when route is parsed and is ready for further processing + * + * @param route Route item containing parsed route details + */ + void routeParsed(Route &route); + + /** + * @brief Signal for routing to geo coordinates. + * + * @param coordinates destination geo coordinates + */ + void routeTo(const GeoCoordinate &coordinates); + + /** + * @brief Request routing to current cursor position + */ + void routeToCursor(); /** * @brief Signal for location search @@ -571,6 +589,13 @@ signals: void searchForLocation(QString location); /** + * @brief Signal is emitted when search history item is clicked. + * + * @param searchString search string used + */ + void searchHistoryItemClicked(const QString &searchString); + + /** * @brief Signal for requestLocationUpdate from SituareEngine * * @param status Status message @@ -579,13 +604,6 @@ signals: 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 * */ @@ -631,16 +649,19 @@ private: bool m_loggedIn; ///< Indicates login state bool m_refresh; ///< Indicates when webpage is refreshed + int m_mapCenterHorizontalShifting; ///< Amount of map center point horizontal shifting int m_progressIndicatorCount; ///< Indicates the number of progress indicator calls 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 - QAction *m_searchLocationAct; /// @todo this is temporary, remove when not needed! + QDialog *m_loginDialog; ///< Login dialog + + QLabel *m_crosshair; ///< Label for center point crosshair QLabel *m_osmLicense; ///< Label for Open Street Map license - QLabel *m_ownLocationCrosshair; ///< Label that show ownLocationCrosshair + QList m_situareTabsIndexes; ///< List of Situare tab indexes QList m_error_queue; ///< QList type error dialog queue QList m_queue; ///< QList type dialog queue @@ -648,19 +669,16 @@ private: QMessageBox *m_automaticUpdateLocationDialog; ///< Automatic update location dialog - QSize m_viewPortSize; ///< Size of the viewport - 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 + 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 UserInfoPanel *m_userInfoPanel; ///< Instance of the user information panel ZoomButtonPanel *m_zoomButtonPanel; ///< Instance of zoom button panel