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);
53 * @brief Call toggleHeight if mouse position is unchanged.
55 * Check if current mouse position is same as mouse release position.
56 * @param event QMouseEvent mouse release event
58 void mouseReleaseEvent(QMouseEvent *event);
60 * @brief This function is called when the widget is drawn
62 * @param aPaintEvent Pointer to paint event
64 void paintEvent(QPaintEvent *aPaintEvent);
66 /******************************************************************************
67 * MEMBER FUNCTIONS AND SLOTS
68 ******************************************************************************/
71 * @brief Sets the users current address
73 * @param addr Reference to users current address
75 void setAddress(const QString &addr);
78 * @brief Sets the user picture
80 * @param avat Reference to user picture
82 void setAvatar(const QPixmap &image);
85 * @brief Sets the message text
87 * @param text Reference to user message
89 void setMessageText(const QString &text);
92 * @brief Sets the time of updated message
94 * @param tim Reference to time when message was sent.
96 void setTime(const QString &tim);
99 * @brief Sets the user name
101 * @param usernam Reference to user name
103 void setUserName(const QString &name);
107 * @brief Set shortened or full-length text to labels.
109 * @param expanded true if full-length text is set, false otherwise
111 void setText(bool expanded);
114 * @brief Set shortened texts from User data.
116 * Text length is defined by MAXIMUM_CHARS.
118 QString shortenText(const QLabel *label, const QString &text, int textMaxWidth);
122 * @brief Slot function to forward messageUpdate launch signal
125 void messageUpdate();
127 /******************************************************************************
129 ******************************************************************************/
132 * @brief Signal for refreshing user data.
135 void refreshUserData();
138 * @brief Signal for requesting reverseGeo from SituareEngine
141 void requestReverseGeo();
144 * @brief Signals, when address data is ready
146 * @param address Street address
148 void reverseGeoReady(const QString &address);
151 * @brief Signal for requestLocationUpdate from SituareEngine via MainWindow class
153 * @param status Status message
154 * @param publish Publish on Facebook
156 void statusUpdate(const QString &status, const bool &publish);
158 /******************************************************************************
160 ******************************************************************************/
162 bool m_expanded; ///< Item expanded state
163 QLabel *m_imageLabel; ///< Image label
164 QLabel *m_locationLabel; ///< Location label
165 QLabel *m_nameLabel; ///< Name label
166 QLabel *m_statusTextLabel; ///< Status text label
167 QLabel *m_updatedLabel; ///< Updated label
168 QPixmap m_backgroundBottomImage; ///< Bottom background image
169 QPixmap m_backgroundMiddleImage; ///< Middle background image
170 QPixmap m_backgroundTopImage; ///< Top background image
171 QPoint m_mousePosition; ///< Current mouse press position
172 QString m_address; ///< Address from where the new message was sent.
173 QString m_messageText; ///< User's message
174 QString m_time; ///< Time when the new message was sent
175 QString m_userName; ///< User's name