messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h
changeset 34 84197e66a4bd
parent 27 e4592d119491
child 43 35b64624a9e7
equal deleted inserted replaced
31:ebfee66fde93 34:84197e66a4bd
    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 
    23 /**
    26 /**
    24  * This widget displays the pixmap content in viewer.
    27  * This widget displays the pixmap content in viewer.
    25  */
    28  */
    26 class UniViewerPixmapWidget: public HbIconItem
    29 class UniViewerPixmapWidget: public HbIconItem
    27 {
    30 {
    39      */
    42      */
    40     ~UniViewerPixmapWidget();
    43     ~UniViewerPixmapWidget();
    41 
    44 
    42     /**
    45     /**
    43      * Sets the pixmap content to be displayed.
    46      * Sets the pixmap content to be displayed.
       
    47      * @param mimeType Mime type of the pixmap.
    44      * @param pixmapPath File path of the pixmap.
    48      * @param pixmapPath File path of the pixmap.
    45      */
    49      */
    46     void setPixmap(const QString &pixmapPath);
    50     void populate(const QString &mimeType, const QString &pixmapPath);
    47 
    51 
    48 signals:
    52 signals:
    49 
    53 
    50     /**
    54     /**
    51      * Signal emitted for short tap on pixmap.
    55      * Signal emitted when widget is clicked.
    52      * @param pixmapPath File path of the pixmap being clicked.
    56      * @param mediaPath File path of the media.
    53      */
    57      */
    54     void shortTap(const QString &pixmapPath);
    58     void shortTap(const QString &mediaPath);
       
    59 
       
    60     /**
       
    61      * Signal emitted when widget is long tapped.
       
    62      * @param position Scene coordinates of tap.
       
    63      */
       
    64     void longTap(const QPointF &position);
    55 
    65 
    56 protected:
    66 protected:
    57 
    67 
    58     /**
    68     /**
    59      * Event handler for gesture events.
    69      * Event handler for gesture events.
    60      * Reimplemented from HbWidgetBase.
    70      * Reimplemented from HbWidgetBase.
    61      * @see HbWidgetBase
    71      * @see HbWidgetBase
    62      */
    72      */
    63     virtual void gestureEvent(QGestureEvent *event);
    73     virtual void gestureEvent(QGestureEvent *event);
    64 
    74 
       
    75 private slots:
       
    76 
       
    77     /**
       
    78      *
       
    79      */
       
    80     void handleOpen();
       
    81 
       
    82     /**
       
    83      *
       
    84      */
       
    85     void handleSave();
       
    86     
       
    87     /**
       
    88      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
       
    89      * events back to back.  
       
    90      */
       
    91     void regrabGesture();
       
    92 
    65 private:
    93 private:
       
    94 
       
    95     /**
       
    96      * Handles short tap event.
       
    97      */
       
    98     void handleShortTap();
       
    99 
       
   100     /**
       
   101      * Handles long tap event.
       
   102      * @param position Scene coordinates of tap.
       
   103      */
       
   104     void handleLongTap(const QPointF &position);
       
   105 
       
   106 private:
       
   107 
       
   108     /**
       
   109      * UniViewerUtils object.
       
   110      * Own
       
   111      */
       
   112     UniViewerUtils *mViewerUtils;
       
   113 
       
   114     /**
       
   115      * Mime Type of pixmap.
       
   116      */
       
   117     QString mMimeType;
    66 
   118 
    67     /**
   119     /**
    68      * Pixmap file path being set.
   120      * Pixmap file path being set.
    69      */
   121      */
    70     QString mPixmapFile;
   122     QString mPixmapPath;
    71 };
   123 };
    72 
   124 
    73 #endif /* UNI_VIEWER_PIXMAP_WIDGET_H */
   125 #endif /* UNI_VIEWER_PIXMAP_WIDGET_H */
    74 
   126 
    75 // EOF
   127 // EOF