Added unit tests.
[situare] / src / ui / userinfopanel.h
1  /*
2     Situare - A location system for Facebook
3     Copyright (C) 2010  Ixonos Plc. Authors:
4
5         Kaj Wallin - kaj.wallin@ixonos.com
6         Katri Kaikkonen - katri.kaikkonen@ixonos.com
7         Pekka Nissinen - pekka.nissinen@ixonos.com
8
9     Situare is free software; you can redistribute it and/or
10     modify it under the terms of the GNU General Public License
11     version 2 as published by the Free Software Foundation.
12
13     Situare is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17
18     You should have received a copy of the GNU General Public License
19     along with Situare; if not, write to the Free Software
20     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
21     USA.
22  */
23
24 #ifndef USERPANEL_H
25 #define USERPANEL_H
26
27 #include "panelbase.h"
28 #include "user/user.h"
29
30 class UserInfo;
31
32 /**
33  * @brief Class for sliding user information panel
34  *
35  * @author Kaj Wallin - kaj.wallin (at) ixonos.com
36  * @author Katri Kaikkonen - katri.kaikkonen (at) ixonos.com
37  * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
38  */
39 class UserInfoPanel : public PanelBase
40 {
41     Q_OBJECT
42
43 public:
44     /**
45      * @brief Default constructor
46      *
47      * @param parent
48      */
49     UserInfoPanel(QWidget *parent = 0);
50
51 /*******************************************************************************
52  * MEMBER FUNCTIONS AND SLOTS
53  ******************************************************************************/
54 public slots:
55     /**
56     * @brief Populates popular tags list
57     *
58     * @param popularTags list of popular tags
59     */
60     void populatePopularTags(QHash<QString, QString> &popularTags);
61
62     /**
63      * @brief show / hide user information
64      *
65      * @param show true if userinfo should be shown
66      */
67     void showUserInfo(bool show);
68
69     /**
70      * @brief Slot to capture returning user data from situareService
71      *
72      * @param user
73      */
74     void userDataReceived(User *user);
75
76 private slots:
77     /**
78     * @brief Sets user's image.
79     *
80     * @param id image ID
81     * @param image image pixmap
82     */
83     void setImage(const QString &id, const QPixmap &image);
84
85     void showTagsDialog();
86
87
88 /*******************************************************************************
89  * SIGNALS
90  ******************************************************************************/
91 signals:
92     /**
93     * @brief Signal for adding tags.
94     *
95     * @param tags tags to add
96     */
97     void addTags(const QStringList &tags);
98
99     /**
100      * @brief Signal for collapse user info
101      */
102     void collapse();
103
104     /**
105      * @brief Signal for finding user.
106      *
107      * @param coordinates user geo coordinates
108      */
109     void findUser(const GeoCoordinate &coordinates);
110
111     /**
112      * @brief Signal that used to inform user that his message/location update tp Situare server
113      *        was failed.
114      *        This signal is originally sended from UserInfo
115      *
116      * @param message message for notification
117      * @param modal true if modal notification otherwice false
118      */
119     void notificateUpdateFailing(const QString &message, bool modal);
120
121     /**
122      * @brief Signal for refreshing user data.
123      */
124     void refreshUserData();
125
126     /**
127     * @brief Signal for removing tags.
128     *
129     * @param tags tags to add
130     */
131     void removeTags(const QStringList &tags);
132
133     /**
134     * @brief Signal for requesting popular tags
135     */
136     void requestPopularTags();
137
138     /**
139      * @brief Signal for requesting reverseGeo from SituareEngine
140      */
141     void requestReverseGeo();
142
143     /**
144      * @brief Signals, when address data is ready
145      *
146      * @param address Street address
147      */
148     void reverseGeoReady(const QString &address);
149
150     /**
151      * @brief Signal Signal for requestLocationUpdate from SituareEngine via MainWindow class
152      *
153      * @param status Status message
154      * @param publish Publish on Facebook
155      */
156     void statusUpdate(const QString &status, const bool &publish);
157
158     /**
159      * @brief Signals when updateLocationDialog's data must be cleared
160      */
161     void clearUpdateLocationDialogData();
162
163
164 /*******************************************************************************
165  * DATA MEMBERS
166  ******************************************************************************/
167 private:
168     UserInfo *m_userInfo; ///< Instance of the user info view
169 };
170 #endif // USERPANEL_H