2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Jukka Saastamoinen - jukka.saastamoinen@ixonos.com
6 Jussi Laitinen - jussi.laitinen@ixonos.com
7 Katri Kaikkonen - katri.kaikkonen@ixonos.com
8 Henri Lampela - henri.lampela@ixonos.com
10 Situare is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License
12 version 2 as published by the Free Software Foundation.
14 Situare is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Situare; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
29 #include "updatelocation/updatelocationdialog.h"
31 class UserInfo : public QWidget
38 * @param parent Parent
40 UserInfo(QWidget *parent=0);
42 /*******************************************************************************
43 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
44 *******************************************************************************/
47 * @brief Set current mouse position to mouse event position.
49 * @param event QMouseEvent mouse press event
51 void mousePressEvent(QMouseEvent *event);
54 * @brief Call toggleHeight if mouse position is unchanged.
56 * Check if current mouse position is same as mouse release position.
57 * @param event QMouseEvent mouse release event
59 void mouseReleaseEvent(QMouseEvent *event);
62 * @brief This function is called when the widget is drawn
64 * @param aPaintEvent Pointer to paint event
66 void paintEvent(QPaintEvent *aPaintEvent);
68 /******************************************************************************
69 * MEMBER FUNCTIONS AND SLOTS
70 ******************************************************************************/
73 * @brief Sets the users current address
75 * @param addr Reference to users current address
77 void setAddress(const QString &address);
80 * @brief Sets the user picture
82 * @param avat Reference to user picture
84 void setProfileImage(const QPixmap &image);
87 * @brief Sets the message text
89 * @param text Reference to user message
91 void setMessageText(const QString &text);
94 * @brief Sets the time of updated message
96 * @param tim Reference to time when message was sent.
98 void setTime(const QString &time);
101 * @brief Sets the user name
103 * @param usernam Reference to user name
105 void setUserName(const QString &name);
109 * @brief Set shortened or full-length text to labels.
111 * @param expanded true if full-length text is set, false otherwise
113 void setText(bool expanded);
116 * @brief Set shortened texts from User data.
118 * Text length is defined by MAXIMUM_CHARS.
120 QString shortenText(const QLabel *label, const QString &text, int textMaxWidth);
124 * @brief Slot function to forward messageUpdate launch signal
127 void messageUpdate();
129 /******************************************************************************
131 ******************************************************************************/
134 * @brief Signal for refreshing user data.
137 void refreshUserData();
140 * @brief Signal for requesting reverseGeo from SituareEngine
143 void requestReverseGeo();
146 * @brief Signals, when address data is ready
148 * @param address Street address
150 void reverseGeoReady(const QString &address);
153 * @brief Signal for requestLocationUpdate from SituareEngine via MainWindow class
155 * @param status Status message
156 * @param publish Publish on Facebook
158 void statusUpdate(const QString &status, const bool &publish);
160 /******************************************************************************
162 ******************************************************************************/
164 bool m_expanded; ///< Item expanded state
165 QLabel *m_imageLabel; ///< Image label
166 QLabel *m_locationLabel; ///< Location label
167 QLabel *m_nameLabel; ///< Name label
168 QLabel *m_statusTextLabel; ///< Status text label
169 QLabel *m_updatedLabel; ///< Updated label
170 QPixmap m_backgroundBottomImage; ///< Bottom background image
171 QPixmap m_backgroundMiddleImage; ///< Middle background image
172 QPixmap m_backgroundTopImage; ///< Top background image
173 QPoint m_mousePosition; ///< Current mouse press position
174 QString m_address; ///< Address from where the new message was sent.
175 QString m_messageText; ///< User's message
176 QString m_time; ///< Time when the new message was sent
177 QString m_userName; ///< User's name