| 56 |      1 | /*
 | 
|  |      2 |  * Copyright (c) 2010 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:
 | 
|  |     15 |  *     The header file for messaging's audio fetcher view.
 | 
|  |     16 |  *
 | 
|  |     17 |  */
 | 
|  |     18 | 
 | 
|  |     19 | #ifndef MSGAUDIOFETCHERDIALOG_H
 | 
|  |     20 | #define MSGAUDIOFETCHERDIALOG_H
 | 
|  |     21 | 
 | 
| 73 |     22 | #ifdef AUDIO_FETCHER_UNIT_TEST
 | 
|  |     23 |  #define MSGAUDIOFETCHER_DLL_EXPORT
 | 
| 56 |     24 | #else
 | 
| 73 |     25 |  #ifdef  BUILD_MSGAUDIOFETCHER_DLL
 | 
|  |     26 |   #define MSGAUDIOFETCHER_DLL_EXPORT Q_DECL_EXPORT
 | 
|  |     27 |  #else
 | 
|  |     28 |   #define MSGAUDIOFETCHER_DLL_EXPORT Q_DECL_IMPORT
 | 
|  |     29 |  #endif
 | 
| 56 |     30 | #endif
 | 
|  |     31 | 
 | 
|  |     32 | // SYSTEM INCLUDES
 | 
|  |     33 | #include <QObject>
 | 
|  |     34 | #include <hblistwidget.h>
 | 
|  |     35 | #include <HbDialog>
 | 
|  |     36 | 
 | 
|  |     37 | // FORWARD DECLARATIONS
 | 
|  |     38 | //class MsgAudioFetcherWidget;
 | 
|  |     39 | class HbAction;
 | 
|  |     40 | class HbListView;
 | 
|  |     41 | class MsgAudioFetcherModel;
 | 
|  |     42 | class MsgAudioPreview;
 | 
|  |     43 | 
 | 
|  |     44 | /**
 | 
|  |     45 |  * @class MsgAudioFetcherView
 | 
|  |     46 |  * @brief This class is messaging's audio fetcher view
 | 
|  |     47 |  */
 | 
|  |     48 | class MSGAUDIOFETCHER_DLL_EXPORT MsgAudioFetcherDialog : public HbDialog
 | 
|  |     49 | {
 | 
|  |     50 | Q_OBJECT
 | 
|  |     51 | 
 | 
|  |     52 | public:
 | 
|  |     53 |     /**
 | 
|  |     54 |      * Constructor
 | 
|  |     55 |      */
 | 
|  |     56 |     explicit MsgAudioFetcherDialog(QGraphicsItem *parent = 0);
 | 
|  |     57 | 
 | 
|  |     58 |     /**
 | 
|  |     59 |      * Destructor
 | 
|  |     60 |      */
 | 
|  |     61 |     ~MsgAudioFetcherDialog();  
 | 
|  |     62 |         
 | 
|  |     63 | private:
 | 
|  |     64 |     /**
 | 
|  |     65 |      * Creates a widget and sets it to the view
 | 
|  |     66 |      */
 | 
|  |     67 |     void initMainWidget();
 | 
|  |     68 | 
 | 
|  |     69 |     /**
 | 
|  |     70 |      * Initializes dialog actions
 | 
|  |     71 |      */
 | 
|  |     72 |     void initActions();   
 | 
|  |     73 |     
 | 
|  |     74 |     /**
 | 
|  |     75 |      * Returns the selected audio path
 | 
|  |     76 |      */
 | 
|  |     77 |     QString getCurrentItemPath();
 | 
|  |     78 | 
 | 
|  |     79 | signals:
 | 
|  |     80 | 
 | 
|  |     81 |     /**
 | 
|  |     82 |      * Emits when audio selected from dialog
 | 
|  |     83 |      */
 | 
|  |     84 |     void audioSelected(QString& filePath);
 | 
|  |     85 |     
 | 
|  |     86 | private slots:
 | 
|  |     87 | 
 | 
|  |     88 |     /**
 | 
|  |     89 |      * On View Ready signal do some construction
 | 
|  |     90 |      */
 | 
|  |     91 |     void doDelayedConstruction();
 | 
|  |     92 |     
 | 
|  |     93 |     /**
 | 
|  |     94 |      * Handles toolbar's leftaction (select)
 | 
|  |     95 |      */
 | 
|  |     96 |     void onSelectAction();
 | 
|  |     97 | 
 | 
|  |     98 |     /**
 | 
|  |     99 |      * Handles toolbar's rightaction (cancel)
 | 
|  |    100 |      */
 | 
|  |    101 |     void onCancelAction();
 | 
|  |    102 | 
 | 
|  |    103 |     /**
 | 
|  |    104 |      * On close of dialog this resets the item
 | 
|  |    105 |      */
 | 
|  |    106 |     void reset();
 | 
|  |    107 |     
 | 
|  |    108 |     /**
 | 
|  |    109 |      * This gets called after list item gets 
 | 
|  |    110 |      * activated
 | 
|  |    111 |      */
 | 
|  |    112 |     void on_list_activated(const QModelIndex &index);
 | 
|  |    113 | 
 | 
|  |    114 | private:
 | 
|  |    115 |     
 | 
|  |    116 |     /**
 | 
|  |    117 |      * List for displaying the audio list
 | 
|  |    118 |      */
 | 
|  |    119 |     HbListView* mListView;
 | 
|  |    120 |     
 | 
|  |    121 |     /**
 | 
|  |    122 |      * Model for the List View
 | 
|  |    123 |      */
 | 
|  |    124 |     MsgAudioFetcherModel* mFetcherModel;
 | 
|  |    125 |     
 | 
|  |    126 |     /**
 | 
|  |    127 |      * Audio preview instance
 | 
|  |    128 |      */
 | 
|  |    129 |     MsgAudioPreview* mAudioPreview;
 | 
|  |    130 |     
 | 
|  |    131 |     /**
 | 
|  |    132 |      * Toolbar's left SELECT action
 | 
|  |    133 |      */
 | 
|  |    134 |     HbAction *mLeftAction;
 | 
|  |    135 |     
 | 
|  |    136 |     /**
 | 
|  |    137 |      * last selected item
 | 
|  |    138 |      */
 | 
|  |    139 |     QModelIndex mSeletedItem;
 | 
|  |    140 |     
 | 
|  |    141 |     /**
 | 
|  |    142 |      * This to enable the left action in dialog
 | 
|  |    143 |      */
 | 
|  |    144 |     bool mSelected;
 | 
| 73 |    145 | #ifdef AUDIO_FETCHER_UNIT_TEST
 | 
|  |    146 |     /**
 | 
|  |    147 |      * Unit Testing
 | 
|  |    148 |      */
 | 
|  |    149 |     friend class TestMsgAudioFetcherDialog;
 | 
|  |    150 | #endif
 | 
| 56 |    151 | };
 | 
|  |    152 | 
 | 
|  |    153 | #endif /* MSGAUDIOFETCHERVIEW_H */
 |