messagingapp/msgui/unifiededitor/inc/msgunieditoraudiowidget.h
changeset 34 84197e66a4bd
child 51 3507212d340e
equal deleted inserted replaced
31:ebfee66fde93 34:84197e66a4bd
       
     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.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef MSG_UNIFIED_EDITOR_AUDIO_WIDGET_H
       
    19 #define MSG_UNIFIED_EDITOR_AUDIO_WIDGET_H
       
    20 
       
    21 // FORWARD DECLARATIONS
       
    22 class MsgUnifiedEditorUtils;
       
    23 
       
    24 #include <HbPushButton>
       
    25 
       
    26 /**
       
    27  * @class MsgUniFiedEditorAudioWidget
       
    28  * @brief This widget is used to display audio content in univiewer.
       
    29  */
       
    30 class MsgUniFiedEditorAudioWidget: public HbPushButton
       
    31 {
       
    32 Q_OBJECT
       
    33 
       
    34 public:
       
    35 
       
    36     /**
       
    37      * Constructor
       
    38      */
       
    39     explicit MsgUniFiedEditorAudioWidget(QGraphicsItem *parent = 0);
       
    40 
       
    41     /**
       
    42      * Destructor
       
    43      */
       
    44     ~MsgUniFiedEditorAudioWidget();
       
    45 
       
    46     /**
       
    47      * Populates the widget contents.
       
    48      * @param mimeType Mime type of media.
       
    49      * @param filePath File path of media.
       
    50      */
       
    51     void populate(const QString &filePath);
       
    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     /**
       
    68      * Emitted when remove action is triggered.
       
    69      */
       
    70     void remove();
       
    71 
       
    72 private slots:
       
    73 
       
    74     /**
       
    75      * Handles short tap event.
       
    76      */
       
    77     void handleShortTap();
       
    78 
       
    79     /**
       
    80      * Handles long tap event.
       
    81      * @param position Scene coordinates of tap.
       
    82      */
       
    83     void handleLongTap(const QPointF &position);
       
    84 
       
    85     /**
       
    86      * Handles opening of media.
       
    87      */
       
    88     void handleOpen();
       
    89 
       
    90     /**
       
    91      * Handles removing of media.
       
    92      */
       
    93     void handleRemove();
       
    94     
       
    95     /**
       
    96      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
       
    97      * events back to back.  
       
    98      */
       
    99     void regrabGesture();
       
   100 
       
   101 private:
       
   102 
       
   103     /**
       
   104      * MsgUnifiedEditorUtils object.
       
   105      * Own
       
   106      */
       
   107     MsgUnifiedEditorUtils *mEditorUtils;
       
   108 
       
   109     /**
       
   110      * Media file path.
       
   111      */
       
   112     QString mMediaPath;
       
   113 };
       
   114 
       
   115 #endif //MSG_UNIFIED_EDITOR_AUDIO_WIDGET_H
       
   116 // EOF