messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h
changeset 27 e4592d119491
parent 25 84d9eb65b26f
child 47 5b14749788d7
equal deleted inserted replaced
25:84d9eb65b26f 27:e4592d119491
    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;
    28 class QGraphicsSceneMouseEvent;
    29 class HbGestureSceneFilter;
    29 //class HbGestureSceneFilter;
       
    30 class ThumbnailManager;
    30 
    31 
    31 #include "convergedmessageaddress.h"
    32 #include "convergedmessageaddress.h"
    32 
    33 
    33 /**
    34 /**
    34  * This class is a custom layout widget for Contact Card layout.
    35  * This class is a custom layout widget for Contact Card layout.
    35  */
    36  */
    36 class MsgContactCardWidget : public HbWidget
    37 class MsgContactCardWidget: public HbWidget
    37 {
    38 {
    38 Q_OBJECT
    39 Q_OBJECT
    39 
    40 
    40 public:
    41 public:
    41 
    42 
    76 
    77 
    77     /**
    78     /**
    78      * Refreshes all the Contact card fields.
    79      * Refreshes all the Contact card fields.
    79      */
    80      */
    80     void updateContents();
    81     void updateContents();
    81     
       
    82 
    82 
    83     /**
    83     /**
    84      * Clears  all the Contact card fields.
    84      * Clears  all the Contact card fields.
    85      */
    85      */
    86     void clearContent();
    86     void clearContent();
    87     
    87 
    88     /**
    88     /**
    89      * for tactile feed back.
    89      * for tactile feed back.
    90      */
    90      * Depricated
    91     HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const;
    91      */
    92     
    92   //  HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const;
       
    93 
    93     /**
    94     /**
    94      * To connect/disconnect clicked signal
    95      * To connect/disconnect clicked signal
    95      */
    96      */
    96     void connectSignals(bool yes);
    97     void connectSignals(bool yes);
    97     
    98 
    98 protected:
    99 protected:
    99     /**
   100     /**
   100      * reimplemented from base class.
   101      * reimplemented from base class.
   101      */
   102      */
   102     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
   103     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
   103     
   104 
   104     /**
   105     /**
   105      * reimplemented from base class.
   106      * reimplemented from base class.
   106      */
   107      */
   107     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
   108     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
   108 
   109 
   115     
   116     
   116     /** Helper method to get contact id against phone number.
   117     /** Helper method to get contact id against phone number.
   117      * @param value phone number.
   118      * @param value phone number.
   118      */
   119      */
   119     int resolveContactId(const QString& value);
   120     int resolveContactId(const QString& value);
   120     
   121 
   121     /**
   122     /**
   122      * Helper method to set back ground.
   123      * Helper method to set back ground.
   123      */
   124      */
   124     void setBackGround(const QString& bg);
   125     void setBackGround(const QString& bg);
   125     
   126 
   126 private slots:
   127 private slots:
   127     /**
   128     /**
   128      * show longpress menu for attachment object
   129      * show longpress menu for attachment object
   129      */
   130      */
   130     void handleLongPress(QPointF position);
   131     void handleLongPress(QPointF position);
   131     
   132 
   132     /**
   133     /**
   133      * Helper method to initialize gesture.
   134      * Helper method to initialize gesture.
   134      */
   135      */
   135     void initGesture();
   136     void initGesture();
   136 	
   137 
   137     /**
   138     /**
   138      * Slot for handling valid returns from the framework.
   139      * Slot for handling valid returns from the framework.
   139      * Updates the display name in the contact card widget.
   140      * Updates the display name in the contact card widget.
   140      * @param result const QVariant&
   141      * @param result const QVariant&
   141      */
   142      */
   142     void handleOk(const QVariant& result);
   143     void handleOk(const QVariant& result);
   143     
   144 
   144     /**
   145     /**
   145      * Slot for handling errors. Error ids are provided as 
   146      * Slot for handling errors. Error ids are provided as 
   146      * 32-bit integers.
   147      * 32-bit integers.
   147      * @param errorCode qint32
   148      * @param errorCode qint32
   148      */
   149      */
   149     void handleError(int errorCode, const QString& errorMessage);
   150     void handleError(int errorCode, const QString& errorMessage);
   150 	    
   151 
   151     /**
   152     /**
   152      * Called when clicked() signal is emitted
   153      * Called when clicked() signal is emitted
   153      * Launches phonebook to view an existing contact 
   154      * Launches phonebook to view an existing contact 
   154      * or to add a new contact
   155      * or to add a new contact
   155      */
   156      */
   156     void openContactInfo();
   157     void openContactInfo();
   157     
   158 
   158     /**
   159     /**
   159      * Launches Dialer Service 
   160      * Launches Dialer Service 
   160      */
   161      */
   161     void call();
   162     void call();
   162     
   163 
   163     /**
   164     /**
   164      * Adds unknown number to phonebook
   165      * Adds unknown number to phonebook
   165      */
   166      */
   166     void addToContacts();
   167     void addToContacts();
   167     
   168 
   168     /**
   169     /**
   169      * Called after service request is completed.
   170      * Called after service request is completed.
   170      */
   171      */
   171     void onServiceRequestCompleted();
   172     void onServiceRequestCompleted();
   172     
   173     
       
   174     /**
       
   175      * Slot hit when the thumbnail is ready.
       
   176      */
       
   177     void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
       
   178 
   173 signals:
   179 signals:
   174    /**
   180     /**
   175 	* Emitted when contact card is short tapped.
   181      * Emitted when contact card is short tapped.
   176 	*/
   182      */
   177     void clicked();
   183     void clicked();
   178     
       
   179 
   184 
   180 private:
   185 private:
   181     // Data
   186     // Data
   182 
   187 
   183 
   188 
   184     /**
   189     /**
   185      * To supress short tap if long tap triggered.
   190      * To supress short tap if long tap triggered.
   186      */
   191      */
   187     bool mMenuShown;  
   192     bool mMenuShown;
   188 	
   193 
   189 	/**
   194     /**
   190      * Contact Number for the conversation
   195      * Contact Number for the conversation
   191      */
   196      */
   192     QString mContactNumber;
   197     QString mContactNumber;
   193 	
   198 
   194     /**
   199     /**
   195      * Address string.
   200      * Address string.
   196      */
   201      */
   197     QString mAddress;
   202     QString mAddress;
   198 
   203 
   211     /**
   216     /**
   212      * Address text item.
   217      * Address text item.
   213      * Own.
   218      * Own.
   214      */
   219      */
   215     HbTextItem *mAddressTextItem;
   220     HbTextItem *mAddressTextItem;
   216 	   
   221 
   217     /**
   222     /**
   218      * gesture filter for long press.
   223      * gesture filter for long press.
   219      */    
   224      */
   220     HbGestureSceneFilter* mGestureFilter;
   225   //  HbGestureSceneFilter* mGestureFilter;
   221 	
   226 
   222 
   227     /**
   223     
   228      * ThumbnailManager
   224   
   229      * Own.
       
   230      */
       
   231     ThumbnailManager *mThumbnailManager;
   225 };
   232 };
   226 
   233 
   227 #endif // MSGCONTACTCARDWIDGET_H
   234 #endif // MSGCONTACTCARDWIDGET_H
   228 // EOF
   235 // EOF