2731061d06bd2d34bb02d8fa80a7c211e09e5793
[situare] / src / ui / updatelocation / updatelocationdialog.h
1 /*\r
2    Situare - A location system for Facebook\r
3    Copyright (C) 2010  Ixonos Plc. Authors:\r
4 \r
5       Katri Kaikkonen - katri.kaikkonen@ixonos.com\r
6       Henri Lampela - henri.lampela@ixonos.com\r
7 \r
8    Situare is free software; you can redistribute it and/or\r
9    modify it under the terms of the GNU General Public License\r
10    version 2 as published by the Free Software Foundation.\r
11 \r
12    Situare is distributed in the hope that it will be useful,\r
13    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15    GNU General Public License for more details.\r
16 \r
17    You should have received a copy of the GNU General Public License\r
18    along with Situare; if not, write to the Free Software\r
19    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,\r
20    USA.\r
21 */\r
22 \r
23 #ifndef UPDATELOCATIONDIALOG_H\r
24 #define UPDATELOCATIONDIALOG_H\r
25 \r
26 #include <QDialog>\r
27 \r
28 #ifdef Q_WS_MAEMO_5\r
29 #include <QAbstractKineticScroller>\r
30 #endif // Q_WS_MAEMO_5\r
31 \r
32 #include "texteditautoresizer.h"\r
33 \r
34 class QCheckBox;\r
35 class QDialogButtonBox;\r
36 class QGroupBox;\r
37 class QLabel;\r
38 class QLineEdit;\r
39 class QPushButton;\r
40 class QScrollArea;\r
41 class QTextEdit;\r
42 \r
43 /**\r
44 * @brief Update Location UI\r
45 *\r
46 * UI for update location functionality.\r
47 */\r
48 class UpdateLocationDialog : public QDialog\r
49 {\r
50     Q_OBJECT\r
51 \r
52 public:\r
53     /**\r
54     * @brief Default constructor\r
55     *\r
56     * @param userMessage update location dialog message\r
57     * @param publishOnFacebook update location dialog Facebook publish policity\r
58     * @param parent\r
59     */\r
60     UpdateLocationDialog(const QString &userMessage = "", bool publishOnFacebook = false,\r
61                          QWidget *parent = 0);\r
62 \r
63     ~UpdateLocationDialog();\r
64 \r
65 /*******************************************************************************\r
66  * MEMBER FUNCTIONS AND SLOTS\r
67  ******************************************************************************/\r
68 public slots:\r
69     /**\r
70     * @brief Used to set the street address to location label\r
71     *\r
72     * @param address Street address, result from SituareService's reverseGeo\r
73     */\r
74     void setAddress(const QString &address);\r
75 \r
76 private slots:\r
77     /**\r
78     * @brief Used to connect send button\r
79     *\r
80     */\r
81     void sendUpdate();\r
82 \r
83     /**\r
84     * @brief Used to get changes in messagetext\r
85     *\r
86     */\r
87     void textChanged();\r
88 \r
89     /**\r
90     * @brief Used to clear default messagetext\r
91     *\r
92     */\r
93     void textSelectionChanged();\r
94 \r
95 /*******************************************************************************\r
96  * SIGNALS\r
97  ******************************************************************************/\r
98 signals:\r
99     /**\r
100     * @brief Routing signal for requestLocationUpdate to SituareEngine via MainWindow class\r
101     *\r
102     * @param status Status message\r
103     * @param publish Publish on Facebook\r
104     */\r
105     void statusUpdate(const QString &status, const bool &publish);\r
106 \r
107 /*******************************************************************************\r
108  * DATA MEMBERS\r
109  ******************************************************************************/\r
110 private:\r
111     QCheckBox *m_checkBox;          ///< Pointer to CheckBox\r
112     QLabel *m_charCountLabel;       ///< Pointer to character counter label\r
113     QLabel *m_locationLabel;        ///< Pointer to locationLabel\r
114     QTextEdit *m_textEdit;          ///< Pointer to TextEdit\r
115 };\r
116 \r
117 #endif // UPDATELOCATIONDIALOG_H\r