messagingapp/msgui/unifiedviewer/inc/univieweraudiowidget.h
changeset 37 518b245aa84c
child 51 3507212d340e
equal deleted inserted replaced
25:84d9eb65b26f 37:518b245aa84c
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: This widget is used to display audio content in univiewer.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef UNI_VIEWER_AUDIO_WIDGET_H
       
    19 #define UNI_VIEWER_AUDIO_WIDGET_H
       
    20 
       
    21 // FORWARD DECLARATIONS
       
    22 class UniViewerUtils;
       
    23 class UniMessageInfo;
       
    24 
       
    25 #include <HbPushButton>
       
    26 
       
    27 /**
       
    28  * @class UniViewerAudioWidget
       
    29  * @brief This widget is used to display audio content in univiewer.
       
    30  */
       
    31 class UniViewerAudioWidget: public HbPushButton
       
    32 {
       
    33 Q_OBJECT
       
    34 
       
    35 public:
       
    36 
       
    37     /**
       
    38      * Constructor
       
    39      */
       
    40     explicit UniViewerAudioWidget(QGraphicsItem *parent = 0);
       
    41 
       
    42     /**
       
    43      * Destructor
       
    44      */
       
    45     ~UniViewerAudioWidget();
       
    46 
       
    47     /**
       
    48      * Populates the widget contents.
       
    49      * @param info Object information.
       
    50      */
       
    51     void populate(UniMessageInfo *info);
       
    52 
       
    53 signals:
       
    54 
       
    55     /**
       
    56      * Signal emitted when widget is clicked.
       
    57      * @param mediaPath File path of the media.
       
    58      */
       
    59     void shortTap(const QString &mediaPath);
       
    60 
       
    61     /**
       
    62      * Signal emitted when widget is long tapped.
       
    63      * @param position Scene coordinates of tap.
       
    64      */
       
    65     void longTap(const QPointF &position);
       
    66 
       
    67 private slots:
       
    68 
       
    69     /**
       
    70      * Handles short tap event.
       
    71      */
       
    72     void handleShortTap();
       
    73 
       
    74     /**
       
    75      * Handles long tap event.
       
    76      * @param position Scene coordinates of tap.
       
    77      */
       
    78     void handleLongTap(const QPointF &position);
       
    79 
       
    80     /**
       
    81      * Handles opening of media.
       
    82      */
       
    83     void handleOpen();
       
    84 
       
    85     /**
       
    86      * Handles saving of media.
       
    87      */
       
    88     void handleSave();
       
    89     
       
    90     /**
       
    91      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
       
    92      * events back to back.  
       
    93      */
       
    94     void regrabGesture();
       
    95 
       
    96 private:
       
    97 
       
    98     /**
       
    99      * UniViewerUtils object.
       
   100      * Own
       
   101      */
       
   102     UniViewerUtils *mViewerUtils;
       
   103 
       
   104     /**
       
   105      * Media file path.
       
   106      */
       
   107     QString mMediaPath;
       
   108 
       
   109     /**
       
   110      * Mime type of media.
       
   111      */
       
   112     QString mMimeType;
       
   113 };
       
   114 
       
   115 #endif //UNI_VIEWER_AUDIO_WIDGET_H
       
   116 // EOF