00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Jukka Saastamoinen - jukka.saastamoinen@ixonos.com 00006 Jussi Laitinen - jussi.laitinen@ixonos.com 00007 Katri Kaikkonen - katri.kaikkonen@ixonos.com 00008 Henri Lampela - henri.lampela@ixonos.com 00009 Ville Tiensuu - ville.tiensuu@ixonos.com 00010 00011 Situare is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License 00013 version 2 as published by the Free Software Foundation. 00014 00015 Situare is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with Situare; if not, write to the Free Software 00022 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00023 USA. 00024 */ 00025 00026 #ifndef USERINFO_H 00027 #define USERINFO_H 00028 00029 #include <QWidget> 00030 00031 #include "coordinates/geocoordinate.h" 00032 #include "updatelocation/updatelocationdialog.h" 00033 00034 class ImageButton; 00035 00039 class UserInfo : public QWidget 00040 { 00041 Q_OBJECT 00042 00043 public: 00049 UserInfo(QWidget *parent = 0); 00050 00056 ~UserInfo(); 00057 00058 /******************************************************************************* 00059 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS 00060 *******************************************************************************/ 00061 protected: 00067 void mousePressEvent(QMouseEvent *event); 00068 00075 void mouseReleaseEvent(QMouseEvent *event); 00076 00082 void paintEvent(QPaintEvent *event); 00083 00084 /****************************************************************************** 00085 * MEMBER FUNCTIONS AND SLOTS 00086 ******************************************************************************/ 00087 public: 00093 void setAddress(const QString &address); 00094 00100 void setCoordinates(const GeoCoordinate &coordinates); 00101 00107 void setProfileImage(const QPixmap &image); 00108 00114 void setTime(const QString &time); 00115 00121 void setUserName(const QString &name); 00122 00123 public slots: 00131 void backupUpdateLocationDialogData(const QString &status, bool publish); 00132 00136 void clearUpdateLocationDialogData(); 00137 00143 void setMessageText(const QString &text); 00144 00145 private: 00149 void restoreUnsendMessage(); 00150 00156 void setExpanded(bool expanded); 00157 00158 private slots: 00162 void collapse(); 00163 00167 void findButtonClicked(); 00168 00172 void messageUpdate(); 00173 00177 void updateLocationDialogFinished(int reason); 00178 00179 /****************************************************************************** 00180 * SIGNALS 00181 ******************************************************************************/ 00182 signals: 00188 void findUser(const GeoCoordinate &coordinates); 00189 00197 void notificateUpdateFailing(const QString &message, bool modal); 00198 00202 void requestReverseGeo(); 00203 00209 void reverseGeoReady(const QString &address); 00210 00217 void statusUpdate(const QString &status, const bool &publish); 00218 00219 /****************************************************************************** 00220 * DATA MEMBERS 00221 ******************************************************************************/ 00222 private: 00223 bool m_backupFacebookPublishPolicity; 00224 bool m_expanded; 00225 00226 QLabel *m_locationLabel; 00227 QLabel *m_nameLabel; 00228 QLabel *m_statusTextLabel; 00229 QLabel *m_updatedLabel; 00230 00231 QPixmap m_backgroundBottomImage; 00232 QPixmap m_backgroundMiddleImage; 00233 QPixmap m_backgroundTopImage; 00234 00235 QPoint m_mousePosition; 00236 00237 QString m_address; 00238 QString m_backupMessage; 00239 QString m_messageText; 00240 QString m_time; 00241 QString m_userName; 00242 00243 GeoCoordinate m_coordinates; 00244 ImageButton *m_avatar; 00245 UpdateLocationDialog *m_updateLocation; 00246 }; 00247 00248 #endif // USERINFO_H