messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h
changeset 34 84197e66a4bd
parent 31 ebfee66fde93
child 44 36f374c67aa8
equal deleted inserted replaced
31:ebfee66fde93 34:84197e66a4bd
    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     /**
       
    89      * for tactile feed back.
       
    90      * Depricated
       
    91      */
       
    92   //  HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const;
       
    93 
       
    94     /**
       
    95      * To connect/disconnect clicked signal
       
    96      */
       
    97     void connectSignals(bool yes);
       
    98 
       
    99 protected:
    87 protected:
   100     /**
    88 
   101      * reimplemented from base class.
    89     /**
   102      */
    90      * Event handler for gesture events.
   103     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
    91      * Reimplemented from HbWidgetBase.
   104 
    92      * @see HbWidgetBase
   105     /**
    93      */
   106      * reimplemented from base class.
    94     virtual void gestureEvent(QGestureEvent *event);
   107      */
       
   108     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
       
   109 
    95 
   110 private:
    96 private:
   111 
    97 
   112     /**
    98     /**
   113      * Initialization function.
    99      * Initialization function.
   114      */
   100      */
   115     void init();
   101     void init();
   116     
   102 
   117     /** Helper method to get contact id against phone number.
   103     /** Helper method to get contact id against phone number.
   118      * @param value phone number.
   104      * @param value phone number.
   119      */
   105      */
   120     int resolveContactId(const QString& value);
   106     int resolveContactId(const QString& value);
   121 
   107 
   122     /**
   108     /**
   123      * Helper method to set back ground.
   109      * Handles pressed state.
   124      */
   110      */
   125     void setBackGround(const QString& bg);
   111     void setPressed(bool pressed);
   126 
   112 
   127 private slots:
   113 private slots:
       
   114 
   128     /**
   115     /**
   129      * show longpress menu for attachment object
   116      * show longpress menu for attachment object
   130      */
   117      */
   131     void handleLongPress(QPointF position);
   118     void handleLongPress(const QPointF &position);
   132 
       
   133     /**
       
   134      * Helper method to initialize gesture.
       
   135      */
       
   136     void initGesture();
       
   137 
   119 
   138     /**
   120     /**
   139      * Slot for handling valid returns from the framework.
   121      * Slot for handling valid returns from the framework.
   140      * Updates the display name in the contact card widget.
   122      * Updates the display name in the contact card widget.
   141      * @param result const QVariant&
   123      * @param result const QVariant&
   168 
   150 
   169     /**
   151     /**
   170      * Called after service request is completed.
   152      * Called after service request is completed.
   171      */
   153      */
   172     void onServiceRequestCompleted();
   154     void onServiceRequestCompleted();
       
   155 
       
   156     /**
       
   157      * Slot hit when the thumbnail is ready.
       
   158      */
       
   159     void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
       
   160 
       
   161     /**
       
   162      * Ignore gesture events.
       
   163      */
       
   164     void ignoreSignals(bool yes);
   173     
   165     
   174     /**
   166     /**
   175      * Slot hit when the thumbnail is ready.
   167      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
   176      */
   168      * events back to back.  
   177     void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
   169      */
   178 
   170     void regrabGesture();
   179 signals:
       
   180     /**
       
   181      * Emitted when contact card is short tapped.
       
   182      */
       
   183     void clicked();
       
   184 
   171 
   185 private:
   172 private:
   186     // Data
   173 
   187 
   174     /**
   188 
   175      * Bool variable on which gesture events are accepted/ignored.
   189     /**
   176      */
   190      * To supress short tap if long tap triggered.
   177     bool mIgnoreEvents;
   191      */
       
   192     bool mMenuShown;
       
   193 
   178 
   194     /**
   179     /**
   195      * Contact Number for the conversation
   180      * Contact Number for the conversation
   196      */
   181      */
   197     QString mContactNumber;
   182     QString mContactNumber;
   216     /**
   201     /**
   217      * Address text item.
   202      * Address text item.
   218      * Own.
   203      * Own.
   219      */
   204      */
   220     HbTextItem *mAddressTextItem;
   205     HbTextItem *mAddressTextItem;
   221 
       
   222     /**
       
   223      * gesture filter for long press.
       
   224      */
       
   225   //  HbGestureSceneFilter* mGestureFilter;
       
   226 
   206 
   227     /**
   207     /**
   228      * ThumbnailManager
   208      * ThumbnailManager
   229      * Own.
   209      * Own.
   230      */
   210      */