Merged map to master
[situare] / src / ui / infotab.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Jukka Saastamoinen - jukka.saastamoinen@ixonos.com
6
7    Situare is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License
9    version 2 as published by the Free Software Foundation.
10
11    Situare is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with Situare; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
19    USA.
20 */
21
22 #ifndef INFOTAB_H
23 #define INFOTAB_H
24
25 #include <QtGui>
26 #include <QWidget>
27
28 /**
29 * @brief InfoTab class.
30 * Composite custom widget class used to show user information
31 * @author Jukka Saastamoinen
32 */
33
34 class InfoTab : public QWidget
35 {
36     Q_OBJECT
37 protected:
38     /**
39     * @brief This function is called when the widget is drawn
40     *
41     * @param aPaintEvent Pointer to paint event
42     */
43     void paintEvent(QPaintEvent *aPaintEvent);
44 public:
45     /**
46     * @brief Constructor
47     *
48     * @param parent Parent
49     */
50     InfoTab(QWidget *parent=0);
51     /**
52     *
53     * @brief Destructor
54     */
55     ~InfoTab();
56 public slots:
57     /**
58     * @brief Sets the users current address
59     *
60     * @param addr Reference to users current address
61     */
62     void setAddress(const QString &addr);
63     /**
64     * @brief Sets the user picture
65     *
66     * @param avat Reference to user picture
67     */
68     void setAvatar(const QPixmap &avat);
69     /**
70     * @brief Sets the message text
71     *
72     * @param text Reference to user message
73     */
74     void setMessageText(const QString &text);
75     /**
76     * @brief Sets the time of updated message
77     *
78     * @param tim Reference to time when message was sent.
79     */
80     void setTime(const QString &tim);
81     /**
82     * @brief Sets the user name
83     *
84     * @param usernam Reference to user name
85     */
86     void setUserName(const QString &usernam);
87 private:
88     QLabel *m_userPicture;    ///< Shows the user's avatar
89     QLabel *m_userNameLabel;  ///< Shows the user's name
90     QLabel *m_messageLabel;   ///< Shows the Situare message icon
91     QLabel *m_addressLabel;   ///< Shows the Situare address icon
92     QLabel *m_timeLabel;      ///< Shows the Situare time icon
93     QGridLayout *m_layout;    ///< Layout for shown items
94     QString m_messageText;    ///< User's message
95     QString m_userName;       ///< User's name
96     QString m_address;        ///< Address from where the new message was sent.
97     QString m_time;           ///< Time when the new message was sent
98     QPixmap m_avatar;         ///< User's avatar
99 };
100
101 #endif // INFOTAB_H