The first "kind of" working version of the new panels
[situare] / src / ui / userinfo.h
index 23f436b..f3514c8 100644 (file)
 class ImageButton;
 
 /**
-* @brief UserInfo shows user's data in expandable item.
-*
-* @class UserInfo userinfo.h "ui/userinfo.h"
-*/
+ * @brief UserInfo shows user's data in expandable item.
+ *
+ * @class UserInfo userinfo.h "ui/userinfo.h"
+ */
 class UserInfo : public QWidget
 {
     Q_OBJECT
+
 public:
     /**
-    * @brief Constructor
-    *
-    * @param parent Parent
-    */
+     * @brief Constructor
+     *
+     * @param parent Parent
+     */
     UserInfo(QWidget *parent=0);
 
     /**
-    * @brief Desctructor
-    * saves unsend user message to settings
-    *
-    */
+     * @brief Desctructor
+     * saves unsend user message to settings
+     *
+     */
     ~UserInfo();
 
 /*******************************************************************************
@@ -61,25 +62,25 @@ public:
 *******************************************************************************/
 protected:
     /**
-    * @brief Set current mouse position to mouse event position.
-    *
-    * @param event QMouseEvent mouse press event
-    */
+     * @brief Set current mouse position to mouse event position.
+     *
+     * @param event QMouseEvent mouse press event
+     */
     void mousePressEvent(QMouseEvent *event);
 
     /**
-    * @brief Call toggleHeight if mouse position is unchanged.
-    *
-    * Check if current mouse position is same as mouse release position.
-    * @param event QMouseEvent mouse release event
-    */
+     * @brief Call toggleHeight if mouse position is unchanged.
+     *
+     * Check if current mouse position is same as mouse release position.
+     * @param event QMouseEvent mouse release event
+     */
     void mouseReleaseEvent(QMouseEvent *event);
 
     /**
-    * @brief This function is called when the widget is drawn
-    *
-    * @param aPaintEvent Pointer to paint event
-    */
+     * @brief This function is called when the widget is drawn
+     *
+     * @param aPaintEvent Pointer to paint event
+     */
     void paintEvent(QPaintEvent *aPaintEvent);
 
 /******************************************************************************
@@ -87,101 +88,98 @@ protected:
 ******************************************************************************/
 public:
     /**
-    * @brief Sets the users current address
-    *
-    * @param address Reference to users current address
-    */
+     * @brief Sets the users current address
+     *
+     * @param address Reference to users current address
+     */
     void setAddress(const QString &address);
 
     /**
-    * @brief Sets the users current coordinates
-    *
-    * @param coordinates Reference to users current coordinates
-    */
+     * @brief Sets the users current coordinates
+     *
+     * @param coordinates Reference to users current coordinates
+     */
     void setCoordinates(const GeoCoordinate &coordinates);
 
     /**
-    * @brief Sets the user picture
-    *
-    * @param image Reference to user picture
-    */
+     * @brief Sets the user picture
+     *
+     * @param image Reference to user picture
+     */
     void setProfileImage(const QPixmap &image);
 
     /**
-    * @brief Sets the time of updated message
-    *
-    * @param time Reference to time when message was sent.
-    */
+     * @brief Sets the time of updated message
+     *
+     * @param time Reference to time when message was sent.
+     */
     void setTime(const QString &time);
 
-   /**
-    * @brief Sets the user name
-    *
-    * @param name Reference to user name
-    */
+    /**
+     * @brief Sets the user name
+     *
+     * @param name Reference to user name
+     */
     void setUserName(const QString &name);
 
 public slots:
 
     /**
-    * @brief Clears backups of message and publish on Facebook setting
-    */
+     * @brief Clears backups of message and publish on Facebook setting
+     */
     void clearUpdateLocationDialogData();
 
     /**
-    * @brief Saves status message and Facebook publish setting
-    *
-    * @param status message that user sends. Message is stored to m_backupMessage data member
-    * @param publish setting that determines whether the user status message is published on
-    *        Facebook. This value is stored to m_backupFacebookPublishPolicity data member.
-    */
+     * @brief Saves status message and Facebook publish setting
+     *
+     * @param status message that user sends. Message is stored to m_backupMessage data member
+     * @param publish setting that determines whether the user status message is published on
+     *        Facebook. This value is stored to m_backupFacebookPublishPolicity data member.
+     */
     void backupUpdateLocationDialogData(const QString &status, bool publish);
 
     /**
-    * @brief Sets the message text
-    *
-    * @param text Reference to user message
-    */
+     * @brief Sets the message text
+     *
+     * @param text Reference to user message
+     */
     void setMessageText(const QString &text);
 
 private:
 
     /**
-    * @brief reads Unsend message from settings at startup
-    *
-    */
+     * @brief reads Unsend message from settings at startup
+     */
     void restoreUnsendMessage();
 
     /**
-    * @brief Set shortened or full-length text to labels.
-    *
-    * @param expanded true if full-length text is set, false otherwise
-    */
+     * @brief Set shortened or full-length text to labels.
+     *
+     * @param expanded true if full-length text is set, false otherwise
+     */
     void setText(bool expanded);
 
     /**
-    * @brief Set shortened texts from User data.
-    *
-    * Text length is defined by MAXIMUM_CHARS.
-    */
+     * @brief Set shortened texts from User data.
+     *
+     * Text length is defined by MAXIMUM_CHARS.
+     */
     QString shortenText(const QLabel *label, const QString &text, int textMaxWidth);
 
 private slots:
     /**
-    * @brief Slot for find button click
-    */
+     * @brief Slot for find button click
+     */
     void findButtonClicked();
 
     /**
-    * @brief Slot function to forward messageUpdate launch signal
-    *
-    */
+     * @brief Slot function to forward messageUpdate launch signal
+     */
     void messageUpdate();
 
     /**
-    * @brief Slot function to get indication when dialog is finished
-    *
-    */
+     * @brief Slot function to get indication when dialog is finished
+     */
     void updateLocationDialogFinished(int reason);
 
 /******************************************************************************
@@ -189,70 +187,73 @@ private slots:
 ******************************************************************************/
 signals:
     /**
-    * @brief Signal for finding user.
-    *
-    * @param coordinates user geo coordinates
-    */
+     * @brief Signal for finding user.
+     *
+     * @param coordinates user geo coordinates
+     */
     void findUser(const GeoCoordinate &coordinates);
 
     /**
-    * @brief Signal that used to inform user that his message/location update tp Situare server
-    *        was failed.
-    *        This signal is originally sended from UserInfo
-    * @param message message for notification
-    * @param modal true if modal notification otherwice false
-    */
+     * @brief Signal that used to inform user that his message/location update tp Situare server
+     *        was failed.
+     *        This signal is originally sended from UserInfo
+     * @param message message for notification
+     * @param modal true if modal notification otherwice false
+     */
     void notificateUpdateFailing(const QString &message, bool modal);
 
     /**
-    * @brief Signal for refreshing user data.
-    *
-    */
+     * @brief Signal for refreshing user data.
+     */
     void refreshUserData();
 
     /**
-    * @brief Signal for requesting reverseGeo from SituareEngine
-    *
-    */
+     * @brief Signal for requesting reverseGeo from SituareEngine
+     */
     void requestReverseGeo();
 
     /**
-    * @brief Signals, when address data is ready
-    *
-    * @param address Street address
-    */
+     * @brief Signals, when address data is ready
+     *
+     * @param address Street address
+     */
     void reverseGeoReady(const QString &address);
 
     /**
-    * @brief Signal for requestLocationUpdate from SituareEngine via MainWindow class
-    *
-    * @param status Status message
-    * @param publish Publish on Facebook
-    */
+     * @brief Signal for requestLocationUpdate from SituareEngine via MainWindow class
+     *
+     * @param status Status message
+     * @param publish Publish on Facebook
+     */
     void statusUpdate(const QString &status, const bool &publish);
 
 /******************************************************************************
 * DATA MEMBERS
 ******************************************************************************/
 private:
-    bool m_backupFacebookPublishPolicity; ///< Backup of publish on Facebook checkbox value
-    bool m_expanded;                    ///< Item expanded state
-    QLabel *m_locationLabel;            ///< Location label
-    QLabel *m_nameLabel;                ///< Name label
-    QLabel *m_statusTextLabel;          ///< Status text label
-    QLabel *m_updatedLabel;             ///< Updated label
-    QPixmap m_backgroundBottomImage;    ///< Bottom background image
-    QPixmap m_backgroundMiddleImage;    ///< Middle background image
-    QPixmap m_backgroundTopImage;       ///< Top background image
-    QPoint m_mousePosition;             ///< Current mouse press position
-    GeoCoordinate m_coordinates;        ///< User current coordinates
-    QString m_address;                  ///< Address from where the new message was sent
-    QString m_backupMessage;            ///< Backup of users message
-    QString m_expandedMessageText;      ///< Expanded message text
-    QString m_messageText;              ///< User's message
-    QString m_time;                     ///< Time when the new message was sent
-    QString m_userName;                 ///< User's name
-    ImageButton *m_findButton;          ///< User find button
+    bool m_backupFacebookPublishPolicity;   ///< Backup of publish on Facebook checkbox value
+    bool m_expanded;                        ///< Item expanded state
+
+    QLabel *m_locationLabel;                ///< Location label
+    QLabel *m_nameLabel;                    ///< Name label
+    QLabel *m_statusTextLabel;              ///< Status text label
+    QLabel *m_updatedLabel;                 ///< Updated label
+
+    QPixmap m_backgroundBottomImage;        ///< Bottom background image
+    QPixmap m_backgroundMiddleImage;        ///< Middle background image
+    QPixmap m_backgroundTopImage;           ///< Top background image
+
+    QPoint m_mousePosition;                 ///< Current mouse press position
+
+    QString m_address;                      ///< Address from where the new message was sent
+    QString m_backupMessage;                ///< Backup of users message
+    QString m_expandedMessageText;          ///< Expanded message text
+    QString m_messageText;                  ///< User's message
+    QString m_time;                         ///< Time when the new message was sent
+    QString m_userName;                     ///< User's name
+
+    GeoCoordinate m_coordinates;            ///< User current coordinates
+    ImageButton *m_findButton;              ///< User find button
     UpdateLocationDialog *m_updateLocation; ///< Update location dialog
 };