messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h
branchGCC_SURGE
changeset 47 5b14749788d7
parent 27 e4592d119491
parent 44 36f374c67aa8
equal deleted inserted replaced
35:a32b19fb291e 47:5b14749788d7
    23 
    23 
    24 // FORWORD DECLARATIONS
    24 // FORWORD DECLARATIONS
    25 class HbIconItem;
    25 class HbIconItem;
    26 class HbTextItem;
    26 class HbTextItem;
    27 class HbIcon;
    27 class HbIcon;
    28 class QGraphicsSceneMouseEvent;
       
    29 //class HbGestureSceneFilter;
       
    30 class ThumbnailManager;
    28 class ThumbnailManager;
    31 
    29 
    32 #include "convergedmessageaddress.h"
    30 #include "convergedmessageaddress.h"
    33 
    31 
    34 /**
    32 /**
    35  * This class is a custom layout widget for Contact Card layout.
    33  * @class MsgContactCardWidget
       
    34  * @brief This class is a custom layout widget for Contact Card layout.
    36  */
    35  */
    37 class MsgContactCardWidget: public HbWidget
    36 class MsgContactCardWidget: public HbWidget
    38 {
    37 {
    39 Q_OBJECT
    38 Q_OBJECT
    40 
    39 
    83     /**
    82     /**
    84      * Clears  all the Contact card fields.
    83      * Clears  all the Contact card fields.
    85      */
    84      */
    86     void clearContent();
    85     void clearContent();
    87 
    86 
    88     /**
    87 signals:
    89      * for tactile feed back.
    88 
    90      * Depricated
    89     /**
    91      */
    90      *
    92   //  HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const;
    91      */
    93 
    92     void conversationIdChanged(qint64 convId);
    94     /**
       
    95      * To connect/disconnect clicked signal
       
    96      */
       
    97     void connectSignals(bool yes);
       
    98 
    93 
    99 protected:
    94 protected:
   100     /**
    95 
   101      * reimplemented from base class.
    96     /**
   102      */
    97      * Event handler for gesture events.
   103     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
    98      * Reimplemented from HbWidgetBase.
   104 
    99      * @see HbWidgetBase
   105     /**
   100      */
   106      * reimplemented from base class.
   101     virtual void gestureEvent(QGestureEvent *event);
   107      */
       
   108     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
       
   109 
   102 
   110 private:
   103 private:
   111 
   104 
   112     /**
   105     /**
   113      * Initialization function.
   106      * Initialization function.
   114      */
   107      */
   115     void init();
   108     void init();
   116     
   109 
   117     /** Helper method to get contact id against phone number.
   110     /** Helper method to get contact id against phone number.
   118      * @param value phone number.
   111      * @param value phone number.
   119      */
   112      */
   120     int resolveContactId(const QString& value);
   113     int resolveContactId(const QString& value);
   121 
   114 
   122     /**
   115     /**
   123      * Helper method to set back ground.
   116      * Handles pressed state.
   124      */
   117      */
   125     void setBackGround(const QString& bg);
   118     void setPressed(bool pressed);
   126 
   119 
   127 private slots:
   120 private slots:
   128     /**
   121 
   129      * show longpress menu for attachment object
   122     /**
   130      */
   123      * show longp tap.
   131     void handleLongPress(QPointF position);
   124      */
   132 
   125     void handleLongTap(const QPointF &position);
   133     /**
   126     
   134      * Helper method to initialize gesture.
   127     /**
   135      */
   128      * handles short tap.
   136     void initGesture();
   129      */
       
   130     void handleShortTap(const QPointF &position);
   137 
   131 
   138     /**
   132     /**
   139      * Slot for handling valid returns from the framework.
   133      * Slot for handling valid returns from the framework.
   140      * Updates the display name in the contact card widget.
   134      * Updates the display name in the contact card widget.
   141      * @param result const QVariant&
   135      * @param result const QVariant&
   168 
   162 
   169     /**
   163     /**
   170      * Called after service request is completed.
   164      * Called after service request is completed.
   171      */
   165      */
   172     void onServiceRequestCompleted();
   166     void onServiceRequestCompleted();
       
   167 
       
   168     /**
       
   169      * Slot hit when the thumbnail is ready.
       
   170      */
       
   171     void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
       
   172 
       
   173     /**
       
   174      * Ignore gesture events.
       
   175      */
       
   176     void ignoreSignals(bool yes);
   173     
   177     
   174     /**
   178     /**
   175      * Slot hit when the thumbnail is ready.
   179      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
   176      */
   180      * events back to back.  
   177     void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
   181      */
   178 
   182     void regrabGesture();
   179 signals:
       
   180     /**
       
   181      * Emitted when contact card is short tapped.
       
   182      */
       
   183     void clicked();
       
   184 
   183 
   185 private:
   184 private:
   186     // Data
   185 
   187 
   186     /**
   188 
   187      * Bool variable on which gesture events are accepted/ignored.
   189     /**
   188      */
   190      * To supress short tap if long tap triggered.
   189     bool mIgnoreEvents;
   191      */
       
   192     bool mMenuShown;
       
   193 
   190 
   194     /**
   191     /**
   195      * Contact Number for the conversation
   192      * Contact Number for the conversation
   196      */
   193      */
   197     QString mContactNumber;
   194     QString mContactNumber;
   216     /**
   213     /**
   217      * Address text item.
   214      * Address text item.
   218      * Own.
   215      * Own.
   219      */
   216      */
   220     HbTextItem *mAddressTextItem;
   217     HbTextItem *mAddressTextItem;
   221 
       
   222     /**
       
   223      * gesture filter for long press.
       
   224      */
       
   225   //  HbGestureSceneFilter* mGestureFilter;
       
   226 
   218 
   227     /**
   219     /**
   228      * ThumbnailManager
   220      * ThumbnailManager
   229      * Own.
   221      * Own.
   230      */
   222      */