messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h
changeset 37 518b245aa84c
parent 25 84d9eb65b26f
child 56 f42d9a78f435
equal deleted inserted replaced
25:84d9eb65b26f 37:518b245aa84c
    13  *
    13  *
    14  * Description:attachment field to show attachment details.
    14  * Description:attachment field to show attachment details.
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #ifndef UNIFIED_EDITOR_ATTACHMENT_H
    18 #ifndef MSG_UNIFIED_EDITOR_ATTACHMENT_H
    19 #define UNIFIED_EDITOR_ATTACHMENT_H
    19 #define MSG_UNIFIED_EDITOR_ATTACHMENT_H
    20 
    20 
    21 #include <HbWidget>
    21 #include <HbWidget>
    22 #include <QList>
    22 #include <QList>
    23 
    23 
    24 class HbTextItem;
    24 class HbTextItem;
    25 class HbIconItem;
    25 class HbIconItem;
    26 class HbGestureSceneFilter;
    26 class HbGestureSceneFilter;
       
    27 class HbFrameItem;
       
    28 class MsgUnifiedEditorUtils;
    27 
    29 
    28 class MsgUnifiedEditorAttachment : public HbWidget
    30 class MsgUnifiedEditorAttachment : public HbWidget
    29     {
    31     {
    30     Q_OBJECT
    32     Q_OBJECT
    31 
    33 
    32 public:
    34 public:
    33 
    35 
    34     /**
    36     /**
    35      * Constructor
    37      * Constructor
    36      */
    38      */
    37     MsgUnifiedEditorAttachment( const QString& pluginPath,
    39     MsgUnifiedEditorAttachment( const QString& attachmentpath,
    38                                 const QString& attachmentpath,
       
    39                                 const int filesize,
    40                                 const int filesize,
    40                                 QGraphicsItem *parent = 0 );
    41                                 QGraphicsItem *parent = 0 );
    41 
    42 
    42     /**
    43     /**
    43      * Destructor
    44      * Destructor
    66      * Check if the attachment content is MM content
    67      * Check if the attachment content is MM content
    67      * @return true/false
    68      * @return true/false
    68      */
    69      */
    69     bool isMultimediaContent();
    70     bool isMultimediaContent();
    70     
    71     
    71     HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const;
       
    72 
       
    73 protected:
    72 protected:
    74     /**
    73     /**
    75      * reimplemented from base class.
    74      * reimplemented from base class.
    76      */
    75      */
    77     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
    76     virtual void gestureEvent(QGestureEvent *event);
    78     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
       
    79     
    77     
    80     
    78     
    81 private:
    79 private:
    82     /**
    80    
    83      * Helper method to initialize gesture.
    81     void setPressed(bool pressed);
    84      */
       
    85     void initGesture();
       
    86 
    82 
    87 
    83 
    88 signals:
    84 signals:
    89     /**
    85     /**
    90 	 * emit when short-tap happens on the attachment
    86 	 * emit when short-tap happens on the attachment
    98 
    94 
    99 private slots:
    95 private slots:
   100     /**
    96     /**
   101 	 * show longpress menu for attachment object
    97 	 * show longpress menu for attachment object
   102 	 */
    98 	 */
   103     void longPressed(QPointF position);
    99     void handleLongTap(QPointF position);
       
   100     
       
   101     /**
       
   102      * Handles short tap event.
       
   103      */
       
   104     void handleShortTap();
   104 
   105 
   105 	/**
   106 	/**
   106 	 * slot to remove attachment from msg editor
   107 	 * slot to remove attachment from msg editor
   107 	 */
   108 	 */
   108     void removeAttachment();
   109     void handleRemove();
   109 
   110 
   110 	/**
   111 	/**
   111 	 * slot to open attachment
   112 	 * slot to open attachment
   112 	 */
   113 	 */
   113     void openAttachment();
   114     void handleOpen();
   114 
   115 
   115 	/**
   116 	/**
   116 	 * slot to view details of the attachment file
   117 	 * slot to view details of the attachment file
   117 	 */
   118 	 */
   118     void viewDetails();
   119     void viewDetails();
       
   120     
       
   121     /**
       
   122      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
       
   123      * events back to back.  
       
   124      */
       
   125     void regrabGesture();
   119 
   126 
   120 private:
   127 private:
   121     /**
       
   122 	 * style plugin path
       
   123 	 */
       
   124     QString mPluginPath;
       
   125 
       
   126     /**
   128     /**
   127 	 * attachment file's path
   129 	 * attachment file's path
   128 	 */
   130 	 */
   129     QString mPath;
   131     QString mPath;
   130 
   132 
   160 	
   162 	
   161 	/**
   163 	/**
   162      * Max limit on sms size. Store at class level for optimization
   164      * Max limit on sms size. Store at class level for optimization
   163      */
   165      */
   164     int mMaxSmsSize;
   166     int mMaxSmsSize;
       
   167     
       
   168 	/**
       
   169      * Background item
       
   170      * Own
       
   171      */
       
   172     HbFrameItem* mBackGround;
       
   173     
       
   174     /**
       
   175      * MsgUnifiedEditorUtils object.
       
   176      * Own
       
   177      */
       
   178     MsgUnifiedEditorUtils *mEditorUtils;
   165 
   179 
   166     };
   180     };
   167 
   181 
   168 typedef QList<MsgUnifiedEditorAttachment*> MsgUnifiedEditorAttachmentList;
   182 typedef QList<MsgUnifiedEditorAttachment*> MsgUnifiedEditorAttachmentList;
   169 
   183 
   170 #endif //UNIFIED_EDITOR_ATTACHMENT_H
   184 #endif //MSG_UNIFIED_EDITOR_ATTACHMENT_H