MainWindow Class Reference

Main Window Class. More...

#include <mainwindow.h>

Collaboration diagram for MainWindow:
Collaboration graph
[legend]

List of all members.

Public Slots

void loginFailed ()
 Slot to intercept signal when login has failed (loginFailure signal).
void loginUsingCookies ()
 Slot to intercept signal when login with cookies is requested.
void openSettingsDialog ()
 Public slot, which open settings dialog.
void setUsername (const QString &username)
 Sets username to member variable for login dialog.
void startLoginProcess ()
 Public slot to intercept signal when old cerdentials are invalid or credentials doesn't exist yet.
void toggleProgressIndicator (bool state)
 Toggle progress indicator.
void updateItemVisibility (bool show)
 Shows / hides Situare related UI items.

Signals

void autoCenteringTriggered (bool enabled)
 Automatic centering setting changed by user.
void cancelLoginProcess ()
 Signal that indicates when user has cancelled login process.
void centerToSceneCoordinates (QPoint sceneCoordinate)
 View should be centered to new location.
void enableAutomaticLocationUpdate (bool enabled, int updateIntervalMsecs)
 Signal for enabling automatic location update.
void fetchUsernameFromSettings ()
 Signal for requesting username from settings.
void findUser (const QPointF &coordinates)
 Signal for finding user.
void gpsTriggered (bool enabled)
 GPS setting changed.
void findFriend (const QPointF &coordinates)
 Signal for finding friend.
void friendsLocationsReady (QList< User * > &friendsList)
 Signal for friend location ready.
void locationItemClicked (const QList< QString > &userIDs)
 Signal is emitted when location item is clicked.
void loginActionPressed ()
 Signals when Login/Logout action is pressed.
void mapViewResized (const QSize &size)
 MapView has been resized.
void mapViewScrolled (QPoint sceneCoordinate)
 Forwarding signal from MapView to MapEngine.
void maxZoomLevelReached ()
 Forwarding signal from MapEngine to MapView.
void messageSendingFailed (const QString &error)
 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 minZoomLevelReached ()
 Forwarding signal from MapEngine to MapView.
void notificateUpdateFailing (const QString &message)
 Signal that used to inform user that his message/location update tp Situare server was failed. This signal is originally sended from UserInfo.
void newMapResolution (qreal scale)
 Forwarding signal from MapEngine to MapScale.
void refreshUserData ()
 Signal for refreshing user data.
void requestReverseGeo ()
 Signal for requesting reverseGeo from SituareEngine.
void reverseGeoReady (const QString &address)
 Signals, when address data is ready.
void saveUsername (const QString &username)
 Signal to save username to settings.
void statusUpdate (const QString &status, const bool &publish)
 Signal for requestLocationUpdate from SituareEngine.
void updateCredentials (const QUrl &url)
 Signals when webview's urlChanged signal is emitted.
void updateWasSuccessful ()
 Signals when updateLocation request finished successfully.
void viewZoomFinished ()
 MapView has finished zooming.
void userLocationReady (User *user)
 Signal for use location ready.
void zoomIn ()
 Map zoom in request.
void zoomLevelChanged (int zoomLevel)
 Forwarding signal from MapEngine to MapView.
void zoomOut ()
 Map zoom out request.

Public Member Functions

 MainWindow (QWidget *parent=0)
 Constructor.
 ~MainWindow ()
 Destructor.
void buildInformationBox (const QString &message, bool modal=false)
 Builds information box with message.
void clearCookieJar ()
 Clears cookie jar.
void loggedIn (bool logged)
void requestAutomaticLocationUpdateSettings ()
 Requests automatic location update settings.
void setAutoCenteringButtonEnabled (bool enabled)
 Enable / disable auto centering button.
void setGPSButtonEnabled (bool enabled)
 Enable / disable GPS button.
void setMapViewScene (QGraphicsScene *scene)
 Set scene for MapView.
void showEnableAutomaticUpdateLocationDialog (const QString &text)
const QString username ()
 Gets the username from member variable for saving purposes.

Private Slots

void automaticUpdateDialogFinished (int result)
 Slot for automatic update dialog finished.
void dialogFinished (int status)
 Slot to intercept signal when dialog/information note is processed.
void drawFullScreenButton (const QSize &size)
 Slot for drawing the fullscreen toggle button.
void drawMapScale (const QSize &size)
 Slot for drawing the map distance scale.
void drawOsmLicense (const QSize &size)
 Slot for drawing the Open Street Map license text.
void drawOwnLocationCrosshair (const QSize &size)
 Slot for drawing the own location crosshair.
void errorDialogFinished (int status)
 Slot to intercept signal when error dialog/information note is processed.
void gpsTimeout ()
 Slot for gps timeout.
void loadCookies ()
 Slot to load cookies from settings.
void loadDone (bool done)
 Slot to intercept signal when webview has finished loading webpage.
void saveCookies ()
 Slot to save cookies to settings.
void setViewPortSize (const QSize &size)
 Set correnct view port size to datamembers.
void toggleFullScreen ()
 Toggle between fullscreen and normal window mode.
void webViewRequestFinished (QNetworkReply *reply)
 Slot to intercept signal from webview's networkaccessmanager.

Private Member Functions

void keyPressEvent (QKeyEvent *event)
 HW increase and decrease key presses are grabbed and used for zooming the map.
void buildFullScreenButton ()
 Build fullscreen toggle button and connect slots.
void buildFriendListPanel ()
 Build friend list panel and connect slots.
void buildManualLocationCrosshair ()
 Build manual location setting cross hair and connect slots.
void buildMap ()
 Build map and connect slots.
void buildMapScale ()
 Build map scale and connect slots.
void buildOsmLicense ()
 Build OSM license and connect slots.
void buildUserInfoPanel ()
 Build user info panel and connect slots.
void buildWebView ()
 Build webview and connect slots.
void buildZoomButtonPanel ()
 Build zoom button panel and connect slots.
void createMenus ()
 Private method to create the Menu items.
void grabZoomKeys (bool grab)
 Grab or release HW increase and decrease buttons.
void queueDialog (QDialog *dialog)
 Queues dialog/information box.
void setOwnLocationCrosshairVisibility (bool visible)
 Set own location crosshair visibility.
void showErrorInformationBox ()
 Shows queued error information box.
void showInformationBox ()
 Shows queued information box.

Private Attributes

bool m_drawOwnLocationCrosshair
 Flag for making ownLocationCrosshair visible or not.
bool m_errorShown
 Indicates if error dialog/note is shown.
bool m_loggedIn
 Indicates login state.
bool m_refresh
 Indicates when webpage is refreshed.
int m_viewPortHeight
 Height of view port.
int m_viewPortWidth
 Width 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.
QLabel * m_ownLocationCrosshair
 Label that show ownLocationCrosshair.
QList< QDialog * > m_error_queue
 QList type error dialog queue.
QList< QDialog * > m_queue
 QList type dialog queue.
QMenu * m_viewMenu
 Object that hold the view menu items.
QMessageBox * m_automaticUpdateLocationDialog
 Automatic update location dialog.
QString m_email
 Placeholder for email.
QString m_password
 Placeholder for password.
QToolButton * m_fullScreenButton
 Instance of the fullscreen toggle button.
QWebView * m_webView
 Shows facebook login page.
FriendListPanelm_friendsListPanel
 Instance of friends list panel.
MapScalem_mapScale
 Instance of the map scale.
MapViewm_mapView
 Instance of the map view.
NetworkCookieJarm_cookieJar
 Placeholder for QNetworkCookies.
PanelSideBarm_userPanelSidebar
 User panel side bar.
PanelSideBarm_friendsListPanelSidebar
 Friends panel side bar.
UserInfoPanelm_userPanel
 Instance of the user information panel.
ZoomButtonPanelm_zoomButtonPanel
 Instance of zoom button panel.
SettingsDialogm_settingsDialog
 Settings dialog.

Detailed Description

Main Window Class.


Constructor & Destructor Documentation

MainWindow::MainWindow ( QWidget *  parent = 0  ) 

Constructor.

Parameters:
parent Parent

Member Function Documentation

void MainWindow::autoCenteringTriggered ( bool  enabled  )  [signal]

Automatic centering setting changed by user.

Parameters:
enabled True if automatic centering is enabled, otherwise false
void MainWindow::automaticUpdateDialogFinished ( int  result  )  [private, slot]

Slot for automatic update dialog finished.

Returns:
result code
void MainWindow::buildInformationBox ( const QString &  message,
bool  modal = false 
)

Builds information box with message.

Parameters:
message Information message
modal Modal = true, non-modal false
void MainWindow::centerToSceneCoordinates ( QPoint  sceneCoordinate  )  [signal]

View should be centered to new location.

Parameters:
sceneCoordinate Scene coordinates of the new center point
void MainWindow::dialogFinished ( int  status  )  [private, slot]

Slot to intercept signal when dialog/information note is processed.

Parameters:
status Status of the dialog
void MainWindow::drawFullScreenButton ( const QSize &  size  )  [private, slot]

Slot for drawing the fullscreen toggle button.

Parameters:
size Size of the screen
void MainWindow::drawMapScale ( const QSize &  size  )  [private, slot]

Slot for drawing the map distance scale.

Parameters:
size Size of the screen
void MainWindow::drawOsmLicense ( const QSize &  size  )  [private, slot]

Slot for drawing the Open Street Map license text.

Parameters:
size Size of the screen
void MainWindow::drawOwnLocationCrosshair ( const QSize &  size  )  [private, slot]

Slot for drawing the own location crosshair.

Parameters:
size Size of the screen
void MainWindow::enableAutomaticLocationUpdate ( bool  enabled,
int  updateIntervalMsecs 
) [signal]

Signal for enabling automatic location update.

Parameters:
enabled true if enabled, false otherwise
updateIntervalMsecs update interval in milliseconds
void MainWindow::errorDialogFinished ( int  status  )  [private, slot]

Slot to intercept signal when error dialog/information note is processed.

Parameters:
status Status of the dialog
void MainWindow::findFriend ( const QPointF &  coordinates  )  [signal]

Signal for finding friend.

Parameters:
coordinates friend's geo coordinates
void MainWindow::findUser ( const QPointF &  coordinates  )  [signal]

Signal for finding user.

Parameters:
coordinates user geo coordinates
void MainWindow::friendsLocationsReady ( QList< User * > &  friendsList  )  [signal]

Signal for friend location ready.

Parameters:
friendsList 
void MainWindow::gpsTimeout (  )  [private, slot]

Slot for gps timeout.

Called when request timeout occurs.

void MainWindow::gpsTriggered ( bool  enabled  )  [signal]

GPS setting changed.

Parameters:
enabled True if GPS is enabled, otherwise false
void MainWindow::grabZoomKeys ( bool  grab  )  [private]

Grab or release HW increase and decrease buttons.

Parameters:
grab Use true for grabbing and false for releasing the keys
void MainWindow::loadDone ( bool  done  )  [private, slot]

Slot to intercept signal when webview has finished loading webpage.

Parameters:
done Status of the loading
void MainWindow::locationItemClicked ( const QList< QString > &  userIDs  )  [signal]

Signal is emitted when location item is clicked.

Parameters:
userIDs list of friends user IDs in the group
void MainWindow::loggedIn ( bool  logged  ) 
Parameters:
logged 
void MainWindow::mapViewResized ( const QSize &  size  )  [signal]

MapView has been resized.

Parameters:
size view size
void MainWindow::mapViewScrolled ( QPoint  sceneCoordinate  )  [signal]

Forwarding signal from MapView to MapEngine.

Parameters:
sceneCoordinate 
void MainWindow::queueDialog ( QDialog *  dialog  )  [private]

Queues dialog/information box.

Parameters:
dialog Dialog to be added into queue
void MainWindow::reverseGeoReady ( const QString &  address  )  [signal]

Signals, when address data is ready.

Parameters:
address Street address
void MainWindow::saveUsername ( const QString &  username  )  [signal]

Signal to save username to settings.

Parameters:
username Username
void MainWindow::setAutoCenteringButtonEnabled ( bool  enabled  ) 

Enable / disable auto centering button.

Parameters:
enabled true if shoud be enabled, false otherwise
void MainWindow::setGPSButtonEnabled ( bool  enabled  ) 

Enable / disable GPS button.

Does set visibilities for manual location cursor and auto centering menu button.

Parameters:
enabled true if enabled, false otherwise
void MainWindow::setMapViewScene ( QGraphicsScene *  scene  ) 

Set scene for MapView.

Parameters:
scene Scene to be set
void MainWindow::setOwnLocationCrosshairVisibility ( bool  visible  )  [private]

Set own location crosshair visibility.

Parameters:
visible 
void MainWindow::setUsername ( const QString &  username  )  [slot]

Sets username to member variable for login dialog.

Parameters:
username Username to be set
void MainWindow::setViewPortSize ( const QSize &  size  )  [private, slot]

Set correnct view port size to datamembers.

Parameters:
size Size of the screen
void MainWindow::showEnableAutomaticUpdateLocationDialog ( const QString &  text  ) 

Shows dialog with enable automatic location update question.

Parameters:
text text to show in dialog
void MainWindow::statusUpdate ( const QString &  status,
const bool &  publish 
) [signal]

Signal for requestLocationUpdate from SituareEngine.

Parameters:
status Status message
publish Publish on Facebook
void MainWindow::toggleProgressIndicator ( bool  state  )  [slot]

Toggle progress indicator.

Parameters:
state true if progress indicator should be shown, false otherwise
void MainWindow::updateCredentials ( const QUrl &  url  )  [signal]

Signals when webview's urlChanged signal is emitted.

Parameters:
url New url
void MainWindow::updateItemVisibility ( bool  show  )  [slot]

Shows / hides Situare related UI items.

Parameters:
show 
void MainWindow::userLocationReady ( User user  )  [signal]

Signal for use location ready.

Parameters:
user User object
const QString MainWindow::username (  ) 

Gets the username from member variable for saving purposes.

Returns:
QString Username
void MainWindow::webViewRequestFinished ( QNetworkReply *  reply  )  [private, slot]

Slot to intercept signal from webview's networkaccessmanager.

Parameters:
reply Network reply (contains errors)

The documentation for this class was generated from the following files:

Generated on Thu Jun 10 09:44:04 2010 for Situare client for Maemo by  doxygen 1.6.1