Moved location update logic to new class called UpdateLocation.
[situare] / src / ui / updatelocation / updatelocationdialog.h
old mode 100755 (executable)
new mode 100644 (file)
index 998b86f..4bb2987
-/*
-   Situare - A location system for Facebook
-   Copyright (C) 2010  Ixonos Plc. Authors:
-
-      Katri Kaikkonen - katri.kaikkonen@ixonos.com
-
-   Situare is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as published by the Free Software Foundation.
-
-   Situare is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with Situare; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
-   USA.
-*/
-
-#ifndef UPDATELOCATIONDIALOG_H
-#define UPDATELOCATIONDIALOG_H
-
-#include <QDialog>
-#include <QtGui>
-#ifdef Q_WS_MAEMO_5
-#include <QAbstractKineticScroller>
-#endif // Q_WS_MAEMO_5
-#include "texteditautoresizer.h"
-
-class QCheckBox;
-class QDialogButtonBox;
-class QGroupBox;
-class QLabel;
-class QLineEdit;
-class QTextEdit;
-class QPushButton;
-class QScrollArea;
-
-/**
-* @brief Update Location UI
-*
-* @class UpdateLocationDialog UI for update location functionality.
-*/
-class UpdateLocationDialog : public QDialog
-{
-    Q_OBJECT
-
-public:
-    /**
-    * @brief Default constructor
-    *
-    * @param parent
-    */
-    UpdateLocationDialog(QWidget *parent = 0);
-
-private slots:
-
-private:
-    QDialogButtonBox *m_buttonBox; ///< Pointer to DialogButtonBox
-    QCheckBox *m_checkBox; ///< Pointer to CheckBox
-    QLineEdit *m_lineEdit; ///< Pointer to LineEdit
-    QPushButton *m_okButton; ///< Pointer to PushButton
-    QTextEdit *m_textEdit; ///< Pointer to TextEdit
-};
-
-#endif // UPDATELOCATIONDIALOG_H
+/*\r
+   Situare - A location system for Facebook\r
+   Copyright (C) 2010  Ixonos Plc. Authors:\r
+\r
+      Katri Kaikkonen - katri.kaikkonen@ixonos.com\r
+      Henri Lampela - henri.lampela@ixonos.com\r
+\r
+   Situare is free software; you can redistribute it and/or\r
+   modify it under the terms of the GNU General Public License\r
+   version 2 as published by the Free Software Foundation.\r
+\r
+   Situare is distributed in the hope that it will be useful,\r
+   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+   GNU General Public License for more details.\r
+\r
+   You should have received a copy of the GNU General Public License\r
+   along with Situare; if not, write to the Free Software\r
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,\r
+   USA.\r
+*/\r
+\r
+#ifndef UPDATELOCATIONDIALOG_H\r
+#define UPDATELOCATIONDIALOG_H\r
+\r
+#include <QDialog>\r
+\r
+#ifdef Q_WS_MAEMO_5\r
+#include <QAbstractKineticScroller>\r
+#endif // Q_WS_MAEMO_5\r
+\r
+class UpdateLocation;\r
+\r
+#include "texteditautoresizer.h"\r
+\r
+class QCheckBox;\r
+class QDialogButtonBox;\r
+class QGroupBox;\r
+class QLabel;\r
+class QLineEdit;\r
+class QPushButton;\r
+class QScrollArea;\r
+class QTextEdit;\r
+\r
+/**\r
+* @brief Update Location UI\r
+*\r
+* UI for update location functionality.\r
+*/\r
+class UpdateLocationDialog : public QDialog\r
+{\r
+    Q_OBJECT\r
+\r
+public:\r
+    /**\r
+    * @brief Default constructor\r
+    *\r
+    * Is deleted automatically when closed.\r
+    *\r
+    * @param controller Controller for location update\r
+    * @param parent\r
+    */\r
+    UpdateLocationDialog(UpdateLocation *controller, QWidget *parent = 0);\r
+\r
+    /**\r
+      * @brief Destructor\r
+      *\r
+      * Does nothing.\r
+      */\r
+    ~UpdateLocationDialog();\r
+\r
+/*******************************************************************************\r
+ * MEMBER FUNCTIONS AND SLOTS\r
+ ******************************************************************************/\r
+public slots:\r
+    /**\r
+    * @brief Used to set the street address to location label\r
+    *\r
+    * @param address Street address, result from SituareService's reverseGeo\r
+    */\r
+    void setAddress(const QString &address);\r
+\r
+private slots:\r
+    /**\r
+    * @brief Used to connect send button\r
+    */\r
+    void sendUpdate();\r
+\r
+    /**\r
+    * @brief Used to get changes in messagetext\r
+    */\r
+    void textChanged();\r
+\r
+    /**\r
+    * @brief Used to clear default messagetext\r
+    */\r
+    void textSelectionChanged();\r
+\r
+/*******************************************************************************\r
+ * DATA MEMBERS\r
+ ******************************************************************************/\r
+private:\r
+    QCheckBox *m_checkBox;          ///< Pointer to CheckBox\r
+    QLabel *m_charCountLabel;       ///< Pointer to character counter label\r
+    QLabel *m_locationLabel;        ///< Pointer to locationLabel\r
+    QTextEdit *m_textEdit;          ///< Pointer to TextEdit\r
+\r
+    UpdateLocation *m_controller;   ///< Controller for location update dialog\r
+};\r
+\r
+#endif // UPDATELOCATIONDIALOG_H\r