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
9 Ville Tiensuu - ville.tiensuu@ixonos.com
11 Situare is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License
13 version 2 as published by the Free Software Foundation.
15 Situare is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with Situare; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
31 #include "coordinates/geocoordinate.h"
38 * @brief UserInfo shows user's data in expandable item.
40 class UserInfo : public QWidget
48 * @param parent Parent
50 UserInfo(QWidget *parent = 0);
54 * saves unsend user message to settings
59 /*******************************************************************************
60 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
61 *******************************************************************************/
64 * @brief Set current mouse position to mouse event position.
66 * @param event QMouseEvent mouse press event
68 void mousePressEvent(QMouseEvent *event);
71 * @brief Call toggleHeight if mouse position is unchanged.
73 * Check if current mouse position is same as mouse release position.
74 * @param event QMouseEvent mouse release event
76 void mouseReleaseEvent(QMouseEvent *event);
79 * @brief This function is called when the widget is drawn
81 * @param event Pointer to paint event
83 void paintEvent(QPaintEvent *event);
85 /******************************************************************************
86 * MEMBER FUNCTIONS AND SLOTS
87 ******************************************************************************/
90 * @brief Sets the users current address
92 * @param address Reference to users current address
94 void setAddress(const QString &address);
97 * @brief Sets the users current coordinates
99 * @param coordinates Reference to users current coordinates
101 void setCoordinates(const GeoCoordinate &coordinates);
104 * @brief Sets the user picture
106 * @param image Reference to user picture
108 void setProfileImage(const QPixmap &image);
111 * @brief Sets the time of updated message
113 * @param time Reference to time when message was sent.
115 void setTime(const QString &time);
118 * @brief Sets the user name
120 * @param name Reference to user name
122 void setUserName(const QString &name);
126 * @brief Sets the message text
128 * @param text Reference to user message
130 void setMessageText(const QString &text);
134 * @brief Set shortened or full-length text to labels.
136 * @param expanded true if full-length text is set, false otherwise
138 void setExpanded(bool expanded);
142 * @brief Slot for collapse user info
147 * @brief Slot for find button click
149 void findButtonClicked();
151 /******************************************************************************
153 ******************************************************************************/
156 * @brief Signal for finding user.
158 * @param coordinates user geo coordinates
160 void findUser(const GeoCoordinate &coordinates);
162 /******************************************************************************
164 ******************************************************************************/
166 bool m_expanded; ///< Item expanded state
168 QLabel *m_locationLabel; ///< Location label
169 QLabel *m_nameLabel; ///< Name label
170 QLabel *m_statusTextLabel; ///< Status text label
171 QLabel *m_updatedLabel; ///< Updated label
173 QPixmap m_backgroundBottomImage; ///< Bottom background image
174 QPixmap m_backgroundMiddleImage; ///< Middle background image
175 QPixmap m_backgroundTopImage; ///< Top background image
177 QPoint m_mousePosition; ///< Current mouse press position
179 QString m_messageText; ///< User's message
180 QString m_userName; ///< User's name
182 GeoCoordinate m_coordinates; ///< User current coordinates
183 ImageButton *m_avatar; ///< User find button