messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h
branchGCC_SURGE
changeset 47 5b14749788d7
parent 43 35b64624a9e7
child 52 12db4185673b
equal deleted inserted replaced
35:a32b19fb291e 47:5b14749788d7
    18 #ifndef UNI_VIEWER_PIXMAP_WIDGET_H
    18 #ifndef UNI_VIEWER_PIXMAP_WIDGET_H
    19 #define UNI_VIEWER_PIXMAP_WIDGET_H
    19 #define UNI_VIEWER_PIXMAP_WIDGET_H
    20 
    20 
    21 #include <HbIconItem>
    21 #include <HbIconItem>
    22 
    22 
       
    23 // FORWARD DECLARATIONS
       
    24 class UniViewerUtils;
       
    25 class UniMessageInfo;
       
    26 class ThumbnailManager;
       
    27 
       
    28 
    23 /**
    29 /**
    24  * This widget displays the pixmap content in viewer.
    30  * This widget displays the pixmap content in viewer.
    25  */
    31  */
    26 class UniViewerPixmapWidget: public HbIconItem
    32 class UniViewerPixmapWidget: public HbIconItem
    27 {
    33 {
    39      */
    45      */
    40     ~UniViewerPixmapWidget();
    46     ~UniViewerPixmapWidget();
    41 
    47 
    42     /**
    48     /**
    43      * Sets the pixmap content to be displayed.
    49      * Sets the pixmap content to be displayed.
    44      * @param pixmapPath File path of the pixmap.
    50      * @param info Object information.
    45      */
    51      */
    46     void setPixmap(const QString &pixmapPath);
    52     void populate(UniMessageInfo *info);
    47 
    53 
    48 signals:
    54 signals:
    49 
    55 
    50     /**
    56     /**
    51      * Signal emitted for short tap on pixmap.
    57      * Signal emitted when widget is clicked.
    52      * @param pixmapPath File path of the pixmap being clicked.
    58      * @param mediaPath File path of the media.
    53      */
    59      */
    54     void shortTap(const QString &pixmapPath);
    60     void shortTap(const QString &mediaPath);
       
    61 
       
    62     /**
       
    63      * Signal emitted when widget is long tapped.
       
    64      * @param position Scene coordinates of tap.
       
    65      */
       
    66     void longTap(const QPointF &position);
    55 
    67 
    56 protected:
    68 protected:
    57 
    69 
    58     /**
    70     /**
    59      * Event handler for gesture events.
    71      * Event handler for gesture events.
    60      * Reimplemented from HbWidgetBase.
    72      * Reimplemented from HbWidgetBase.
    61      * @see HbWidgetBase
    73      * @see HbWidgetBase
    62      */
    74      */
    63     virtual void gestureEvent(QGestureEvent *event);
    75     virtual void gestureEvent(QGestureEvent *event);
    64 
    76 
       
    77 private slots:
       
    78 
       
    79     /**
       
    80      *
       
    81      */
       
    82     void handleOpen();
       
    83 
       
    84     /**
       
    85      *
       
    86      */
       
    87     void handleSave();
       
    88 
       
    89     /**
       
    90      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
       
    91      * events back to back.  
       
    92      */
       
    93     void regrabGesture();
       
    94 
       
    95     /**
       
    96      * Slot hit when the thumbnail is ready.
       
    97      */
       
    98    void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
       
    99 
    65 private:
   100 private:
       
   101 
       
   102     /**
       
   103      * Initialization function.
       
   104      */
       
   105     void init();
       
   106 
       
   107     /**
       
   108      * Handles short tap event.
       
   109      */
       
   110     void handleShortTap();
       
   111 
       
   112     /**
       
   113      * Handles long tap event.
       
   114      * @param position Scene coordinates of tap.
       
   115      */
       
   116     void handleLongTap(const QPointF &position);
       
   117 
       
   118 private:
       
   119 
       
   120     /**
       
   121      * UniViewerUtils object.
       
   122      * Own
       
   123      */
       
   124     UniViewerUtils *mViewerUtils;
       
   125 
       
   126     /**
       
   127      * ThumbnailManager
       
   128      * Own.
       
   129      */
       
   130    ThumbnailManager *mThumbnailManager;
       
   131 
       
   132     /**
       
   133      * Mime Type of pixmap.
       
   134      */
       
   135     QString mMimeType;
    66 
   136 
    67     /**
   137     /**
    68      * Pixmap file path being set.
   138      * Pixmap file path being set.
    69      */
   139      */
    70     QString mPixmapFile;
   140     QString mPixmapPath;
    71 };
   141 };
    72 
   142 
    73 #endif /* UNI_VIEWER_PIXMAP_WIDGET_H */
   143 #endif /* UNI_VIEWER_PIXMAP_WIDGET_H */
    74 
   144 
    75 // EOF
   145 // EOF