Moved location update logic to new class called UpdateLocation.
[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 class UpdateLocation;\r
33 \r
34 #include "texteditautoresizer.h"\r
35 \r
36 class QCheckBox;\r
37 class QDialogButtonBox;\r
38 class QGroupBox;\r
39 class QLabel;\r
40 class QLineEdit;\r
41 class QPushButton;\r
42 class QScrollArea;\r
43 class QTextEdit;\r
44 \r
45 /**\r
46 * @brief Update Location UI\r
47 *\r
48 * UI for update location functionality.\r
49 */\r
50 class UpdateLocationDialog : public QDialog\r
51 {\r
52     Q_OBJECT\r
53 \r
54 public:\r
55     /**\r
56     * @brief Default constructor\r
57     *\r
58     * Is deleted automatically when closed.\r
59     *\r
60     * @param controller Controller for location update\r
61     * @param parent\r
62     */\r
63     UpdateLocationDialog(UpdateLocation *controller, QWidget *parent = 0);\r
64 \r
65     /**\r
66       * @brief Destructor\r
67       *\r
68       * Does nothing.\r
69       */\r
70     ~UpdateLocationDialog();\r
71 \r
72 /*******************************************************************************\r
73  * MEMBER FUNCTIONS AND SLOTS\r
74  ******************************************************************************/\r
75 public slots:\r
76     /**\r
77     * @brief Used to set the street address to location label\r
78     *\r
79     * @param address Street address, result from SituareService's reverseGeo\r
80     */\r
81     void setAddress(const QString &address);\r
82 \r
83 private slots:\r
84     /**\r
85     * @brief Used to connect send button\r
86     */\r
87     void sendUpdate();\r
88 \r
89     /**\r
90     * @brief Used to get changes in messagetext\r
91     */\r
92     void textChanged();\r
93 \r
94     /**\r
95     * @brief Used to clear default messagetext\r
96     */\r
97     void textSelectionChanged();\r
98 \r
99 /*******************************************************************************\r
100  * DATA MEMBERS\r
101  ******************************************************************************/\r
102 private:\r
103     QCheckBox *m_checkBox;          ///< Pointer to CheckBox\r
104     QLabel *m_charCountLabel;       ///< Pointer to character counter label\r
105     QLabel *m_locationLabel;        ///< Pointer to locationLabel\r
106     QTextEdit *m_textEdit;          ///< Pointer to TextEdit\r
107 \r
108     UpdateLocation *m_controller;   ///< Controller for location update dialog\r
109 };\r
110 \r
111 #endif // UPDATELOCATIONDIALOG_H\r